@mmlogic/components 0.5.12 → 0.5.13
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/{cell-renderer-pwUGEDql.js → cell-renderer-BBebjBVz.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_25.cjs.entry.js +67 -20
- package/dist/cjs/mrd-merge-view.cjs.entry.js +1 -1
- package/dist/collection/components/documents/mrd-document-container/mrd-document-container.js +30 -4
- package/dist/collection/components/documents/mrd-document-list/mrd-document-list.js +55 -6
- package/dist/collection/components/layout/mrd-layout-section/mrd-layout-section.js +27 -3
- package/dist/collection/components/table/mrd-table/mrd-table.js +26 -2
- package/dist/collection/components/table/mrd-table/table-parts.js +9 -5
- package/dist/collection/dev/app.js +24 -0
- package/dist/collection/utils/i18n.js +8 -0
- package/dist/components/i18n.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-layout-section.js +1 -1
- package/dist/components/mrd-table2.js +1 -1
- package/dist/esm/{cell-renderer-B8rJpnq8.js → cell-renderer-CC8-MtvQ.js} +8 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/mosterdcomponents.js +1 -1
- package/dist/esm/mrd-boolean-field_25.entry.js +67 -20
- package/dist/esm/mrd-merge-view.entry.js +1 -1
- package/dist/mosterdcomponents/mosterdcomponents.esm.js +1 -1
- package/dist/mosterdcomponents/p-07b148b2.entry.js +3 -0
- package/dist/mosterdcomponents/p-D5ZPfX3-.js +1 -0
- package/dist/mosterdcomponents/{p-e540de6a.entry.js → p-a7e8f6a3.entry.js} +1 -1
- package/dist/types/components/documents/mrd-document-container/mrd-document-container.d.ts +4 -0
- package/dist/types/components/documents/mrd-document-list/mrd-document-list.d.ts +6 -1
- package/dist/types/components/layout/mrd-layout-section/mrd-layout-section.d.ts +4 -0
- package/dist/types/components/table/mrd-table/mrd-table.d.ts +4 -0
- package/dist/types/components/table/mrd-table/table-parts.d.ts +3 -0
- package/dist/types/components.d.ts +45 -1
- package/package.json +1 -1
- package/dist/mosterdcomponents/p-eb322d5c.entry.js +0 -3
- package/dist/mosterdcomponents/p-rTM1tU_M.js +0 -1
|
@@ -110,6 +110,7 @@ const translations = {
|
|
|
110
110
|
table_filter_clear_all: 'Alle filters wissen',
|
|
111
111
|
table_new_record: 'Nieuw record',
|
|
112
112
|
table_export_excel: 'Exporteer naar Excel',
|
|
113
|
+
readonly_access: 'Je hebt alleen-leestoegang',
|
|
113
114
|
doc_view_switch: 'Weergave wisselen',
|
|
114
115
|
doc_view_tree: 'Boomweergave',
|
|
115
116
|
doc_upload: 'Uploaden',
|
|
@@ -213,6 +214,7 @@ const translations = {
|
|
|
213
214
|
table_filter_clear_all: 'Clear all filters',
|
|
214
215
|
table_new_record: 'New record',
|
|
215
216
|
table_export_excel: 'Export to Excel',
|
|
217
|
+
readonly_access: 'You have read-only access',
|
|
216
218
|
doc_view_switch: 'Switch view',
|
|
217
219
|
doc_view_tree: 'Tree view',
|
|
218
220
|
doc_upload: 'Upload',
|
|
@@ -316,6 +318,7 @@ const translations = {
|
|
|
316
318
|
table_filter_clear_all: 'مسح جميع الفلاتر',
|
|
317
319
|
table_new_record: 'سجل جديد',
|
|
318
320
|
table_export_excel: 'تصدير إلى Excel',
|
|
321
|
+
readonly_access: 'لديك حق الوصول للقراءة فقط',
|
|
319
322
|
doc_view_switch: 'تبديل العرض',
|
|
320
323
|
doc_view_tree: 'عرض شجري',
|
|
321
324
|
doc_upload: 'رفع',
|
|
@@ -413,6 +416,7 @@ const translations = {
|
|
|
413
416
|
table_filter_clear_all: 'Effacer tous les filtres',
|
|
414
417
|
table_new_record: 'Nouvel enregistrement',
|
|
415
418
|
table_export_excel: 'Exporter vers Excel',
|
|
419
|
+
readonly_access: "Vous disposez d'un accès en lecture seule",
|
|
416
420
|
doc_view_switch: 'Changer de vue',
|
|
417
421
|
doc_view_tree: 'Vue arborescente',
|
|
418
422
|
doc_upload: 'Téléverser',
|
|
@@ -510,6 +514,7 @@ const translations = {
|
|
|
510
514
|
table_filter_clear_all: 'Alle Filter löschen',
|
|
511
515
|
table_new_record: 'Neuer Eintrag',
|
|
512
516
|
table_export_excel: 'Als Excel exportieren',
|
|
517
|
+
readonly_access: 'Sie haben nur Lesezugriff',
|
|
513
518
|
doc_view_switch: 'Ansicht wechseln',
|
|
514
519
|
doc_view_tree: 'Baumansicht',
|
|
515
520
|
doc_upload: 'Hochladen',
|
|
@@ -607,6 +612,7 @@ const translations = {
|
|
|
607
612
|
table_filter_clear_all: 'Borrar todos los filtros',
|
|
608
613
|
table_new_record: 'Nuevo registro',
|
|
609
614
|
table_export_excel: 'Exportar a Excel',
|
|
615
|
+
readonly_access: 'Tienes acceso de solo lectura',
|
|
610
616
|
doc_view_switch: 'Cambiar vista',
|
|
611
617
|
doc_view_tree: 'Vista de árbol',
|
|
612
618
|
doc_upload: 'Subir',
|
|
@@ -704,6 +710,7 @@ const translations = {
|
|
|
704
710
|
table_filter_clear_all: 'Cancella tutti i filtri',
|
|
705
711
|
table_new_record: 'Nuovo record',
|
|
706
712
|
table_export_excel: 'Esporta in Excel',
|
|
713
|
+
readonly_access: 'Hai accesso in sola lettura',
|
|
707
714
|
doc_view_switch: 'Cambia vista',
|
|
708
715
|
doc_view_tree: 'Vista ad albero',
|
|
709
716
|
doc_upload: 'Carica',
|
|
@@ -801,6 +808,7 @@ const translations = {
|
|
|
801
808
|
table_filter_clear_all: 'Очистити всі фільтри',
|
|
802
809
|
table_new_record: 'Новий запис',
|
|
803
810
|
table_export_excel: 'Експортувати до Excel',
|
|
811
|
+
readonly_access: 'У вас доступ лише для перегляду',
|
|
804
812
|
doc_view_switch: 'Змінити вигляд',
|
|
805
813
|
doc_view_tree: 'Деревоподібний вигляд',
|
|
806
814
|
doc_upload: 'Завантажити',
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -6,7 +6,7 @@ var appGlobals = require('./app-globals-V2Kpy_OQ.js');
|
|
|
6
6
|
const defineCustomElements = async (win, options) => {
|
|
7
7
|
if (typeof window === 'undefined') return undefined;
|
|
8
8
|
await appGlobals.globalScripts();
|
|
9
|
-
return index.bootstrapLazy([["mrd-merge-view.cjs",[[2,"mrd-merge-view",{"locale":[1],"basicType":[1,"basic-type"],"mostSignificantClass":[1,"most-significant-class"],"fields":[16],"currentHref":[1,"current-href"],"currentRecord":[16],"currentLabel":[1,"current-label"],"step":[32],"searchQuery":[32],"searchResults":[32],"isLoading":[32],"candidate":[32],"resolutions":[32],"openHistoryKey":[32],"setSearchResults":[64],"setLoading":[64]}]]],["mrd-boolean-field_25.cjs",[[2,"mrd-form",{"layout":[16],"locale":[1],"values":[16],"referenceHref":[1,"reference-href"],"referenceClass":[1,"reference-class"],"showCancel":[4,"show-cancel"],"me":[16],"formValues":[32],"errors":[32],"submitted":[32],"setFieldValue":[64]},null,{"values":[{"valuesChanged":0}],"me":[{"meChanged":0}]}],[2,"mrd-layout-section",{"items":[16],"data":[16],"views":[16],"links":[16],"locale":[1],"archetypes":[16],"searchQueryMap":[32],"searchResultsMap":[32],"imagePreviewUrl":[32],"imagePreviews":[32],"openHistoryField":[32],"setSearchResults":[64],"setViewPage":[64],"setViewAggregations":[64],"setViewDistinct":[64],"setViewFileReference":[64],"setViewCreatedObject":[64],"setImagePreview":[64],"openImagePreview":[64]},null,{"data":[{"dataChanged":0}]}],[2,"mrd-field",{"item":[16],"locale":[1],"value":[16],"historyEntries":[32],"currentValue":[32]},null,{"value":[{"valueChanged":0}]}],[2,"mrd-document-container",{"item":[16],"archetype":[16],"parentId":[1,"parent-id"],"containerHref":[1,"container-href"],"viewKey":[1,"view-key"],"height":[2],"locale":[1],"mode":[32],"canCreate":[32],"targetLabel":[32]}],[2,"mrd-document-view",{"archetype":[16],"data":[16],"locale":[1]},null,{"data":[{"dataChanged":0}]}],[2,"mrd-email-view",{"archetype":[16],"data":[16],"locale":[1]},null,{"data":[{"dataChanged":0}]}],[262,"mrd-invoice-view",{"archetype":[16],"data":[16],"locale":[1],"statusListItems":[16]},null,{"data":[{"dataChanged":0}]}],[2,"mrd-boolean-field",{"name":[1],"label":[1],"value":[4],"required":[4],"disabled":[4],"locale":[1],"checked":[32]}],[2,"mrd-currency-field",{"name":[1],"label":[1],"value":[16],"required":[4],"disabled":[4],"locale":[1],"amountDisplay":[32],"currency":[32],"error":[32]},null,{"value":[{"valueChanged":0}],"locale":[{"localeChanged":0}]}],[2,"mrd-date-field",{"name":[1],"label":[1],"value":[1],"required":[4],"disabled":[4],"locale":[1],"error":[32]}],[2,"mrd-datetime-field",{"name":[1],"label":[1],"value":[1],"required":[4],"disabled":[4],"locale":[1],"error":[32],"localValue":[32]},null,{"value":[{"valueChanged":0}]}],[2,"mrd-document-list",{"item":[16],"archetype":[16],"parentId":[1,"parent-id"],"containerHref":[1,"container-href"],"locale":[1],"containers":[32],"rootLoading":[32],"singleContainer":[32],"selectedId":[32],"dropTargetId":[32],"uploadingNodeId":[32],"rootDropActive":[32],"setDistinct":[64],"setDocuments":[64],"createFolder":[64],"uploadFile":[64],"setFileReference":[64],"setCreatedHref":[64]}],[2,"mrd-email-field",{"name":[1],"label":[1],"value":[1],"placeholder":[1],"required":[4],"disabled":[4],"locale":[1],"error":[32]}],[2,"mrd-file-field",{"name":[1],"label":[1],"value":[16],"required":[4],"disabled":[4],"locale":[1],"accept":[1],"maxSize":[2,"max-size"],"multiple":[4],"entries":[32],"isDragging":[32],"error":[32]},null,{"value":[{"valueChanged":0}]}],[2,"mrd-hyperlink-field",{"name":[1],"label":[1],"value":[1],"placeholder":[1],"required":[4],"disabled":[4],"locale":[1],"internalHref":[32],"internalName":[32],"error":[32]},null,{"value":[{"valueChanged":0}]}],[2,"mrd-image-field",{"name":[1],"label":[1],"value":[16],"required":[4],"disabled":[4],"locale":[1],"accept":[1],"maxSize":[2,"max-size"],"multiple":[4],"entries":[32],"isDragging":[32],"error":[32]},null,{"value":[{"valueChanged":0}]}],[2,"mrd-list-field",{"name":[1],"label":[1],"value":[1],"required":[4],"disabled":[4],"multiple":[4],"locale":[1],"listItems":[16],"error":[32],"selected":[32]}],[2,"mrd-longtext-field",{"name":[1],"label":[1],"value":[1],"placeholder":[1],"required":[4],"disabled":[4],"locale":[1],"error":[32]}],[2,"mrd-number-field",{"name":[1],"label":[1],"value":[2],"placeholder":[1],"required":[4],"disabled":[4],"locale":[1],"dataType":[1,"data-type"],"decimalPrecision":[2,"decimal-precision"],"displayValue":[32],"error":[32]},null,{"value":[{"valueChanged":0}],"locale":[{"localeChanged":0}]}],[2,"mrd-relation-field",{"name":[1],"label":[1],"required":[4],"disabled":[4],"locale":[1],"relatedClass":[1,"related-class"],"mostSignificantClass":[1,"most-significant-class"],"displayType":[1,"display-type"],"editBehavior":[1,"edit-behavior"],"commonRelation":[1,"common-relation"],"multiple":[4],"dropdownValues":[16],"value":[1],"searchQuery":[32],"searchResults":[32],"allRecords":[32],"isLoading":[32],"selectedItems":[32],"showResults":[32],"error":[32],"highlightedIndex":[32],"setAllRecords":[64],"setSearchResults":[64],"setLoading":[64]},null,{"allRecords":[{"allRecordsChanged":0}],"value":[{"valueChanged":0}]}],[2,"mrd-secret-field",{"name":[1],"label":[1],"value":[1],"placeholder":[1],"required":[4],"disabled":[4],"locale":[1],"error":[32]}],[2,"mrd-table",{"item":[16],"parentId":[1,"parent-id"],"rows":[16],"locale":[1],"totalElements":[2,"total-elements"],"pageSize":[2,"page-size"],"rowHeight":[2,"row-height"],"tableHeight":[2,"table-height"],"requestTimeoutMs":[2,"request-timeout-ms"],"activeViewIdx":[32],"loadedPages":[32],"requestedPages":[32],"failedPages":[32],"renderStart":[32],"renderEnd":[32],"colWidths":[32],"resizingCol":[32],"sortField":[32],"sortDir":[32],"activeFilters":[32],"openFilterCol":[32],"pendingFilter":[32],"popupPos":[32],"createPickerOpen":[32],"viewPopoverOpen":[32],"scrollTop":[32],"textblockModal":[32],"jsonModal":[32],"aggregations":[32],"aggregationsTotal":[32],"minKnownTotal":[32],"init":[64],"setPage":[64],"setAggregations":[64]},null,{"totalElements":[{"totalElementsChanged":0}],"item":[{"itemChanged":0}]}],[2,"mrd-text-field",{"name":[1],"label":[1],"value":[1],"placeholder":[1],"required":[4],"disabled":[4],"locale":[1],"error":[32]}],[2,"mrd-textarea-field",{"name":[1],"label":[1],"value":[1],"placeholder":[1],"required":[4],"disabled":[4],"locale":[1],"error":[32],"editorReady":[32]}],[2,"mrd-time-field",{"name":[1],"label":[1],"value":[1],"required":[4],"disabled":[4],"locale":[1],"error":[32]}]]]], options);
|
|
9
|
+
return index.bootstrapLazy([["mrd-merge-view.cjs",[[2,"mrd-merge-view",{"locale":[1],"basicType":[1,"basic-type"],"mostSignificantClass":[1,"most-significant-class"],"fields":[16],"currentHref":[1,"current-href"],"currentRecord":[16],"currentLabel":[1,"current-label"],"step":[32],"searchQuery":[32],"searchResults":[32],"isLoading":[32],"candidate":[32],"resolutions":[32],"openHistoryKey":[32],"setSearchResults":[64],"setLoading":[64]}]]],["mrd-boolean-field_25.cjs",[[2,"mrd-form",{"layout":[16],"locale":[1],"values":[16],"referenceHref":[1,"reference-href"],"referenceClass":[1,"reference-class"],"showCancel":[4,"show-cancel"],"me":[16],"formValues":[32],"errors":[32],"submitted":[32],"setFieldValue":[64]},null,{"values":[{"valuesChanged":0}],"me":[{"meChanged":0}]}],[2,"mrd-layout-section",{"items":[16],"data":[16],"views":[16],"links":[16],"locale":[1],"archetypes":[16],"readOnly":[4,"read-only"],"searchQueryMap":[32],"searchResultsMap":[32],"imagePreviewUrl":[32],"imagePreviews":[32],"openHistoryField":[32],"setSearchResults":[64],"setViewPage":[64],"setViewAggregations":[64],"setViewDistinct":[64],"setViewFileReference":[64],"setViewCreatedObject":[64],"setImagePreview":[64],"openImagePreview":[64]},null,{"data":[{"dataChanged":0}]}],[2,"mrd-field",{"item":[16],"locale":[1],"value":[16],"historyEntries":[32],"currentValue":[32]},null,{"value":[{"valueChanged":0}]}],[2,"mrd-document-container",{"item":[16],"archetype":[16],"parentId":[1,"parent-id"],"containerHref":[1,"container-href"],"viewKey":[1,"view-key"],"height":[2],"locale":[1],"readOnly":[4,"read-only"],"mode":[32],"canCreate":[32],"targetLabel":[32]}],[2,"mrd-document-view",{"archetype":[16],"data":[16],"locale":[1]},null,{"data":[{"dataChanged":0}]}],[2,"mrd-email-view",{"archetype":[16],"data":[16],"locale":[1]},null,{"data":[{"dataChanged":0}]}],[262,"mrd-invoice-view",{"archetype":[16],"data":[16],"locale":[1],"statusListItems":[16]},null,{"data":[{"dataChanged":0}]}],[2,"mrd-boolean-field",{"name":[1],"label":[1],"value":[4],"required":[4],"disabled":[4],"locale":[1],"checked":[32]}],[2,"mrd-currency-field",{"name":[1],"label":[1],"value":[16],"required":[4],"disabled":[4],"locale":[1],"amountDisplay":[32],"currency":[32],"error":[32]},null,{"value":[{"valueChanged":0}],"locale":[{"localeChanged":0}]}],[2,"mrd-date-field",{"name":[1],"label":[1],"value":[1],"required":[4],"disabled":[4],"locale":[1],"error":[32]}],[2,"mrd-datetime-field",{"name":[1],"label":[1],"value":[1],"required":[4],"disabled":[4],"locale":[1],"error":[32],"localValue":[32]},null,{"value":[{"valueChanged":0}]}],[2,"mrd-document-list",{"item":[16],"archetype":[16],"parentId":[1,"parent-id"],"containerHref":[1,"container-href"],"locale":[1],"readOnly":[4,"read-only"],"containers":[32],"rootLoading":[32],"singleContainer":[32],"selectedId":[32],"dropTargetId":[32],"uploadingNodeId":[32],"rootDropActive":[32],"setDistinct":[64],"setDocuments":[64],"createFolder":[64],"uploadFile":[64],"setFileReference":[64],"setCreatedHref":[64]}],[2,"mrd-email-field",{"name":[1],"label":[1],"value":[1],"placeholder":[1],"required":[4],"disabled":[4],"locale":[1],"error":[32]}],[2,"mrd-file-field",{"name":[1],"label":[1],"value":[16],"required":[4],"disabled":[4],"locale":[1],"accept":[1],"maxSize":[2,"max-size"],"multiple":[4],"entries":[32],"isDragging":[32],"error":[32]},null,{"value":[{"valueChanged":0}]}],[2,"mrd-hyperlink-field",{"name":[1],"label":[1],"value":[1],"placeholder":[1],"required":[4],"disabled":[4],"locale":[1],"internalHref":[32],"internalName":[32],"error":[32]},null,{"value":[{"valueChanged":0}]}],[2,"mrd-image-field",{"name":[1],"label":[1],"value":[16],"required":[4],"disabled":[4],"locale":[1],"accept":[1],"maxSize":[2,"max-size"],"multiple":[4],"entries":[32],"isDragging":[32],"error":[32]},null,{"value":[{"valueChanged":0}]}],[2,"mrd-list-field",{"name":[1],"label":[1],"value":[1],"required":[4],"disabled":[4],"multiple":[4],"locale":[1],"listItems":[16],"error":[32],"selected":[32]}],[2,"mrd-longtext-field",{"name":[1],"label":[1],"value":[1],"placeholder":[1],"required":[4],"disabled":[4],"locale":[1],"error":[32]}],[2,"mrd-number-field",{"name":[1],"label":[1],"value":[2],"placeholder":[1],"required":[4],"disabled":[4],"locale":[1],"dataType":[1,"data-type"],"decimalPrecision":[2,"decimal-precision"],"displayValue":[32],"error":[32]},null,{"value":[{"valueChanged":0}],"locale":[{"localeChanged":0}]}],[2,"mrd-relation-field",{"name":[1],"label":[1],"required":[4],"disabled":[4],"locale":[1],"relatedClass":[1,"related-class"],"mostSignificantClass":[1,"most-significant-class"],"displayType":[1,"display-type"],"editBehavior":[1,"edit-behavior"],"commonRelation":[1,"common-relation"],"multiple":[4],"dropdownValues":[16],"value":[1],"searchQuery":[32],"searchResults":[32],"allRecords":[32],"isLoading":[32],"selectedItems":[32],"showResults":[32],"error":[32],"highlightedIndex":[32],"setAllRecords":[64],"setSearchResults":[64],"setLoading":[64]},null,{"allRecords":[{"allRecordsChanged":0}],"value":[{"valueChanged":0}]}],[2,"mrd-secret-field",{"name":[1],"label":[1],"value":[1],"placeholder":[1],"required":[4],"disabled":[4],"locale":[1],"error":[32]}],[2,"mrd-table",{"item":[16],"parentId":[1,"parent-id"],"rows":[16],"locale":[1],"totalElements":[2,"total-elements"],"pageSize":[2,"page-size"],"rowHeight":[2,"row-height"],"tableHeight":[2,"table-height"],"requestTimeoutMs":[2,"request-timeout-ms"],"readOnly":[4,"read-only"],"activeViewIdx":[32],"loadedPages":[32],"requestedPages":[32],"failedPages":[32],"renderStart":[32],"renderEnd":[32],"colWidths":[32],"resizingCol":[32],"sortField":[32],"sortDir":[32],"activeFilters":[32],"openFilterCol":[32],"pendingFilter":[32],"popupPos":[32],"createPickerOpen":[32],"viewPopoverOpen":[32],"scrollTop":[32],"textblockModal":[32],"jsonModal":[32],"aggregations":[32],"aggregationsTotal":[32],"minKnownTotal":[32],"init":[64],"setPage":[64],"setAggregations":[64]},null,{"totalElements":[{"totalElementsChanged":0}],"item":[{"itemChanged":0}]}],[2,"mrd-text-field",{"name":[1],"label":[1],"value":[1],"placeholder":[1],"required":[4],"disabled":[4],"locale":[1],"error":[32]}],[2,"mrd-textarea-field",{"name":[1],"label":[1],"value":[1],"placeholder":[1],"required":[4],"disabled":[4],"locale":[1],"error":[32],"editorReady":[32]}],[2,"mrd-time-field",{"name":[1],"label":[1],"value":[1],"required":[4],"disabled":[4],"locale":[1],"error":[32]}]]]], options);
|
|
10
10
|
};
|
|
11
11
|
|
|
12
12
|
exports.setNonce = index.setNonce;
|
|
@@ -19,7 +19,7 @@ var patchBrowser = () => {
|
|
|
19
19
|
|
|
20
20
|
patchBrowser().then(async (options) => {
|
|
21
21
|
await appGlobals.globalScripts();
|
|
22
|
-
return index.bootstrapLazy([["mrd-merge-view.cjs",[[2,"mrd-merge-view",{"locale":[1],"basicType":[1,"basic-type"],"mostSignificantClass":[1,"most-significant-class"],"fields":[16],"currentHref":[1,"current-href"],"currentRecord":[16],"currentLabel":[1,"current-label"],"step":[32],"searchQuery":[32],"searchResults":[32],"isLoading":[32],"candidate":[32],"resolutions":[32],"openHistoryKey":[32],"setSearchResults":[64],"setLoading":[64]}]]],["mrd-boolean-field_25.cjs",[[2,"mrd-form",{"layout":[16],"locale":[1],"values":[16],"referenceHref":[1,"reference-href"],"referenceClass":[1,"reference-class"],"showCancel":[4,"show-cancel"],"me":[16],"formValues":[32],"errors":[32],"submitted":[32],"setFieldValue":[64]},null,{"values":[{"valuesChanged":0}],"me":[{"meChanged":0}]}],[2,"mrd-layout-section",{"items":[16],"data":[16],"views":[16],"links":[16],"locale":[1],"archetypes":[16],"searchQueryMap":[32],"searchResultsMap":[32],"imagePreviewUrl":[32],"imagePreviews":[32],"openHistoryField":[32],"setSearchResults":[64],"setViewPage":[64],"setViewAggregations":[64],"setViewDistinct":[64],"setViewFileReference":[64],"setViewCreatedObject":[64],"setImagePreview":[64],"openImagePreview":[64]},null,{"data":[{"dataChanged":0}]}],[2,"mrd-field",{"item":[16],"locale":[1],"value":[16],"historyEntries":[32],"currentValue":[32]},null,{"value":[{"valueChanged":0}]}],[2,"mrd-document-container",{"item":[16],"archetype":[16],"parentId":[1,"parent-id"],"containerHref":[1,"container-href"],"viewKey":[1,"view-key"],"height":[2],"locale":[1],"mode":[32],"canCreate":[32],"targetLabel":[32]}],[2,"mrd-document-view",{"archetype":[16],"data":[16],"locale":[1]},null,{"data":[{"dataChanged":0}]}],[2,"mrd-email-view",{"archetype":[16],"data":[16],"locale":[1]},null,{"data":[{"dataChanged":0}]}],[262,"mrd-invoice-view",{"archetype":[16],"data":[16],"locale":[1],"statusListItems":[16]},null,{"data":[{"dataChanged":0}]}],[2,"mrd-boolean-field",{"name":[1],"label":[1],"value":[4],"required":[4],"disabled":[4],"locale":[1],"checked":[32]}],[2,"mrd-currency-field",{"name":[1],"label":[1],"value":[16],"required":[4],"disabled":[4],"locale":[1],"amountDisplay":[32],"currency":[32],"error":[32]},null,{"value":[{"valueChanged":0}],"locale":[{"localeChanged":0}]}],[2,"mrd-date-field",{"name":[1],"label":[1],"value":[1],"required":[4],"disabled":[4],"locale":[1],"error":[32]}],[2,"mrd-datetime-field",{"name":[1],"label":[1],"value":[1],"required":[4],"disabled":[4],"locale":[1],"error":[32],"localValue":[32]},null,{"value":[{"valueChanged":0}]}],[2,"mrd-document-list",{"item":[16],"archetype":[16],"parentId":[1,"parent-id"],"containerHref":[1,"container-href"],"locale":[1],"containers":[32],"rootLoading":[32],"singleContainer":[32],"selectedId":[32],"dropTargetId":[32],"uploadingNodeId":[32],"rootDropActive":[32],"setDistinct":[64],"setDocuments":[64],"createFolder":[64],"uploadFile":[64],"setFileReference":[64],"setCreatedHref":[64]}],[2,"mrd-email-field",{"name":[1],"label":[1],"value":[1],"placeholder":[1],"required":[4],"disabled":[4],"locale":[1],"error":[32]}],[2,"mrd-file-field",{"name":[1],"label":[1],"value":[16],"required":[4],"disabled":[4],"locale":[1],"accept":[1],"maxSize":[2,"max-size"],"multiple":[4],"entries":[32],"isDragging":[32],"error":[32]},null,{"value":[{"valueChanged":0}]}],[2,"mrd-hyperlink-field",{"name":[1],"label":[1],"value":[1],"placeholder":[1],"required":[4],"disabled":[4],"locale":[1],"internalHref":[32],"internalName":[32],"error":[32]},null,{"value":[{"valueChanged":0}]}],[2,"mrd-image-field",{"name":[1],"label":[1],"value":[16],"required":[4],"disabled":[4],"locale":[1],"accept":[1],"maxSize":[2,"max-size"],"multiple":[4],"entries":[32],"isDragging":[32],"error":[32]},null,{"value":[{"valueChanged":0}]}],[2,"mrd-list-field",{"name":[1],"label":[1],"value":[1],"required":[4],"disabled":[4],"multiple":[4],"locale":[1],"listItems":[16],"error":[32],"selected":[32]}],[2,"mrd-longtext-field",{"name":[1],"label":[1],"value":[1],"placeholder":[1],"required":[4],"disabled":[4],"locale":[1],"error":[32]}],[2,"mrd-number-field",{"name":[1],"label":[1],"value":[2],"placeholder":[1],"required":[4],"disabled":[4],"locale":[1],"dataType":[1,"data-type"],"decimalPrecision":[2,"decimal-precision"],"displayValue":[32],"error":[32]},null,{"value":[{"valueChanged":0}],"locale":[{"localeChanged":0}]}],[2,"mrd-relation-field",{"name":[1],"label":[1],"required":[4],"disabled":[4],"locale":[1],"relatedClass":[1,"related-class"],"mostSignificantClass":[1,"most-significant-class"],"displayType":[1,"display-type"],"editBehavior":[1,"edit-behavior"],"commonRelation":[1,"common-relation"],"multiple":[4],"dropdownValues":[16],"value":[1],"searchQuery":[32],"searchResults":[32],"allRecords":[32],"isLoading":[32],"selectedItems":[32],"showResults":[32],"error":[32],"highlightedIndex":[32],"setAllRecords":[64],"setSearchResults":[64],"setLoading":[64]},null,{"allRecords":[{"allRecordsChanged":0}],"value":[{"valueChanged":0}]}],[2,"mrd-secret-field",{"name":[1],"label":[1],"value":[1],"placeholder":[1],"required":[4],"disabled":[4],"locale":[1],"error":[32]}],[2,"mrd-table",{"item":[16],"parentId":[1,"parent-id"],"rows":[16],"locale":[1],"totalElements":[2,"total-elements"],"pageSize":[2,"page-size"],"rowHeight":[2,"row-height"],"tableHeight":[2,"table-height"],"requestTimeoutMs":[2,"request-timeout-ms"],"activeViewIdx":[32],"loadedPages":[32],"requestedPages":[32],"failedPages":[32],"renderStart":[32],"renderEnd":[32],"colWidths":[32],"resizingCol":[32],"sortField":[32],"sortDir":[32],"activeFilters":[32],"openFilterCol":[32],"pendingFilter":[32],"popupPos":[32],"createPickerOpen":[32],"viewPopoverOpen":[32],"scrollTop":[32],"textblockModal":[32],"jsonModal":[32],"aggregations":[32],"aggregationsTotal":[32],"minKnownTotal":[32],"init":[64],"setPage":[64],"setAggregations":[64]},null,{"totalElements":[{"totalElementsChanged":0}],"item":[{"itemChanged":0}]}],[2,"mrd-text-field",{"name":[1],"label":[1],"value":[1],"placeholder":[1],"required":[4],"disabled":[4],"locale":[1],"error":[32]}],[2,"mrd-textarea-field",{"name":[1],"label":[1],"value":[1],"placeholder":[1],"required":[4],"disabled":[4],"locale":[1],"error":[32],"editorReady":[32]}],[2,"mrd-time-field",{"name":[1],"label":[1],"value":[1],"required":[4],"disabled":[4],"locale":[1],"error":[32]}]]]], options);
|
|
22
|
+
return index.bootstrapLazy([["mrd-merge-view.cjs",[[2,"mrd-merge-view",{"locale":[1],"basicType":[1,"basic-type"],"mostSignificantClass":[1,"most-significant-class"],"fields":[16],"currentHref":[1,"current-href"],"currentRecord":[16],"currentLabel":[1,"current-label"],"step":[32],"searchQuery":[32],"searchResults":[32],"isLoading":[32],"candidate":[32],"resolutions":[32],"openHistoryKey":[32],"setSearchResults":[64],"setLoading":[64]}]]],["mrd-boolean-field_25.cjs",[[2,"mrd-form",{"layout":[16],"locale":[1],"values":[16],"referenceHref":[1,"reference-href"],"referenceClass":[1,"reference-class"],"showCancel":[4,"show-cancel"],"me":[16],"formValues":[32],"errors":[32],"submitted":[32],"setFieldValue":[64]},null,{"values":[{"valuesChanged":0}],"me":[{"meChanged":0}]}],[2,"mrd-layout-section",{"items":[16],"data":[16],"views":[16],"links":[16],"locale":[1],"archetypes":[16],"readOnly":[4,"read-only"],"searchQueryMap":[32],"searchResultsMap":[32],"imagePreviewUrl":[32],"imagePreviews":[32],"openHistoryField":[32],"setSearchResults":[64],"setViewPage":[64],"setViewAggregations":[64],"setViewDistinct":[64],"setViewFileReference":[64],"setViewCreatedObject":[64],"setImagePreview":[64],"openImagePreview":[64]},null,{"data":[{"dataChanged":0}]}],[2,"mrd-field",{"item":[16],"locale":[1],"value":[16],"historyEntries":[32],"currentValue":[32]},null,{"value":[{"valueChanged":0}]}],[2,"mrd-document-container",{"item":[16],"archetype":[16],"parentId":[1,"parent-id"],"containerHref":[1,"container-href"],"viewKey":[1,"view-key"],"height":[2],"locale":[1],"readOnly":[4,"read-only"],"mode":[32],"canCreate":[32],"targetLabel":[32]}],[2,"mrd-document-view",{"archetype":[16],"data":[16],"locale":[1]},null,{"data":[{"dataChanged":0}]}],[2,"mrd-email-view",{"archetype":[16],"data":[16],"locale":[1]},null,{"data":[{"dataChanged":0}]}],[262,"mrd-invoice-view",{"archetype":[16],"data":[16],"locale":[1],"statusListItems":[16]},null,{"data":[{"dataChanged":0}]}],[2,"mrd-boolean-field",{"name":[1],"label":[1],"value":[4],"required":[4],"disabled":[4],"locale":[1],"checked":[32]}],[2,"mrd-currency-field",{"name":[1],"label":[1],"value":[16],"required":[4],"disabled":[4],"locale":[1],"amountDisplay":[32],"currency":[32],"error":[32]},null,{"value":[{"valueChanged":0}],"locale":[{"localeChanged":0}]}],[2,"mrd-date-field",{"name":[1],"label":[1],"value":[1],"required":[4],"disabled":[4],"locale":[1],"error":[32]}],[2,"mrd-datetime-field",{"name":[1],"label":[1],"value":[1],"required":[4],"disabled":[4],"locale":[1],"error":[32],"localValue":[32]},null,{"value":[{"valueChanged":0}]}],[2,"mrd-document-list",{"item":[16],"archetype":[16],"parentId":[1,"parent-id"],"containerHref":[1,"container-href"],"locale":[1],"readOnly":[4,"read-only"],"containers":[32],"rootLoading":[32],"singleContainer":[32],"selectedId":[32],"dropTargetId":[32],"uploadingNodeId":[32],"rootDropActive":[32],"setDistinct":[64],"setDocuments":[64],"createFolder":[64],"uploadFile":[64],"setFileReference":[64],"setCreatedHref":[64]}],[2,"mrd-email-field",{"name":[1],"label":[1],"value":[1],"placeholder":[1],"required":[4],"disabled":[4],"locale":[1],"error":[32]}],[2,"mrd-file-field",{"name":[1],"label":[1],"value":[16],"required":[4],"disabled":[4],"locale":[1],"accept":[1],"maxSize":[2,"max-size"],"multiple":[4],"entries":[32],"isDragging":[32],"error":[32]},null,{"value":[{"valueChanged":0}]}],[2,"mrd-hyperlink-field",{"name":[1],"label":[1],"value":[1],"placeholder":[1],"required":[4],"disabled":[4],"locale":[1],"internalHref":[32],"internalName":[32],"error":[32]},null,{"value":[{"valueChanged":0}]}],[2,"mrd-image-field",{"name":[1],"label":[1],"value":[16],"required":[4],"disabled":[4],"locale":[1],"accept":[1],"maxSize":[2,"max-size"],"multiple":[4],"entries":[32],"isDragging":[32],"error":[32]},null,{"value":[{"valueChanged":0}]}],[2,"mrd-list-field",{"name":[1],"label":[1],"value":[1],"required":[4],"disabled":[4],"multiple":[4],"locale":[1],"listItems":[16],"error":[32],"selected":[32]}],[2,"mrd-longtext-field",{"name":[1],"label":[1],"value":[1],"placeholder":[1],"required":[4],"disabled":[4],"locale":[1],"error":[32]}],[2,"mrd-number-field",{"name":[1],"label":[1],"value":[2],"placeholder":[1],"required":[4],"disabled":[4],"locale":[1],"dataType":[1,"data-type"],"decimalPrecision":[2,"decimal-precision"],"displayValue":[32],"error":[32]},null,{"value":[{"valueChanged":0}],"locale":[{"localeChanged":0}]}],[2,"mrd-relation-field",{"name":[1],"label":[1],"required":[4],"disabled":[4],"locale":[1],"relatedClass":[1,"related-class"],"mostSignificantClass":[1,"most-significant-class"],"displayType":[1,"display-type"],"editBehavior":[1,"edit-behavior"],"commonRelation":[1,"common-relation"],"multiple":[4],"dropdownValues":[16],"value":[1],"searchQuery":[32],"searchResults":[32],"allRecords":[32],"isLoading":[32],"selectedItems":[32],"showResults":[32],"error":[32],"highlightedIndex":[32],"setAllRecords":[64],"setSearchResults":[64],"setLoading":[64]},null,{"allRecords":[{"allRecordsChanged":0}],"value":[{"valueChanged":0}]}],[2,"mrd-secret-field",{"name":[1],"label":[1],"value":[1],"placeholder":[1],"required":[4],"disabled":[4],"locale":[1],"error":[32]}],[2,"mrd-table",{"item":[16],"parentId":[1,"parent-id"],"rows":[16],"locale":[1],"totalElements":[2,"total-elements"],"pageSize":[2,"page-size"],"rowHeight":[2,"row-height"],"tableHeight":[2,"table-height"],"requestTimeoutMs":[2,"request-timeout-ms"],"readOnly":[4,"read-only"],"activeViewIdx":[32],"loadedPages":[32],"requestedPages":[32],"failedPages":[32],"renderStart":[32],"renderEnd":[32],"colWidths":[32],"resizingCol":[32],"sortField":[32],"sortDir":[32],"activeFilters":[32],"openFilterCol":[32],"pendingFilter":[32],"popupPos":[32],"createPickerOpen":[32],"viewPopoverOpen":[32],"scrollTop":[32],"textblockModal":[32],"jsonModal":[32],"aggregations":[32],"aggregationsTotal":[32],"minKnownTotal":[32],"init":[64],"setPage":[64],"setAggregations":[64]},null,{"totalElements":[{"totalElementsChanged":0}],"item":[{"itemChanged":0}]}],[2,"mrd-text-field",{"name":[1],"label":[1],"value":[1],"placeholder":[1],"required":[4],"disabled":[4],"locale":[1],"error":[32]}],[2,"mrd-textarea-field",{"name":[1],"label":[1],"value":[1],"placeholder":[1],"required":[4],"disabled":[4],"locale":[1],"error":[32],"editorReady":[32]}],[2,"mrd-time-field",{"name":[1],"label":[1],"value":[1],"required":[4],"disabled":[4],"locale":[1],"error":[32]}]]]], options);
|
|
23
23
|
});
|
|
24
24
|
|
|
25
25
|
exports.setNonce = index.setNonce;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var index = require('./index-DVbdkYO3.js');
|
|
4
|
-
var cellRenderer = require('./cell-renderer-
|
|
4
|
+
var cellRenderer = require('./cell-renderer-BBebjBVz.js');
|
|
5
5
|
var clientLayout = require('./client-layout-CqVuJumR.js');
|
|
6
6
|
|
|
7
7
|
const mrdBooleanFieldCss = () => `.sc-mrd-boolean-field-h{display:block}.mrd-boolean-field.sc-mrd-boolean-field{display:flex;align-items:center;width:100%}.mrd-boolean-field__toggle-label.sc-mrd-boolean-field{display:flex;align-items:center;gap:var(--mrd-space-3);cursor:pointer;user-select:none}.mrd-boolean-field__checkbox.sc-mrd-boolean-field{position:absolute;opacity:0;width:0;height:0;pointer-events:none}.mrd-boolean-field__checkbox.sc-mrd-boolean-field:checked+.mrd-boolean-field__toggle.sc-mrd-boolean-field{background-color:var(--mrd-color-primary)}.mrd-boolean-field__checkbox.sc-mrd-boolean-field:checked+.mrd-boolean-field__toggle.sc-mrd-boolean-field::after{transform:translateX(20px)}.mrd-boolean-field__checkbox.sc-mrd-boolean-field:focus+.mrd-boolean-field__toggle.sc-mrd-boolean-field{box-shadow:var(--mrd-shadow-focus)}.mrd-boolean-field__checkbox.sc-mrd-boolean-field:disabled+.mrd-boolean-field__toggle.sc-mrd-boolean-field{opacity:0.5;cursor:not-allowed}.mrd-boolean-field__toggle.sc-mrd-boolean-field{position:relative;display:inline-block;width:44px;height:24px;background-color:var(--mrd-color-neutral-300);border-radius:var(--mrd-border-radius-full);transition:background-color var(--mrd-transition);flex-shrink:0}.mrd-boolean-field__toggle.sc-mrd-boolean-field::after{content:"";position:absolute;top:2px;left:2px;width:20px;height:20px;background-color:var(--mrd-color-white);border-radius:50%;transition:transform var(--mrd-transition);box-shadow:var(--mrd-shadow-sm)}.mrd-boolean-field__text.sc-mrd-boolean-field{font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-base);color:var(--mrd-color-neutral-800)}.mrd-boolean-field__text--required.sc-mrd-boolean-field::after{content:" *";color:var(--mrd-color-danger)}`;
|
|
@@ -363,6 +363,10 @@ const MrdDocumentContainer = class {
|
|
|
363
363
|
* on top, Finder-style. The table manages its own height. */
|
|
364
364
|
this.height = 460;
|
|
365
365
|
this.locale = navigator.language;
|
|
366
|
+
/** When true, this dashboard is read-only: New folder and Upload are disabled
|
|
367
|
+
* (with a tooltip explaining why) and the embedded table/list get it passed
|
|
368
|
+
* through so their own create/upload/drag-drop paths are disabled too. */
|
|
369
|
+
this.readOnly = false;
|
|
366
370
|
/** Active body: folder tree or flat table. */
|
|
367
371
|
this.mode = 'tree';
|
|
368
372
|
/** Whether the folder tree currently has a valid target for "New folder". */
|
|
@@ -377,6 +381,8 @@ const MrdDocumentContainer = class {
|
|
|
377
381
|
};
|
|
378
382
|
this.pickFile = () => {
|
|
379
383
|
var _a;
|
|
384
|
+
if (this.readOnly)
|
|
385
|
+
return;
|
|
380
386
|
(_a = this.fileInputEl) === null || _a === void 0 ? void 0 : _a.click();
|
|
381
387
|
};
|
|
382
388
|
/** One file per upload, matching the drop handler. Reset the input afterwards
|
|
@@ -413,11 +419,11 @@ const MrdDocumentContainer = class {
|
|
|
413
419
|
}
|
|
414
420
|
// ── Toolbar ────────────────────────────────────────────────────────────────
|
|
415
421
|
renderToolbar() {
|
|
416
|
-
return (index.h("div", { class: "mrd-document-container__toolbar" }, this.mode === 'tree' && (index.h("button", { type: "button", class: "mrd-document-container__action", disabled: !this.canCreate, onClick: this.createFolder }, 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: "M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z" }), index.h("path", { d: "M12 11v4M10 13h4" })), cellRenderer.t('new_folder', this.locale))), this.mode === 'tree' && (index.h("button", { type: "button", class: "mrd-document-container__action", disabled: !this.canCreate, title: this.targetLabel ? `${cellRenderer.t('doc_upload_to', this.locale)} ${this.targetLabel}` : undefined, onClick: this.pickFile }, 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: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }), index.h("path", { d: "M12 3v13M7 8l5-5 5 5" })), cellRenderer.t('doc_upload', this.locale))), index.h("input", { type: "file", class: "mrd-document-container__file-input", ref: el => (this.fileInputEl = el), onChange: this.onFilePicked }), index.h("div", { class: "mrd-document-container__seg", role: "group", "aria-label": cellRenderer.t('doc_view_switch', this.locale) }, index.h("button", { class: "mrd-document-container__seg-btn", "aria-pressed": String(this.mode === 'tree'), title: cellRenderer.t('doc_view_tree', this.locale), "aria-label": cellRenderer.t('doc_view_tree', this.locale), onClick: () => this.setMode('tree') }, 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: "M3 5h6M3 12h9M3 19h6" }), index.h("circle", { cx: "18", cy: "5", r: "1.6" }), index.h("circle", { cx: "18", cy: "19", r: "1.6" }), index.h("path", { d: "M16 12h4" }))), index.h("button", { class: "mrd-document-container__seg-btn", "aria-pressed": String(this.mode === 'list'), title: cellRenderer.t('doc_view_list', this.locale), "aria-label": cellRenderer.t('doc_view_list', this.locale), onClick: () => this.setMode('list') }, 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: "M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01" }))))));
|
|
422
|
+
return (index.h("div", { class: "mrd-document-container__toolbar" }, this.mode === 'tree' && (index.h("button", { type: "button", class: "mrd-document-container__action", disabled: this.readOnly || !this.canCreate, title: this.readOnly ? cellRenderer.t('readonly_access', this.locale) : undefined, onClick: this.createFolder }, 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: "M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z" }), index.h("path", { d: "M12 11v4M10 13h4" })), cellRenderer.t('new_folder', this.locale))), this.mode === 'tree' && (index.h("button", { type: "button", class: "mrd-document-container__action", disabled: this.readOnly || !this.canCreate, title: this.readOnly ? cellRenderer.t('readonly_access', this.locale) : (this.targetLabel ? `${cellRenderer.t('doc_upload_to', this.locale)} ${this.targetLabel}` : undefined), onClick: this.pickFile }, 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: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }), index.h("path", { d: "M12 3v13M7 8l5-5 5 5" })), cellRenderer.t('doc_upload', this.locale))), index.h("input", { type: "file", class: "mrd-document-container__file-input", ref: el => (this.fileInputEl = el), onChange: this.onFilePicked }), index.h("div", { class: "mrd-document-container__seg", role: "group", "aria-label": cellRenderer.t('doc_view_switch', this.locale) }, index.h("button", { class: "mrd-document-container__seg-btn", "aria-pressed": String(this.mode === 'tree'), title: cellRenderer.t('doc_view_tree', this.locale), "aria-label": cellRenderer.t('doc_view_tree', this.locale), onClick: () => this.setMode('tree') }, 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: "M3 5h6M3 12h9M3 19h6" }), index.h("circle", { cx: "18", cy: "5", r: "1.6" }), index.h("circle", { cx: "18", cy: "19", r: "1.6" }), index.h("path", { d: "M16 12h4" }))), index.h("button", { class: "mrd-document-container__seg-btn", "aria-pressed": String(this.mode === 'list'), title: cellRenderer.t('doc_view_list', this.locale), "aria-label": cellRenderer.t('doc_view_list', this.locale), onClick: () => this.setMode('list') }, 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: "M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01" }))))));
|
|
417
423
|
}
|
|
418
424
|
// ── Bodies ───────────────────────────────────────────────────────────────
|
|
419
425
|
renderTree() {
|
|
420
|
-
return (index.h("mrd-document-list", { "data-doclist": this.viewKey, ref: el => (this.listEl = el), item: this.item, archetype: this.archetype, parentId: this.parentId, containerHref: this.containerHref, locale: this.locale, onMrdLoadDistinct: (e) => {
|
|
426
|
+
return (index.h("mrd-document-list", { "data-doclist": this.viewKey, ref: el => (this.listEl = el), item: this.item, archetype: this.archetype, parentId: this.parentId, containerHref: this.containerHref, locale: this.locale, readOnly: this.readOnly, onMrdLoadDistinct: (e) => {
|
|
421
427
|
e.stopPropagation();
|
|
422
428
|
this.mrdLoadDistinct.emit(e.detail);
|
|
423
429
|
}, onMrdLoadPage: (e) => {
|
|
@@ -444,7 +450,7 @@ const MrdDocumentContainer = class {
|
|
|
444
450
|
} }));
|
|
445
451
|
}
|
|
446
452
|
renderList() {
|
|
447
|
-
return (index.h("mrd-table", { "data-view": this.viewKey, ref: el => (this.tableEl = el), item: this.item, parentId: this.parentId, locale: this.locale, onMrdLoadPage: (e) => {
|
|
453
|
+
return (index.h("mrd-table", { "data-view": this.viewKey, ref: el => (this.tableEl = el), item: this.item, parentId: this.parentId, locale: this.locale, readOnly: this.readOnly, onMrdLoadPage: (e) => {
|
|
448
454
|
e.stopPropagation();
|
|
449
455
|
this.mrdLoadPage.emit(e.detail);
|
|
450
456
|
}, onMrdLoadAggregations: (e) => {
|
|
@@ -468,7 +474,7 @@ const MrdDocumentContainer = class {
|
|
|
468
474
|
}
|
|
469
475
|
render() {
|
|
470
476
|
const treeMode = this.mode === 'tree';
|
|
471
|
-
return (index.h(index.Host, { key: '
|
|
477
|
+
return (index.h(index.Host, { key: '6792d49f08dd19f6c51e4b656df06bbd8bc14f3e' }, this.renderToolbar(), index.h("div", { key: '702f4c288f8c40bd2c5999beb392b9dfd022b0bc', class: {
|
|
472
478
|
'mrd-document-container__body': true,
|
|
473
479
|
'mrd-document-container__body--tree': treeMode,
|
|
474
480
|
}, style: treeMode ? { height: `${this.height}px`, overflowY: 'auto' } : {} }, treeMode ? this.renderTree() : this.renderList())));
|
|
@@ -735,6 +741,11 @@ const MrdDocumentList = class {
|
|
|
735
741
|
* accepts file drops and folder creation. */
|
|
736
742
|
this.containerHref = '';
|
|
737
743
|
this.locale = navigator.language;
|
|
744
|
+
/** When true, folder creation, file upload (button and drag-drop) and moving a
|
|
745
|
+
* document between folders are all disabled — a viewer-role user can browse
|
|
746
|
+
* but not mutate anything. Drives mrdCanCreate(false) so the host toolbar's
|
|
747
|
+
* New folder / Upload buttons stay disabled too. */
|
|
748
|
+
this.readOnly = false;
|
|
738
749
|
this.containers = [];
|
|
739
750
|
this.rootLoading = true;
|
|
740
751
|
/** True when the single-container level is collapsed away (dossier context). */
|
|
@@ -777,6 +788,8 @@ const MrdDocumentList = class {
|
|
|
777
788
|
/** The optimistic document row awaiting its self href from the create POST. */
|
|
778
789
|
this.lastOptimisticDoc = null;
|
|
779
790
|
this.startCreateFolder = () => {
|
|
791
|
+
if (this.readOnly)
|
|
792
|
+
return;
|
|
780
793
|
const resolved = this.resolveTarget();
|
|
781
794
|
if (!resolved || this.pendingNode)
|
|
782
795
|
return;
|
|
@@ -816,6 +829,10 @@ const MrdDocumentList = class {
|
|
|
816
829
|
// ── Drag & drop: move a document into another folder / container ────────────
|
|
817
830
|
this.onDocDragStart = (e, doc, node) => {
|
|
818
831
|
var _a, _b, _c;
|
|
832
|
+
if (this.readOnly) {
|
|
833
|
+
e.preventDefault();
|
|
834
|
+
return;
|
|
835
|
+
}
|
|
819
836
|
this.dragDoc = doc;
|
|
820
837
|
this.dragFromId = node.id;
|
|
821
838
|
if (e.dataTransfer) {
|
|
@@ -835,6 +852,11 @@ const MrdDocumentList = class {
|
|
|
835
852
|
* root drop-zone; a different node is highlighted (its own folder = no-op). */
|
|
836
853
|
this.onNodeDragOver = (e, node) => {
|
|
837
854
|
const file = this.isFileDrag(e);
|
|
855
|
+
if (this.readOnly) {
|
|
856
|
+
if (file)
|
|
857
|
+
e.preventDefault(); // swallow so the browser doesn't navigate to the dropped file
|
|
858
|
+
return;
|
|
859
|
+
}
|
|
838
860
|
if (!this.dragDoc && !file)
|
|
839
861
|
return;
|
|
840
862
|
e.preventDefault();
|
|
@@ -850,6 +872,10 @@ const MrdDocumentList = class {
|
|
|
850
872
|
this.dropTargetId = null;
|
|
851
873
|
};
|
|
852
874
|
this.onNodeDrop = (e, node, container) => {
|
|
875
|
+
if (this.readOnly) {
|
|
876
|
+
e.preventDefault();
|
|
877
|
+
return;
|
|
878
|
+
}
|
|
853
879
|
if (this.isFileDrag(e)) {
|
|
854
880
|
e.preventDefault();
|
|
855
881
|
e.stopPropagation();
|
|
@@ -868,6 +894,11 @@ const MrdDocumentList = class {
|
|
|
868
894
|
if (!this.singleContainer)
|
|
869
895
|
return;
|
|
870
896
|
const file = this.isFileDrag(e);
|
|
897
|
+
if (this.readOnly) {
|
|
898
|
+
if (file)
|
|
899
|
+
e.preventDefault(); // swallow so the browser doesn't navigate to the dropped file
|
|
900
|
+
return;
|
|
901
|
+
}
|
|
871
902
|
if (!this.dragDoc && !file)
|
|
872
903
|
return;
|
|
873
904
|
e.preventDefault();
|
|
@@ -885,6 +916,10 @@ const MrdDocumentList = class {
|
|
|
885
916
|
};
|
|
886
917
|
this.onRootDrop = (e) => {
|
|
887
918
|
this.rootDropActive = false;
|
|
919
|
+
if (this.readOnly) {
|
|
920
|
+
e.preventDefault();
|
|
921
|
+
return;
|
|
922
|
+
}
|
|
888
923
|
if (!this.singleContainer)
|
|
889
924
|
return;
|
|
890
925
|
const only = this.containers[0];
|
|
@@ -1155,10 +1190,10 @@ const MrdDocumentList = class {
|
|
|
1155
1190
|
return null;
|
|
1156
1191
|
}
|
|
1157
1192
|
get canCreateFolder() {
|
|
1158
|
-
return !this.pendingNode && this.resolveTarget() !== null;
|
|
1193
|
+
return !this.readOnly && !this.pendingNode && this.resolveTarget() !== null;
|
|
1159
1194
|
}
|
|
1160
1195
|
/** Start creating a folder under the current target. Called by the host toolbar
|
|
1161
|
-
* (mrd-document-container). No-op when there is no valid target. */
|
|
1196
|
+
* (mrd-document-container). No-op when there is no valid target, or read-only. */
|
|
1162
1197
|
async createFolder() {
|
|
1163
1198
|
this.startCreateFolder();
|
|
1164
1199
|
}
|
|
@@ -1244,7 +1279,7 @@ const MrdDocumentList = class {
|
|
|
1244
1279
|
* (mrd-document-container). No-op without a target, or while another upload
|
|
1245
1280
|
* is still awaiting its setFileReference. */
|
|
1246
1281
|
async uploadFile(file) {
|
|
1247
|
-
if (!file || this.pendingUpload)
|
|
1282
|
+
if (this.readOnly || !file || this.pendingUpload)
|
|
1248
1283
|
return;
|
|
1249
1284
|
const resolved = this.resolveTarget();
|
|
1250
1285
|
if (!resolved)
|
|
@@ -1385,7 +1420,7 @@ const MrdDocumentList = class {
|
|
|
1385
1420
|
body = renderLoadingRow(ctx, 0);
|
|
1386
1421
|
}
|
|
1387
1422
|
else if (this.containers.length === 0) {
|
|
1388
|
-
body = index.h("div", { key: '
|
|
1423
|
+
body = index.h("div", { key: '5d473ec3a894361325a71deb14e7b52d0abc5f06', class: "mrd-document-list__empty" }, cellRenderer.t('no_results', this.locale));
|
|
1389
1424
|
}
|
|
1390
1425
|
else if (this.singleContainer) {
|
|
1391
1426
|
// Dossier context: render the single container's folder tree at the root.
|
|
@@ -1403,7 +1438,7 @@ const MrdDocumentList = class {
|
|
|
1403
1438
|
else {
|
|
1404
1439
|
body = this.containers.map(c => renderContainerNode(ctx, c, 0));
|
|
1405
1440
|
}
|
|
1406
|
-
return (index.h(index.Host, { key: '
|
|
1441
|
+
return (index.h(index.Host, { key: '757babf3ccabbb113ab2a24d632b2b9a02d3c08b' }, index.h("div", { key: '606c212687482efdc5666333678e2ea406709e75', class: 'mrd-document-list' + (this.rootDropActive ? ' mrd-document-list--drop-active' : ''), onDragOver: this.onRootDragOver, onDragLeave: this.onRootDragLeave, onDrop: this.onRootDrop }, body)));
|
|
1407
1442
|
}
|
|
1408
1443
|
get el() { return index.getElement(this); }
|
|
1409
1444
|
};
|
|
@@ -5318,6 +5353,10 @@ const MrdLayoutSection = class {
|
|
|
5318
5353
|
/** Top-level archetypes on the object dashboard. When it contains commons.document,
|
|
5319
5354
|
* the record is rendered as a single-document view instead of generic fields. */
|
|
5320
5355
|
this.archetypes = [];
|
|
5356
|
+
/** When true, this dashboard is read-only (viewer role): the embedded mrd-table's
|
|
5357
|
+
* create ("+") action and the documents view's New folder / Upload are disabled
|
|
5358
|
+
* with a tooltip explaining why, so it's clear at a glance the user can't mutate data. */
|
|
5359
|
+
this.readOnly = false;
|
|
5321
5360
|
this.searchQueryMap = {};
|
|
5322
5361
|
this.searchResultsMap = {};
|
|
5323
5362
|
this.imagePreviewUrl = null;
|
|
@@ -5523,7 +5562,7 @@ const MrdLayoutSection = class {
|
|
|
5523
5562
|
* swaps between the folder tree and the flat table. Events are re-emitted to
|
|
5524
5563
|
* the host with the view key, exactly as the raw list/table events were. */
|
|
5525
5564
|
renderDocumentContainer(item, key, parentId, archetype, containerHref) {
|
|
5526
|
-
return (index.h("mrd-document-container", { item: item, archetype: archetype, parentId: parentId, containerHref: containerHref, viewKey: key, locale: this.locale, onMrdLoadDistinct: (e) => {
|
|
5565
|
+
return (index.h("mrd-document-container", { item: item, archetype: archetype, parentId: parentId, containerHref: containerHref, viewKey: key, locale: this.locale, readOnly: this.readOnly, onMrdLoadDistinct: (e) => {
|
|
5527
5566
|
e.stopPropagation();
|
|
5528
5567
|
this.mrdLoadViewDistinct.emit(Object.assign({ name: key }, e.detail));
|
|
5529
5568
|
}, onMrdLoadPage: (e) => {
|
|
@@ -5556,7 +5595,7 @@ const MrdLayoutSection = class {
|
|
|
5556
5595
|
} }));
|
|
5557
5596
|
}
|
|
5558
5597
|
renderTable(item, key, parentId) {
|
|
5559
|
-
return (index.h("mrd-table", { "data-view": key, item: item, parentId: parentId, locale: this.locale, onMrdLoadPage: (e) => this.handleViewLoadPage(e, key), onMrdLoadAggregations: (e) => {
|
|
5598
|
+
return (index.h("mrd-table", { "data-view": key, item: item, parentId: parentId, locale: this.locale, readOnly: this.readOnly, onMrdLoadPage: (e) => this.handleViewLoadPage(e, key), onMrdLoadAggregations: (e) => {
|
|
5560
5599
|
var _a;
|
|
5561
5600
|
e.stopPropagation();
|
|
5562
5601
|
this.mrdLoadViewAggregations.emit(Object.assign({ name: key, dataClass: (_a = item.dataClass) !== null && _a !== void 0 ? _a : key }, e.detail));
|
|
@@ -5660,7 +5699,7 @@ const MrdLayoutSection = class {
|
|
|
5660
5699
|
const docArchetype = clientLayout.resolveArchetype(this.archetypes, clientLayout.ARCHETYPE_DOCUMENT);
|
|
5661
5700
|
const invoiceArchetype = !docArchetype ? clientLayout.resolveArchetype(this.archetypes, clientLayout.ARCHETYPE_INVOICE) : undefined;
|
|
5662
5701
|
const emailArchetype = !docArchetype && !invoiceArchetype ? clientLayout.resolveArchetype(this.archetypes, clientLayout.ARCHETYPE_EMAIL) : undefined;
|
|
5663
|
-
return (index.h(index.Host, { key: '
|
|
5702
|
+
return (index.h(index.Host, { key: '07b1d61b170a5ae971ba54eaf775e1787dea1642' }, index.h("div", { key: 'd146e0542b1de11bd130eb3d36d54e4faf055309', class: "mrd-layout-section" }, docArchetype && this.renderDocumentObject(docArchetype), invoiceArchetype && this.renderInvoiceObject(invoiceArchetype), emailArchetype && this.renderEmailObject(emailArchetype), !docArchetype && !invoiceArchetype && !emailArchetype && this.items.map(item => this.renderItem(item))), this.renderImageModal()));
|
|
5664
5703
|
}
|
|
5665
5704
|
get el() { return index.getElement(this); }
|
|
5666
5705
|
static get watchers() { return {
|
|
@@ -6436,7 +6475,7 @@ const JsonModal = ({ html, locale, onClose }) => {
|
|
|
6436
6475
|
return null;
|
|
6437
6476
|
return (index.h("div", { class: "mrd-table__modal-backdrop", onClick: onClose, role: "dialog", "aria-modal": "true" }, index.h("div", { class: "mrd-table__modal", onClick: (e) => e.stopPropagation() }, index.h("button", { class: "mrd-table__modal-close", onClick: onClose, "aria-label": cellRenderer.t('close', locale) }, "\u2715"), index.h("pre", { class: "mrd-table__modal-json", innerHTML: html }))));
|
|
6438
6477
|
};
|
|
6439
|
-
const Toolbar = ({ locale, filterCount, actions, views, activeViewIdx, viewPopoverOpen, createPickerOpen, createTypes, cb }) => {
|
|
6478
|
+
const Toolbar = ({ locale, filterCount, actions, views, activeViewIdx, viewPopoverOpen, createPickerOpen, createTypes, readOnly, cb }) => {
|
|
6440
6479
|
var _a;
|
|
6441
6480
|
const hasActions = actions.length > 0;
|
|
6442
6481
|
const hasViewSwitcher = views.length > 1;
|
|
@@ -6447,14 +6486,18 @@ const Toolbar = ({ locale, filterCount, actions, views, activeViewIdx, viewPopov
|
|
|
6447
6486
|
} }, v.label)))))), index.h("button", { class: "mrd-table__view-arrow", "aria-label": "Next view", onClick: () => cb.onViewSwitch((activeViewIdx + 1) % views.length) }, "\u25B6")))), hasActions && (index.h("div", { class: "mrd-table__toolbar-right" }, actions.map(a => {
|
|
6448
6487
|
var _a, _b;
|
|
6449
6488
|
const pickerTypes = a.action === 'create' ? createTypes : null;
|
|
6489
|
+
// readOnly only ever disables 'create' (see mrd-table.tsx tableActions) — export,
|
|
6490
|
+
// sorting and filtering don't mutate data and stay available.
|
|
6491
|
+
const disabled = a.disabled || (readOnly && a.action === 'create');
|
|
6492
|
+
const tooltip = disabled && readOnly ? cellRenderer.t('readonly_access', locale) : a.label;
|
|
6450
6493
|
if (pickerTypes === null || pickerTypes === void 0 ? void 0 : pickerTypes.length) {
|
|
6451
|
-
return (index.h("div", { class: "mrd-table__create-picker-wrap", key: `action-${a.action}` }, index.h("button", { class: `mrd-table__action mrd-table__action--${(_a = a.variant) !== null && _a !== void 0 ? _a : 'secondary'}`, onClick: cb.onToggleCreatePicker }, a.icon
|
|
6494
|
+
return (index.h("div", { class: "mrd-table__create-picker-wrap", key: `action-${a.action}` }, index.h("button", { class: `mrd-table__action mrd-table__action--${(_a = a.variant) !== null && _a !== void 0 ? _a : 'secondary'}`, disabled: disabled, onClick: cb.onToggleCreatePicker }, a.icon
|
|
6452
6495
|
? index.h("svg", { class: "mrd-table__action-icon", "aria-hidden": "true" }, index.h("use", { href: a.icon }))
|
|
6453
|
-
: a.label, index.h("span", { class: "mrd-table__action-tooltip" },
|
|
6496
|
+
: a.label, index.h("span", { class: "mrd-table__action-tooltip" }, tooltip)), createPickerOpen && (index.h("div", { class: "mrd-table__create-picker" }, pickerTypes.map(ct => (index.h("button", { key: ct.type, class: "mrd-table__create-picker-item", onClick: () => cb.onCreate(ct.type) }, ct.label)))))));
|
|
6454
6497
|
}
|
|
6455
|
-
return (index.h("button", { key: `action-${a.action}`, class: `mrd-table__action mrd-table__action--${(_b = a.variant) !== null && _b !== void 0 ? _b : 'secondary'}`, disabled:
|
|
6498
|
+
return (index.h("button", { key: `action-${a.action}`, class: `mrd-table__action mrd-table__action--${(_b = a.variant) !== null && _b !== void 0 ? _b : 'secondary'}`, disabled: disabled, onClick: () => cb.onAction(a.action) }, a.icon
|
|
6456
6499
|
? index.h("svg", { class: "mrd-table__action-icon", "aria-hidden": "true" }, index.h("use", { href: a.icon }))
|
|
6457
|
-
: a.label, index.h("span", { class: "mrd-table__action-tooltip" },
|
|
6500
|
+
: a.label, index.h("span", { class: "mrd-table__action-tooltip" }, tooltip)));
|
|
6458
6501
|
})))));
|
|
6459
6502
|
};
|
|
6460
6503
|
|
|
@@ -6675,6 +6718,10 @@ const MrdTable = class {
|
|
|
6675
6718
|
/** Time (ms) to wait for setPage() before retrying a page request; after
|
|
6676
6719
|
* MAX_RETRY_ATTEMPTS retries the page is marked failed (see failedPages). */
|
|
6677
6720
|
this.requestTimeoutMs = REQUEST_TIMEOUT_MS;
|
|
6721
|
+
/** When true, the toolbar's create ("+") action is disabled (with a tooltip
|
|
6722
|
+
* explaining why) so a viewer-role user can see at a glance that this dashboard
|
|
6723
|
+
* is read-only. Sorting, filtering and export stay available — those don't mutate data. */
|
|
6724
|
+
this.readOnly = false;
|
|
6678
6725
|
// ── Internal state ─────────────────────────────────────────────────────────
|
|
6679
6726
|
/** Index into allViews[] for the currently displayed view. 0 = primary, 1+ = alternatives. */
|
|
6680
6727
|
this.activeViewIdx = 0;
|
|
@@ -7244,7 +7291,7 @@ const MrdTable = class {
|
|
|
7244
7291
|
const raw = (_b = (_a = this.item) === null || _a === void 0 ? void 0 : _a.actions) !== null && _b !== void 0 ? _b : [];
|
|
7245
7292
|
return (raw !== null && raw !== void 0 ? raw : []).reduce((acc, a) => {
|
|
7246
7293
|
if (a === 'NEW')
|
|
7247
|
-
acc.push({ action: 'create', label: cellRenderer.t('table_new_record', this.locale), icon: 'assets/sprites.svg#icon-plus', variant: 'primary' });
|
|
7294
|
+
acc.push({ action: 'create', label: cellRenderer.t('table_new_record', this.locale), icon: 'assets/sprites.svg#icon-plus', variant: 'primary', disabled: this.readOnly });
|
|
7248
7295
|
if (a === 'EXPORT')
|
|
7249
7296
|
acc.push({ action: 'export', label: cellRenderer.t('table_export_excel', this.locale), icon: 'assets/sprites.svg#icon-file-excel' });
|
|
7250
7297
|
return acc;
|
|
@@ -7607,7 +7654,7 @@ const MrdTable = class {
|
|
|
7607
7654
|
// ── Render: toolbar ────────────────────────────────────────────────────────
|
|
7608
7655
|
renderToolbar() {
|
|
7609
7656
|
var _a;
|
|
7610
|
-
return (index.h(Toolbar, { locale: this.locale, filterCount: this.activeFilters.size, actions: this.tableActions, views: this.allViews, activeViewIdx: this.activeViewIdx, viewPopoverOpen: this.viewPopoverOpen, createPickerOpen: this.createPickerOpen, createTypes: (_a = this.item) === null || _a === void 0 ? void 0 : _a.createTypes, cb: {
|
|
7657
|
+
return (index.h(Toolbar, { locale: this.locale, filterCount: this.activeFilters.size, actions: this.tableActions, views: this.allViews, activeViewIdx: this.activeViewIdx, viewPopoverOpen: this.viewPopoverOpen, createPickerOpen: this.createPickerOpen, createTypes: (_a = this.item) === null || _a === void 0 ? void 0 : _a.createTypes, readOnly: this.readOnly, cb: {
|
|
7611
7658
|
onClearAllFilters: () => this.clearAllFilters(),
|
|
7612
7659
|
onViewSwitch: idx => this.handleViewSwitch(idx),
|
|
7613
7660
|
onToggleViewPopover: e => this.toggleViewPopover(e),
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var index = require('./index-DVbdkYO3.js');
|
|
4
4
|
var clientLayout = require('./client-layout-CqVuJumR.js');
|
|
5
|
-
var cellRenderer = require('./cell-renderer-
|
|
5
|
+
var cellRenderer = require('./cell-renderer-BBebjBVz.js');
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Whether a layout item can appear in the merge diff at all. m-n relations
|
package/dist/collection/components/documents/mrd-document-container/mrd-document-container.js
CHANGED
|
@@ -28,6 +28,10 @@ export class MrdDocumentContainer {
|
|
|
28
28
|
* on top, Finder-style. The table manages its own height. */
|
|
29
29
|
this.height = 460;
|
|
30
30
|
this.locale = navigator.language;
|
|
31
|
+
/** When true, this dashboard is read-only: New folder and Upload are disabled
|
|
32
|
+
* (with a tooltip explaining why) and the embedded table/list get it passed
|
|
33
|
+
* through so their own create/upload/drag-drop paths are disabled too. */
|
|
34
|
+
this.readOnly = false;
|
|
31
35
|
/** Active body: folder tree or flat table. */
|
|
32
36
|
this.mode = 'tree';
|
|
33
37
|
/** Whether the folder tree currently has a valid target for "New folder". */
|
|
@@ -42,6 +46,8 @@ export class MrdDocumentContainer {
|
|
|
42
46
|
};
|
|
43
47
|
this.pickFile = () => {
|
|
44
48
|
var _a;
|
|
49
|
+
if (this.readOnly)
|
|
50
|
+
return;
|
|
45
51
|
(_a = this.fileInputEl) === null || _a === void 0 ? void 0 : _a.click();
|
|
46
52
|
};
|
|
47
53
|
/** One file per upload, matching the drop handler. Reset the input afterwards
|
|
@@ -78,11 +84,11 @@ export class MrdDocumentContainer {
|
|
|
78
84
|
}
|
|
79
85
|
// ── Toolbar ────────────────────────────────────────────────────────────────
|
|
80
86
|
renderToolbar() {
|
|
81
|
-
return (h("div", { class: "mrd-document-container__toolbar" }, this.mode === 'tree' && (h("button", { type: "button", class: "mrd-document-container__action", disabled: !this.canCreate, onClick: this.createFolder }, h("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true" }, h("path", { d: "M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z" }), h("path", { d: "M12 11v4M10 13h4" })), t('new_folder', this.locale))), this.mode === 'tree' && (h("button", { type: "button", class: "mrd-document-container__action", disabled: !this.canCreate, title: this.targetLabel ? `${t('doc_upload_to', this.locale)} ${this.targetLabel}` : undefined, onClick: this.pickFile }, h("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true" }, h("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }), h("path", { d: "M12 3v13M7 8l5-5 5 5" })), t('doc_upload', this.locale))), h("input", { type: "file", class: "mrd-document-container__file-input", ref: el => (this.fileInputEl = el), onChange: this.onFilePicked }), h("div", { class: "mrd-document-container__seg", role: "group", "aria-label": t('doc_view_switch', this.locale) }, h("button", { class: "mrd-document-container__seg-btn", "aria-pressed": String(this.mode === 'tree'), title: t('doc_view_tree', this.locale), "aria-label": t('doc_view_tree', this.locale), onClick: () => this.setMode('tree') }, h("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true" }, h("path", { d: "M3 5h6M3 12h9M3 19h6" }), h("circle", { cx: "18", cy: "5", r: "1.6" }), h("circle", { cx: "18", cy: "19", r: "1.6" }), h("path", { d: "M16 12h4" }))), h("button", { class: "mrd-document-container__seg-btn", "aria-pressed": String(this.mode === 'list'), title: t('doc_view_list', this.locale), "aria-label": t('doc_view_list', this.locale), onClick: () => this.setMode('list') }, h("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true" }, h("path", { d: "M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01" }))))));
|
|
87
|
+
return (h("div", { class: "mrd-document-container__toolbar" }, this.mode === 'tree' && (h("button", { type: "button", class: "mrd-document-container__action", disabled: this.readOnly || !this.canCreate, title: this.readOnly ? t('readonly_access', this.locale) : undefined, onClick: this.createFolder }, h("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true" }, h("path", { d: "M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z" }), h("path", { d: "M12 11v4M10 13h4" })), t('new_folder', this.locale))), this.mode === 'tree' && (h("button", { type: "button", class: "mrd-document-container__action", disabled: this.readOnly || !this.canCreate, title: this.readOnly ? t('readonly_access', this.locale) : (this.targetLabel ? `${t('doc_upload_to', this.locale)} ${this.targetLabel}` : undefined), onClick: this.pickFile }, h("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true" }, h("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }), h("path", { d: "M12 3v13M7 8l5-5 5 5" })), t('doc_upload', this.locale))), h("input", { type: "file", class: "mrd-document-container__file-input", ref: el => (this.fileInputEl = el), onChange: this.onFilePicked }), h("div", { class: "mrd-document-container__seg", role: "group", "aria-label": t('doc_view_switch', this.locale) }, h("button", { class: "mrd-document-container__seg-btn", "aria-pressed": String(this.mode === 'tree'), title: t('doc_view_tree', this.locale), "aria-label": t('doc_view_tree', this.locale), onClick: () => this.setMode('tree') }, h("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true" }, h("path", { d: "M3 5h6M3 12h9M3 19h6" }), h("circle", { cx: "18", cy: "5", r: "1.6" }), h("circle", { cx: "18", cy: "19", r: "1.6" }), h("path", { d: "M16 12h4" }))), h("button", { class: "mrd-document-container__seg-btn", "aria-pressed": String(this.mode === 'list'), title: t('doc_view_list', this.locale), "aria-label": t('doc_view_list', this.locale), onClick: () => this.setMode('list') }, h("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true" }, h("path", { d: "M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01" }))))));
|
|
82
88
|
}
|
|
83
89
|
// ── Bodies ───────────────────────────────────────────────────────────────
|
|
84
90
|
renderTree() {
|
|
85
|
-
return (h("mrd-document-list", { "data-doclist": this.viewKey, ref: el => (this.listEl = el), item: this.item, archetype: this.archetype, parentId: this.parentId, containerHref: this.containerHref, locale: this.locale, onMrdLoadDistinct: (e) => {
|
|
91
|
+
return (h("mrd-document-list", { "data-doclist": this.viewKey, ref: el => (this.listEl = el), item: this.item, archetype: this.archetype, parentId: this.parentId, containerHref: this.containerHref, locale: this.locale, readOnly: this.readOnly, onMrdLoadDistinct: (e) => {
|
|
86
92
|
e.stopPropagation();
|
|
87
93
|
this.mrdLoadDistinct.emit(e.detail);
|
|
88
94
|
}, onMrdLoadPage: (e) => {
|
|
@@ -109,7 +115,7 @@ export class MrdDocumentContainer {
|
|
|
109
115
|
} }));
|
|
110
116
|
}
|
|
111
117
|
renderList() {
|
|
112
|
-
return (h("mrd-table", { "data-view": this.viewKey, ref: el => (this.tableEl = el), item: this.item, parentId: this.parentId, locale: this.locale, onMrdLoadPage: (e) => {
|
|
118
|
+
return (h("mrd-table", { "data-view": this.viewKey, ref: el => (this.tableEl = el), item: this.item, parentId: this.parentId, locale: this.locale, readOnly: this.readOnly, onMrdLoadPage: (e) => {
|
|
113
119
|
e.stopPropagation();
|
|
114
120
|
this.mrdLoadPage.emit(e.detail);
|
|
115
121
|
}, onMrdLoadAggregations: (e) => {
|
|
@@ -133,7 +139,7 @@ export class MrdDocumentContainer {
|
|
|
133
139
|
}
|
|
134
140
|
render() {
|
|
135
141
|
const treeMode = this.mode === 'tree';
|
|
136
|
-
return (h(Host, { key: '
|
|
142
|
+
return (h(Host, { key: '6792d49f08dd19f6c51e4b656df06bbd8bc14f3e' }, this.renderToolbar(), h("div", { key: '702f4c288f8c40bd2c5999beb392b9dfd022b0bc', class: {
|
|
137
143
|
'mrd-document-container__body': true,
|
|
138
144
|
'mrd-document-container__body--tree': treeMode,
|
|
139
145
|
}, style: treeMode ? { height: `${this.height}px`, overflowY: 'auto' } : {} }, treeMode ? this.renderTree() : this.renderList())));
|
|
@@ -300,6 +306,26 @@ export class MrdDocumentContainer {
|
|
|
300
306
|
"reflect": false,
|
|
301
307
|
"attribute": "locale",
|
|
302
308
|
"defaultValue": "navigator.language"
|
|
309
|
+
},
|
|
310
|
+
"readOnly": {
|
|
311
|
+
"type": "boolean",
|
|
312
|
+
"mutable": false,
|
|
313
|
+
"complexType": {
|
|
314
|
+
"original": "boolean",
|
|
315
|
+
"resolved": "boolean",
|
|
316
|
+
"references": {}
|
|
317
|
+
},
|
|
318
|
+
"required": false,
|
|
319
|
+
"optional": false,
|
|
320
|
+
"docs": {
|
|
321
|
+
"tags": [],
|
|
322
|
+
"text": "When true, this dashboard is read-only: New folder and Upload are disabled\n(with a tooltip explaining why) and the embedded table/list get it passed\nthrough so their own create/upload/drag-drop paths are disabled too."
|
|
323
|
+
},
|
|
324
|
+
"getter": false,
|
|
325
|
+
"setter": false,
|
|
326
|
+
"reflect": false,
|
|
327
|
+
"attribute": "read-only",
|
|
328
|
+
"defaultValue": "false"
|
|
303
329
|
}
|
|
304
330
|
};
|
|
305
331
|
}
|