@mmlogic/components 0.4.1 → 0.4.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/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} +269 -50
- 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 +30 -8
- package/dist/collection/components/documents/mrd-document-list/mrd-document-list.css +8 -5
- package/dist/collection/components/documents/mrd-document-list/mrd-document-list.js +28 -11
- package/dist/collection/components/documents/mrd-document-list/tree-view.js +14 -2
- 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 +99 -9
- package/dist/collection/components/table/mrd-table/mrd-table.js +19 -5
- package/dist/collection/dev/api.js +9 -0
- package/dist/collection/dev/app.js +105 -6
- 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/collection/utils/query-params.js +0 -4
- package/dist/components/client-layout.js +1 -1
- package/dist/components/i18n.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/mrd-boolean-field2.js +1 -1
- package/dist/components/mrd-currency-field2.js +1 -1
- package/dist/components/mrd-date-field2.js +1 -1
- package/dist/components/mrd-datetime-field2.js +1 -1
- package/dist/components/mrd-document-container2.js +1 -1
- package/dist/components/mrd-document-list2.js +1 -1
- package/dist/components/mrd-document-view2.js +1 -1
- package/dist/components/mrd-email-field2.js +1 -1
- package/dist/components/mrd-file-field2.js +1 -1
- package/dist/components/mrd-file-preview.d.ts +11 -0
- package/dist/components/mrd-file-preview.js +1 -0
- package/dist/components/mrd-file-preview2.js +1 -0
- package/dist/components/mrd-image-field2.js +1 -1
- package/dist/components/mrd-layout-section.js +1 -1
- package/dist/components/mrd-longtext-field2.js +1 -1
- package/dist/components/mrd-number-field2.js +1 -1
- package/dist/components/mrd-secret-field2.js +1 -1
- package/dist/components/mrd-table2.js +1 -1
- package/dist/components/mrd-text-field2.js +1 -1
- package/dist/components/mrd-textarea-field2.js +1 -1
- package/dist/components/mrd-time-field2.js +1 -1
- package/dist/esm/index.js +9 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/mosterdcomponents.js +1 -1
- package/dist/esm/{mrd-boolean-field_23.entry.js → mrd-boolean-field_24.entry.js} +270 -52
- package/dist/mosterdcomponents/index.esm.js +1 -1
- package/dist/mosterdcomponents/mosterdcomponents.esm.js +1 -1
- package/dist/mosterdcomponents/p-e816d459.entry.js +1 -0
- package/dist/types/components/documents/mrd-document-container/mrd-document-container.d.ts +8 -2
- package/dist/types/components/documents/mrd-document-list/mrd-document-list.d.ts +8 -1
- package/dist/types/components/documents/mrd-document-list/tree-view.d.ts +1 -1
- 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 +19 -1
- package/dist/types/components/table/mrd-table/mrd-table.d.ts +8 -2
- package/dist/types/components.d.ts +186 -13
- package/dist/types/index.d.ts +1 -0
- package/dist/types/types/client-layout.d.ts +10 -0
- package/dist/types/utils/query-params.d.ts +14 -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;
|
|
@@ -976,8 +1008,13 @@ const MrdDocumentContainer = class {
|
|
|
976
1008
|
}, onMrdRowClick: (e) => {
|
|
977
1009
|
var _a, _b, _c;
|
|
978
1010
|
e.stopPropagation();
|
|
979
|
-
const row = e.detail;
|
|
980
|
-
this.mrdNavigate.emit({
|
|
1011
|
+
const { row, listContext } = e.detail;
|
|
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
|
+
listContext,
|
|
1017
|
+
});
|
|
981
1018
|
}, onMrdAction: (e) => {
|
|
982
1019
|
e.stopPropagation();
|
|
983
1020
|
this.mrdAction.emit(e.detail);
|
|
@@ -985,16 +1022,15 @@ const MrdDocumentContainer = class {
|
|
|
985
1022
|
}
|
|
986
1023
|
render() {
|
|
987
1024
|
const treeMode = this.mode === 'tree';
|
|
988
|
-
return (index.h(index.Host, { key: '
|
|
1025
|
+
return (index.h(index.Host, { key: '7d0523d66f9a3d189dcc5517cd7281a57456977d' }, this.renderToolbar(), index.h("div", { key: '19b0f416d2ad1b093afd6f799670debf8c18b225', class: {
|
|
1026
|
+
'mrd-document-container__body': true,
|
|
1027
|
+
'mrd-document-container__body--tree': treeMode,
|
|
1028
|
+
}, style: treeMode ? { height: `${this.height}px`, overflowY: 'auto' } : {} }, treeMode ? this.renderTree() : this.renderList())));
|
|
989
1029
|
}
|
|
990
1030
|
get el() { return index.getElement(this); }
|
|
991
1031
|
};
|
|
992
1032
|
MrdDocumentContainer.style = mrdDocumentContainerCss();
|
|
993
1033
|
|
|
994
|
-
/**
|
|
995
|
-
* Shared path/query-param conventions for list requests,
|
|
996
|
-
* used by mrd-table and mrd-document-list.
|
|
997
|
-
*/
|
|
998
1034
|
/** Applies the view-level static filters to `params` using the API operator conventions. */
|
|
999
1035
|
function applyViewFilters(params, filters) {
|
|
1000
1036
|
var _a, _b, _c;
|
|
@@ -1157,9 +1193,21 @@ function folderIcon() {
|
|
|
1157
1193
|
function docIcon() {
|
|
1158
1194
|
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
1195
|
}
|
|
1196
|
+
/** Depth 0 renders no indent spacer at all — like Finder, the top-level
|
|
1197
|
+
* disclosure triangle sits in the row's own left margin instead of adding
|
|
1198
|
+
* an extra indent column before it. Nested levels still step in 18px each. */
|
|
1160
1199
|
function indent(depth) {
|
|
1200
|
+
if (depth === 0)
|
|
1201
|
+
return null;
|
|
1161
1202
|
return index.h("span", { class: "mrd-document-list__indent", style: { width: `${depth * 18}px` } });
|
|
1162
1203
|
}
|
|
1204
|
+
/** Pixel offset from the row's left edge to where the label text starts,
|
|
1205
|
+
* used to align the inline folder-name-error text under the label above it.
|
|
1206
|
+
* Mirrors the row's padding + (indent) + chevron + icon + gaps in tree-view.scss. */
|
|
1207
|
+
function labelOffset(depth) {
|
|
1208
|
+
const chevronAndIcon = 4 /* gap */ + 14 /* chevron */ + 4 /* gap */ + 17 /* icon */ + 4 /* gap */;
|
|
1209
|
+
return depth === 0 ? 8 + chevronAndIcon : 8 + depth * 18 + chevronAndIcon;
|
|
1210
|
+
}
|
|
1163
1211
|
function renderLoadingRow(ctx, depth) {
|
|
1164
1212
|
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
1213
|
}
|
|
@@ -1171,10 +1219,10 @@ function renderDocRow(ctx, doc, node, container, depth) {
|
|
|
1171
1219
|
const label = (_b = (_a = doc === null || doc === void 0 ? void 0 : doc[ctx.titleField]) !== null && _a !== void 0 ? _a : doc === null || doc === void 0 ? void 0 : doc.name) !== null && _b !== void 0 ? _b : '';
|
|
1172
1220
|
const dateRaw = ctx.dateField ? doc === null || doc === void 0 ? void 0 : doc[ctx.dateField] : undefined;
|
|
1173
1221
|
const date = dateRaw ? formatDate(dateRaw, ctx.locale) : '';
|
|
1174
|
-
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)));
|
|
1222
|
+
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, node, container), 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
1223
|
}
|
|
1176
1224
|
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
|
|
1225
|
+
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
1226
|
}
|
|
1179
1227
|
function renderNodeChildren(ctx, container, node, depth) {
|
|
1180
1228
|
const out = [];
|
|
@@ -1218,7 +1266,7 @@ function renderContainerNode(ctx, node, depth) {
|
|
|
1218
1266
|
: renderNodeChildren(ctx, node, node, depth + 1)))));
|
|
1219
1267
|
}
|
|
1220
1268
|
|
|
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-
|
|
1269
|
+
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
1270
|
|
|
1223
1271
|
const MrdDocumentList = class {
|
|
1224
1272
|
constructor(hostRef) {
|
|
@@ -1527,18 +1575,24 @@ const MrdDocumentList = class {
|
|
|
1527
1575
|
qs: p.toString(),
|
|
1528
1576
|
});
|
|
1529
1577
|
}
|
|
1530
|
-
|
|
1578
|
+
/** Filter qs scoping a folder's documents: view-level filters + container/folder match.
|
|
1579
|
+
* Shared by emitDocuments() (the fetch) and openDoc() (prev/next list context), so both
|
|
1580
|
+
* always agree on exactly what query a document belongs to. */
|
|
1581
|
+
buildDocQs(container, node) {
|
|
1531
1582
|
var _a, _b;
|
|
1532
1583
|
const p = this.baseParams();
|
|
1533
1584
|
p.set(this.containerField + '_href', (_a = container.href) !== null && _a !== void 0 ? _a : '');
|
|
1534
1585
|
p.set(this.folderField, (_b = node.fullPath) !== null && _b !== void 0 ? _b : '');
|
|
1586
|
+
return p.toString();
|
|
1587
|
+
}
|
|
1588
|
+
emitDocuments(container, node) {
|
|
1535
1589
|
node.loading = true;
|
|
1536
1590
|
this.mrdLoadPage.emit({
|
|
1537
1591
|
nodeId: node.id,
|
|
1538
1592
|
page: 0,
|
|
1539
1593
|
sort: '',
|
|
1540
1594
|
path: this.buildDataPath(),
|
|
1541
|
-
qs:
|
|
1595
|
+
qs: this.buildDocQs(container, node),
|
|
1542
1596
|
});
|
|
1543
1597
|
}
|
|
1544
1598
|
// ── Public injection API ─────────────────────────────────────────────────
|
|
@@ -1807,11 +1861,15 @@ const MrdDocumentList = class {
|
|
|
1807
1861
|
container.totalCount = Math.max(0, container.totalCount + delta);
|
|
1808
1862
|
}
|
|
1809
1863
|
}
|
|
1810
|
-
openDoc(doc) {
|
|
1864
|
+
openDoc(doc, node, container) {
|
|
1811
1865
|
var _a, _b, _c, _d;
|
|
1812
1866
|
const href = (_b = (_a = doc === null || doc === void 0 ? void 0 : doc._links) === null || _a === void 0 ? void 0 : _a.self) === null || _b === void 0 ? void 0 : _b.href;
|
|
1813
1867
|
const label = (_d = (_c = doc === null || doc === void 0 ? void 0 : doc[this.titleField]) !== null && _c !== void 0 ? _c : doc === null || doc === void 0 ? void 0 : doc.name) !== null && _d !== void 0 ? _d : '';
|
|
1814
|
-
|
|
1868
|
+
const index = node.docs.indexOf(doc);
|
|
1869
|
+
const listContext = index >= 0
|
|
1870
|
+
? { index, sort: '', path: this.buildDataPath(), qs: this.buildDocQs(container, node) }
|
|
1871
|
+
: undefined;
|
|
1872
|
+
this.mrdNavigate.emit({ href, label, listContext });
|
|
1815
1873
|
}
|
|
1816
1874
|
// ── Render ───────────────────────────────────────────────────────────────
|
|
1817
1875
|
treeCtx() {
|
|
@@ -1825,7 +1883,7 @@ const MrdDocumentList = class {
|
|
|
1825
1883
|
on: {
|
|
1826
1884
|
toggleContainer: node => this.toggleContainer(node),
|
|
1827
1885
|
toggleFolder: (container, node) => this.toggleFolder(container, node),
|
|
1828
|
-
openDoc: doc => this.openDoc(doc),
|
|
1886
|
+
openDoc: (doc, node, container) => this.openDoc(doc, node, container),
|
|
1829
1887
|
docDragStart: this.onDocDragStart,
|
|
1830
1888
|
docDragEnd: this.onDocDragEnd,
|
|
1831
1889
|
nodeDragOver: this.onNodeDragOver,
|
|
@@ -1845,7 +1903,7 @@ const MrdDocumentList = class {
|
|
|
1845
1903
|
body = renderLoadingRow(ctx, 0);
|
|
1846
1904
|
}
|
|
1847
1905
|
else if (this.containers.length === 0) {
|
|
1848
|
-
body = index.h("div", { key: '
|
|
1906
|
+
body = index.h("div", { key: '49157721108db3b03c8c5e6550692b42dfc2e113', class: "mrd-document-list__empty" }, t('no_results', this.locale));
|
|
1849
1907
|
}
|
|
1850
1908
|
else if (this.singleContainer) {
|
|
1851
1909
|
// Dossier context: render the single container's folder tree at the root.
|
|
@@ -1863,7 +1921,7 @@ const MrdDocumentList = class {
|
|
|
1863
1921
|
else {
|
|
1864
1922
|
body = this.containers.map(c => renderContainerNode(ctx, c, 0));
|
|
1865
1923
|
}
|
|
1866
|
-
return (index.h(index.Host, { key: '
|
|
1924
|
+
return (index.h(index.Host, { key: 'b6d3dd44036a9215979a0dbec699902f308fbeb5' }, index.h("div", { key: '8ec0e58cb5e7192f7a9af9062dd5bc7f7bb00713', class: 'mrd-document-list' + (this.rootDropActive ? ' mrd-document-list--drop-active' : ''), onDragOver: this.onRootDragOver, onDragLeave: this.onRootDragLeave, onDrop: this.onRootDrop }, body)));
|
|
1867
1925
|
}
|
|
1868
1926
|
get el() { return index.getElement(this); }
|
|
1869
1927
|
};
|
|
@@ -1871,16 +1929,43 @@ const MrdDocumentList = class {
|
|
|
1871
1929
|
MrdDocumentList.ROOT = '__root__';
|
|
1872
1930
|
MrdDocumentList.style = mrdDocumentListCss();
|
|
1873
1931
|
|
|
1874
|
-
const mrdDocumentViewCss = () => `.sc-mrd-document-view-h{display:block}.mrd-document-view.sc-mrd-document-view{max-width:
|
|
1932
|
+
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
1933
|
|
|
1876
1934
|
const MrdDocumentView = class {
|
|
1877
1935
|
constructor(hostRef) {
|
|
1878
1936
|
index.registerInstance(this, hostRef);
|
|
1879
1937
|
this.mrdNavigate = index.createEvent(this, "mrdNavigate");
|
|
1880
1938
|
this.mrdDownload = index.createEvent(this, "mrdDownload");
|
|
1939
|
+
this.mrdLoadPreview = index.createEvent(this, "mrdLoadPreview");
|
|
1881
1940
|
/** The data record from the /data endpoint. Fields keyed by name; relations under `_links`. */
|
|
1882
1941
|
this.data = {};
|
|
1883
1942
|
this.locale = navigator.language;
|
|
1943
|
+
/** Signed URL for the file's inline preview (mrd-file-preview), resolved by
|
|
1944
|
+
* the host in response to mrdLoadPreview. Empty while unresolved — the
|
|
1945
|
+
* preview area shows a loading state until the host injects a value. */
|
|
1946
|
+
this.previewUrl = '';
|
|
1947
|
+
/** Minimum height (px) of the inline preview area — it stretches to fill the
|
|
1948
|
+
* available row height in the wide side-by-side layout (see mrd-document-view.scss),
|
|
1949
|
+
* and falls back to this height when stacked. Overlay hosts typically pass a
|
|
1950
|
+
* smaller value than the full-page default to fit available chrome. */
|
|
1951
|
+
this.previewHeight = 640;
|
|
1952
|
+
/** Tracks the href a preview was last requested for, so componentDidLoad and
|
|
1953
|
+
* the data watcher don't emit duplicate requests for the same file. */
|
|
1954
|
+
this.lastPreviewHref = null;
|
|
1955
|
+
}
|
|
1956
|
+
componentDidLoad() {
|
|
1957
|
+
this.requestPreviewIfNeeded();
|
|
1958
|
+
}
|
|
1959
|
+
dataChanged() {
|
|
1960
|
+
this.requestPreviewIfNeeded();
|
|
1961
|
+
}
|
|
1962
|
+
requestPreviewIfNeeded() {
|
|
1963
|
+
var _a, _b;
|
|
1964
|
+
const href = (_b = (_a = this.slotValue('file')) === null || _a === void 0 ? void 0 : _a.href) !== null && _b !== void 0 ? _b : null;
|
|
1965
|
+
if (href && href !== this.lastPreviewHref) {
|
|
1966
|
+
this.lastPreviewHref = href;
|
|
1967
|
+
this.mrdLoadPreview.emit({ href });
|
|
1968
|
+
}
|
|
1884
1969
|
}
|
|
1885
1970
|
/** Value of a value-slot: reads data[field] via the slot→field map. */
|
|
1886
1971
|
slotValue(slot) {
|
|
@@ -1905,24 +1990,43 @@ const MrdDocumentView = class {
|
|
|
1905
1990
|
return null;
|
|
1906
1991
|
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
1992
|
}
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1993
|
+
/** Filename + download button — part of the metadata column, not the preview
|
|
1994
|
+
* panel, so it stays next to the title/summary in the wide side-by-side layout. */
|
|
1995
|
+
renderFileMeta(fileName, href) {
|
|
1996
|
+
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)))));
|
|
1997
|
+
}
|
|
1998
|
+
/** The preview panel itself (iframe/image/loading state) — its own grid
|
|
1999
|
+
* column in the wide layout, so it can take the full available height. */
|
|
2000
|
+
renderPreviewPanel(fileName, href, mimeType) {
|
|
2001
|
+
if (!href)
|
|
1912
2002
|
return null;
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
2003
|
+
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) => {
|
|
2004
|
+
e.stopPropagation();
|
|
2005
|
+
this.mrdDownload.emit(e.detail);
|
|
2006
|
+
}, onMrdPreviewReload: (e) => {
|
|
2007
|
+
e.stopPropagation();
|
|
2008
|
+
this.mrdLoadPreview.emit({ href });
|
|
2009
|
+
} })) : (index.h("div", { class: "mrd-document-view__preview-loading" }, t('loading', this.locale)))));
|
|
1916
2010
|
}
|
|
1917
2011
|
render() {
|
|
2012
|
+
var _a, _b, _c, _d;
|
|
1918
2013
|
const titleRaw = this.slotValue('title');
|
|
1919
2014
|
const title = titleRaw != null && titleRaw !== '' ? String(titleRaw) : null;
|
|
1920
2015
|
const dateRaw = this.slotValue('date');
|
|
1921
2016
|
const date = dateRaw != null && dateRaw !== '' ? formatDate(dateRaw, this.locale) : null;
|
|
1922
2017
|
const summaryRaw = this.slotValue('summary');
|
|
1923
2018
|
const summary = summaryRaw != null && summaryRaw !== '' ? String(summaryRaw) : null;
|
|
1924
|
-
|
|
2019
|
+
const fileRaw = this.slotValue('file');
|
|
2020
|
+
const fileHref = (_a = fileRaw === null || fileRaw === void 0 ? void 0 : fileRaw.href) !== null && _a !== void 0 ? _a : '';
|
|
2021
|
+
const fileName = (_b = fileRaw === null || fileRaw === void 0 ? void 0 : fileRaw.fileName) !== null && _b !== void 0 ? _b : (fileRaw ? String(fileRaw) : '');
|
|
2022
|
+
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 : '';
|
|
2023
|
+
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
2024
|
}
|
|
2025
|
+
static get watchers() { return {
|
|
2026
|
+
"data": [{
|
|
2027
|
+
"dataChanged": 0
|
|
2028
|
+
}]
|
|
2029
|
+
}; }
|
|
1926
2030
|
};
|
|
1927
2031
|
MrdDocumentView.style = mrdDocumentViewCss();
|
|
1928
2032
|
|
|
@@ -1953,7 +2057,7 @@ const MrdEmailField = class {
|
|
|
1953
2057
|
};
|
|
1954
2058
|
}
|
|
1955
2059
|
render() {
|
|
1956
|
-
return (index.h(index.Host, { key: '
|
|
2060
|
+
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
2061
|
}
|
|
1958
2062
|
};
|
|
1959
2063
|
MrdEmailField.style = mrdEmailFieldCss();
|
|
@@ -2261,7 +2365,7 @@ const MrdFileField = class {
|
|
|
2261
2365
|
error: hasError,
|
|
2262
2366
|
disabled: this.disabled || this.uploading,
|
|
2263
2367
|
});
|
|
2264
|
-
return (index.h(index.Host, { key: '
|
|
2368
|
+
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
2369
|
}
|
|
2266
2370
|
static get watchers() { return {
|
|
2267
2371
|
"value": [{
|
|
@@ -2271,6 +2375,90 @@ const MrdFileField = class {
|
|
|
2271
2375
|
};
|
|
2272
2376
|
MrdFileField.style = mrdFileFieldCss();
|
|
2273
2377
|
|
|
2378
|
+
/** Pure classification logic for mrd-file-preview — no Stencil dependency. */
|
|
2379
|
+
const IMAGE_EXTENSIONS = new Set(['png', 'jpg', 'jpeg', 'gif', 'webp', 'svg', 'bmp']);
|
|
2380
|
+
function extensionOf(fileName) {
|
|
2381
|
+
if (!fileName)
|
|
2382
|
+
return null;
|
|
2383
|
+
const match = /\.([a-z0-9]+)$/i.exec(fileName);
|
|
2384
|
+
return match ? match[1].toLowerCase() : null;
|
|
2385
|
+
}
|
|
2386
|
+
/**
|
|
2387
|
+
* Decide how to render a file given its declared mime type and/or file name.
|
|
2388
|
+
* A declared mime type is authoritative when present (a mismatched file name
|
|
2389
|
+
* extension is ignored); the file name extension is only consulted as a
|
|
2390
|
+
* fallback when no mime type is known.
|
|
2391
|
+
*/
|
|
2392
|
+
function detectPreviewKind(mimeType, fileName) {
|
|
2393
|
+
const mime = (mimeType !== null && mimeType !== void 0 ? mimeType : '').toLowerCase().trim();
|
|
2394
|
+
if (mime) {
|
|
2395
|
+
if (mime === 'application/pdf')
|
|
2396
|
+
return 'pdf';
|
|
2397
|
+
if (mime.startsWith('image/'))
|
|
2398
|
+
return 'image';
|
|
2399
|
+
return 'unsupported';
|
|
2400
|
+
}
|
|
2401
|
+
const ext = extensionOf(fileName);
|
|
2402
|
+
if (ext === 'pdf')
|
|
2403
|
+
return 'pdf';
|
|
2404
|
+
if (ext && IMAGE_EXTENSIONS.has(ext))
|
|
2405
|
+
return 'image';
|
|
2406
|
+
return 'unsupported';
|
|
2407
|
+
}
|
|
2408
|
+
|
|
2409
|
+
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}`;
|
|
2410
|
+
|
|
2411
|
+
const MrdFilePreview = class {
|
|
2412
|
+
constructor(hostRef) {
|
|
2413
|
+
index.registerInstance(this, hostRef);
|
|
2414
|
+
this.mrdPreviewReload = index.createEvent(this, "mrdPreviewReload");
|
|
2415
|
+
this.mrdDownload = index.createEvent(this, "mrdDownload");
|
|
2416
|
+
/** Signed URL to render. */
|
|
2417
|
+
this.src = '';
|
|
2418
|
+
/** Declared mime type (e.g. 'application/pdf', 'image/png'), when known.
|
|
2419
|
+
* Authoritative over `fileName` when present. */
|
|
2420
|
+
this.mimeType = '';
|
|
2421
|
+
/** Original file name — used for extension-based detection when `mimeType`
|
|
2422
|
+
* is absent, and as alt/title text. */
|
|
2423
|
+
this.fileName = '';
|
|
2424
|
+
/** The file's own reference href (not the signed preview URL in `src`).
|
|
2425
|
+
* When set, an unsupported type falls back to the same download button
|
|
2426
|
+
* used elsewhere in the library, so hosts need no new wiring. */
|
|
2427
|
+
this.href = '';
|
|
2428
|
+
this.locale = navigator.language;
|
|
2429
|
+
this.imageFailed = false;
|
|
2430
|
+
this.onImageError = () => {
|
|
2431
|
+
this.imageFailed = true;
|
|
2432
|
+
};
|
|
2433
|
+
this.retry = () => {
|
|
2434
|
+
this.imageFailed = false;
|
|
2435
|
+
this.mrdPreviewReload.emit();
|
|
2436
|
+
};
|
|
2437
|
+
}
|
|
2438
|
+
srcChanged() {
|
|
2439
|
+
this.imageFailed = false;
|
|
2440
|
+
}
|
|
2441
|
+
render() {
|
|
2442
|
+
const kind = detectPreviewKind(this.mimeType, this.fileName);
|
|
2443
|
+
if (kind === 'pdf') {
|
|
2444
|
+
return (index.h(index.Host, null, index.h("iframe", { class: "mrd-file-preview__frame", src: this.src, title: this.fileName || 'preview' })));
|
|
2445
|
+
}
|
|
2446
|
+
if (kind === 'image') {
|
|
2447
|
+
if (this.imageFailed) {
|
|
2448
|
+
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)))));
|
|
2449
|
+
}
|
|
2450
|
+
return (index.h(index.Host, null, index.h("img", { class: "mrd-file-preview__image", src: this.src, alt: this.fileName || '', onError: this.onImageError })));
|
|
2451
|
+
}
|
|
2452
|
+
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))))));
|
|
2453
|
+
}
|
|
2454
|
+
static get watchers() { return {
|
|
2455
|
+
"src": [{
|
|
2456
|
+
"srcChanged": 0
|
|
2457
|
+
}]
|
|
2458
|
+
}; }
|
|
2459
|
+
};
|
|
2460
|
+
MrdFilePreview.style = mrdFilePreviewCss();
|
|
2461
|
+
|
|
2274
2462
|
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
2463
|
|
|
2276
2464
|
const MrdForm = class {
|
|
@@ -2798,7 +2986,7 @@ const MrdImageField = class {
|
|
|
2798
2986
|
error: hasError,
|
|
2799
2987
|
disabled: this.disabled || this.uploading,
|
|
2800
2988
|
});
|
|
2801
|
-
return (index.h(index.Host, { key: '
|
|
2989
|
+
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
2990
|
}
|
|
2803
2991
|
static get watchers() { return {
|
|
2804
2992
|
"value": [{
|
|
@@ -3048,7 +3236,7 @@ function renderField(ctx, item) {
|
|
|
3048
3236
|
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
3237
|
}
|
|
3050
3238
|
|
|
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}`;
|
|
3239
|
+
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
3240
|
|
|
3053
3241
|
const MrdLayoutSection = class {
|
|
3054
3242
|
constructor(hostRef) {
|
|
@@ -3058,6 +3246,7 @@ const MrdLayoutSection = class {
|
|
|
3058
3246
|
this.mrdDownload = index.createEvent(this, "mrdDownload");
|
|
3059
3247
|
this.mrdLoadViewPage = index.createEvent(this, "mrdLoadViewPage");
|
|
3060
3248
|
this.mrdLoadImage = index.createEvent(this, "mrdLoadImage");
|
|
3249
|
+
this.mrdLoadDocumentPreview = index.createEvent(this, "mrdLoadDocumentPreview");
|
|
3061
3250
|
this.mrdViewAction = index.createEvent(this, "mrdViewAction");
|
|
3062
3251
|
this.mrdLoadViewAggregations = index.createEvent(this, "mrdLoadViewAggregations");
|
|
3063
3252
|
this.mrdLoadViewDistinct = index.createEvent(this, "mrdLoadViewDistinct");
|
|
@@ -3076,11 +3265,17 @@ const MrdLayoutSection = class {
|
|
|
3076
3265
|
/** Top-level archetypes on the object dashboard. When it contains commons.document,
|
|
3077
3266
|
* the record is rendered as a single-document view instead of generic fields. */
|
|
3078
3267
|
this.archetypes = [];
|
|
3268
|
+
/** Minimum height (px) of the commons.document inline file preview — it
|
|
3269
|
+
* stretches taller in the wide side-by-side layout. Pass a smaller value
|
|
3270
|
+
* when embedding the record in an overlay with limited height. */
|
|
3271
|
+
this.documentPreviewHeight = 640;
|
|
3079
3272
|
this.searchQueryMap = {};
|
|
3080
3273
|
this.searchResultsMap = {};
|
|
3081
3274
|
this.imagePreviewUrl = null;
|
|
3082
3275
|
this.imagePreviews = {};
|
|
3083
3276
|
this.openHistoryField = null;
|
|
3277
|
+
/** Signed URL for the commons.document archetype's inline file preview. */
|
|
3278
|
+
this.documentPreviewUrl = null;
|
|
3084
3279
|
this.historyClickOutside = null;
|
|
3085
3280
|
this.searchTimers = {};
|
|
3086
3281
|
this.handleViewLoadPage = (e, name) => {
|
|
@@ -3204,6 +3399,11 @@ const MrdLayoutSection = class {
|
|
|
3204
3399
|
async openImagePreview(url) {
|
|
3205
3400
|
this.imagePreviewUrl = url;
|
|
3206
3401
|
}
|
|
3402
|
+
/** Provide a resolved signed URL for the commons.document archetype's inline
|
|
3403
|
+
* file preview, in response to mrdLoadDocumentPreview. */
|
|
3404
|
+
async setDocumentPreviewUrl(url) {
|
|
3405
|
+
this.documentPreviewUrl = url;
|
|
3406
|
+
}
|
|
3207
3407
|
resolveSearchKey() {
|
|
3208
3408
|
var _a;
|
|
3209
3409
|
const items = flattenItems(this.items).filter(i => i.type === index$1.ClientLayoutItemType.SEARCH);
|
|
@@ -3293,6 +3493,10 @@ const MrdLayoutSection = class {
|
|
|
3293
3493
|
e.stopPropagation();
|
|
3294
3494
|
this.mrdLoadViewAggregations.emit(Object.assign({ name: key, dataClass: (_a = item.dataClass) !== null && _a !== void 0 ? _a : key }, e.detail));
|
|
3295
3495
|
}, onMrdNavigate: (e) => {
|
|
3496
|
+
// mrd-document-container already hardcodes navigateBehaviour to
|
|
3497
|
+
// OVERLAY_PAGE (documents are always the quick-look use case) —
|
|
3498
|
+
// relay as-is, unlike the generic table path below which takes it
|
|
3499
|
+
// from the item's configuration.
|
|
3296
3500
|
e.stopPropagation();
|
|
3297
3501
|
this.mrdNavigate.emit(e.detail);
|
|
3298
3502
|
}, onMrdAction: (e) => {
|
|
@@ -3316,10 +3520,15 @@ const MrdLayoutSection = class {
|
|
|
3316
3520
|
e.stopPropagation();
|
|
3317
3521
|
this.mrdLoadViewAggregations.emit(Object.assign({ name: key, dataClass: (_a = item.dataClass) !== null && _a !== void 0 ? _a : key }, e.detail));
|
|
3318
3522
|
}, onMrdRowClick: (e) => {
|
|
3319
|
-
var _a, _b, _c;
|
|
3523
|
+
var _a, _b, _c, _d;
|
|
3320
3524
|
e.stopPropagation();
|
|
3321
|
-
const row = e.detail;
|
|
3322
|
-
this.mrdNavigate.emit({
|
|
3525
|
+
const { row, listContext } = e.detail;
|
|
3526
|
+
this.mrdNavigate.emit({
|
|
3527
|
+
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,
|
|
3528
|
+
label: (_c = row === null || row === void 0 ? void 0 : row.name) !== null && _c !== void 0 ? _c : '',
|
|
3529
|
+
navigateBehaviour: (_d = item.navigateBehaviour) !== null && _d !== void 0 ? _d : index$1.ClientLayoutNavigateBehaviour.PAGE,
|
|
3530
|
+
listContext,
|
|
3531
|
+
});
|
|
3323
3532
|
}, onMrdAction: (e) => {
|
|
3324
3533
|
var _a;
|
|
3325
3534
|
e.stopPropagation();
|
|
@@ -3368,17 +3577,18 @@ const MrdLayoutSection = class {
|
|
|
3368
3577
|
* a recognisable document instead of generic fields, keeping any related views/
|
|
3369
3578
|
* searches below it. */
|
|
3370
3579
|
renderDocumentObject(archetype) {
|
|
3580
|
+
var _a;
|
|
3371
3581
|
const related = this.items.filter(it => it.type === index$1.ClientLayoutItemType.VIEW ||
|
|
3372
3582
|
it.type === index$1.ClientLayoutItemType.RELATED_VIEW ||
|
|
3373
3583
|
it.type === index$1.ClientLayoutItemType.SEARCH);
|
|
3374
3584
|
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); } }),
|
|
3585
|
+
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
3586
|
...related.map(it => this.renderItem(it)),
|
|
3377
3587
|
];
|
|
3378
3588
|
}
|
|
3379
3589
|
render() {
|
|
3380
3590
|
const docArchetype = index$1.resolveArchetype(this.archetypes, index$1.ARCHETYPE_DOCUMENT);
|
|
3381
|
-
return (index.h(index.Host, { key: '
|
|
3591
|
+
return (index.h(index.Host, { key: '9b79e194ab3fc37bd9e97e69d06df37a5f26dfab' }, index.h("div", { key: '15db5e082ccfbe4b0b5b75e11a4eaac117c5d577', class: "mrd-layout-section" }, docArchetype
|
|
3382
3592
|
? this.renderDocumentObject(docArchetype)
|
|
3383
3593
|
: this.items.map(item => this.renderItem(item))), this.renderImageModal()));
|
|
3384
3594
|
}
|
|
@@ -3499,7 +3709,7 @@ const MrdLongtextField = class {
|
|
|
3499
3709
|
};
|
|
3500
3710
|
}
|
|
3501
3711
|
render() {
|
|
3502
|
-
return (index.h(index.Host, { key: '
|
|
3712
|
+
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
3713
|
}
|
|
3504
3714
|
};
|
|
3505
3715
|
MrdLongtextField.style = mrdLongtextFieldCss();
|
|
@@ -3575,7 +3785,7 @@ const MrdNumberField = class {
|
|
|
3575
3785
|
const hasError = !!this.error;
|
|
3576
3786
|
const suffix = this.dataType === index$1.ClientLayoutItemFieldDataType.PERCENTAGE ? '%' :
|
|
3577
3787
|
this.dataType === index$1.ClientLayoutItemFieldDataType.DECIMAL ? '' : '';
|
|
3578
|
-
return (index.h(index.Host, { key: '
|
|
3788
|
+
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
3789
|
}
|
|
3580
3790
|
};
|
|
3581
3791
|
MrdNumberField.style = mrdNumberFieldCss();
|
|
@@ -3853,9 +4063,9 @@ const MrdSecretField = class {
|
|
|
3853
4063
|
};
|
|
3854
4064
|
}
|
|
3855
4065
|
render() {
|
|
3856
|
-
return (index.h(index.Host, { key: '
|
|
4066
|
+
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
4067
|
? (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: '
|
|
4068
|
+
: (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
4069
|
}
|
|
3860
4070
|
};
|
|
3861
4071
|
MrdSecretField.style = mrdSecretFieldCss();
|
|
@@ -5089,7 +5299,7 @@ const MrdTable = class {
|
|
|
5089
5299
|
this.filterMode ? 'mrd-table__header--sortable' : '',
|
|
5090
5300
|
].filter(Boolean).join(' ');
|
|
5091
5301
|
return (index.h("th", { class: cls, onClick: this.filterMode ? (e) => this.handleFilterOpen(col, e) : undefined }, index.h("span", { class: "mrd-table__header-label" }, (_a = col.label) !== null && _a !== void 0 ? _a : ''), isFiltered && index.h(FilterIcon, null)));
|
|
5092
|
-
}))), index.h("tbody", null, (_b = this.rows) === null || _b === void 0 ? void 0 : _b.map((row, i) => (index.h("tr", { class: "mrd-table__row mrd-table__row--clickable", style: { background: i % 2 === 0 ? '' : 'var(--mrd-color-neutral-100)' }, onClick: () => this.mrdRowClick.emit(row) }, this.columns.map(col => this.renderCell(col, row)))))), this.renderTotalsRow()), (!this.rows || this.rows.length === 0) && (index.h("p", { class: "mrd-table__empty" }, t('no_results', this.locale)))), this.renderFooter((_c = this.rows) === null || _c === void 0 ? void 0 : _c.length), this.renderFilterPopup(), this.renderTextblockModal(), this.renderJsonModal()));
|
|
5302
|
+
}))), index.h("tbody", null, (_b = this.rows) === null || _b === void 0 ? void 0 : _b.map((row, i) => (index.h("tr", { class: "mrd-table__row mrd-table__row--clickable", style: { background: i % 2 === 0 ? '' : 'var(--mrd-color-neutral-100)' }, onClick: () => this.mrdRowClick.emit({ row }) }, this.columns.map(col => this.renderCell(col, row)))))), this.renderTotalsRow()), (!this.rows || this.rows.length === 0) && (index.h("p", { class: "mrd-table__empty" }, t('no_results', this.locale)))), this.renderFooter((_c = this.rows) === null || _c === void 0 ? void 0 : _c.length), this.renderFilterPopup(), this.renderTextblockModal(), this.renderJsonModal()));
|
|
5093
5303
|
}
|
|
5094
5304
|
// ── Paginated / virtual-scroll mode ────────────────────────────────────
|
|
5095
5305
|
// Derive the authoritative row count from loaded pages:
|
|
@@ -5118,7 +5328,15 @@ const MrdTable = class {
|
|
|
5118
5328
|
}
|
|
5119
5329
|
}
|
|
5120
5330
|
else {
|
|
5121
|
-
renderedRows.push(index.h("tr", { class: "mrd-table__row mrd-table__row--clickable", style: { background: i % 2 === 0 ? '' : 'var(--mrd-color-neutral-100)' }, onClick: () => this.mrdRowClick.emit(
|
|
5331
|
+
renderedRows.push(index.h("tr", { class: "mrd-table__row mrd-table__row--clickable", style: { background: i % 2 === 0 ? '' : 'var(--mrd-color-neutral-100)' }, onClick: () => this.mrdRowClick.emit({
|
|
5332
|
+
row,
|
|
5333
|
+
listContext: {
|
|
5334
|
+
index: i,
|
|
5335
|
+
sort: this.sortParam(),
|
|
5336
|
+
path: this.buildDataPath(),
|
|
5337
|
+
qs: this.buildQueryParams(0),
|
|
5338
|
+
},
|
|
5339
|
+
}) }, this.columns.map(col => this.renderCell(col, row))));
|
|
5122
5340
|
}
|
|
5123
5341
|
}
|
|
5124
5342
|
return (index.h(index.Host, null, this.renderToolbar(), index.h("div", { class: "mrd-table__scroll", style: { height: `${this.tableHeight}px` }, onScroll: this.handleScroll }, index.h("table", { class: "mrd-table__table", style: tableStyle }, index.h("thead", null, index.h("tr", null, this.columns.map((col, idx) => {
|
|
@@ -5180,7 +5398,7 @@ const MrdTextField = class {
|
|
|
5180
5398
|
};
|
|
5181
5399
|
}
|
|
5182
5400
|
render() {
|
|
5183
|
-
return (index.h(index.Host, { key: '
|
|
5401
|
+
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
5402
|
}
|
|
5185
5403
|
};
|
|
5186
5404
|
MrdTextField.style = mrdTextFieldCss();
|
|
@@ -5249,7 +5467,7 @@ const MrdTextareaField = class {
|
|
|
5249
5467
|
}
|
|
5250
5468
|
}
|
|
5251
5469
|
render() {
|
|
5252
|
-
return (index.h(index.Host, { key: '
|
|
5470
|
+
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
5471
|
}
|
|
5254
5472
|
get el() { return index.getElement(this); }
|
|
5255
5473
|
};
|
|
@@ -5280,7 +5498,7 @@ const MrdTimeField = class {
|
|
|
5280
5498
|
};
|
|
5281
5499
|
}
|
|
5282
5500
|
render() {
|
|
5283
|
-
return (index.h(index.Host, { key: '
|
|
5501
|
+
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
5502
|
}
|
|
5285
5503
|
};
|
|
5286
5504
|
MrdTimeField.style = mrdTimeFieldCss();
|
|
@@ -5295,6 +5513,7 @@ exports.mrd_document_view = MrdDocumentView;
|
|
|
5295
5513
|
exports.mrd_email_field = MrdEmailField;
|
|
5296
5514
|
exports.mrd_field = MrdField;
|
|
5297
5515
|
exports.mrd_file_field = MrdFileField;
|
|
5516
|
+
exports.mrd_file_preview = MrdFilePreview;
|
|
5298
5517
|
exports.mrd_form = MrdForm;
|
|
5299
5518
|
exports.mrd_hyperlink_field = MrdHyperlinkField;
|
|
5300
5519
|
exports.mrd_image_field = MrdImageField;
|