@mmlogic/components 0.5.16 → 0.5.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/dist/cjs/loader.cjs.js +1 -1
  2. package/dist/cjs/mosterdcomponents.cjs.js +1 -1
  3. package/dist/cjs/mrd-boolean-field_28.cjs.entry.js +158 -20
  4. package/dist/collection/collection-manifest.json +2 -2
  5. package/dist/collection/components/documents/mrd-document-container/mrd-document-container.js +31 -4
  6. package/dist/collection/components/layout/mrd-layout-section/mrd-layout-section.js +131 -12
  7. package/dist/collection/components/memo/mrd-memo-container/mrd-memo-container.js +28 -4
  8. package/dist/collection/components/table/mrd-table/mrd-table.js +105 -2
  9. package/dist/collection/dev/api.js +17 -0
  10. package/dist/collection/dev/app.js +36 -0
  11. package/dist/components/mrd-document-container2.js +1 -1
  12. package/dist/components/mrd-layout-section.js +1 -1
  13. package/dist/components/mrd-memo-container2.js +1 -1
  14. package/dist/components/mrd-table2.js +1 -1
  15. package/dist/esm/loader.js +1 -1
  16. package/dist/esm/mosterdcomponents.js +1 -1
  17. package/dist/esm/mrd-boolean-field_28.entry.js +158 -20
  18. package/dist/mosterdcomponents/mosterdcomponents.esm.js +1 -1
  19. package/dist/mosterdcomponents/p-f72668e9.entry.js +3 -0
  20. package/dist/types/components/documents/mrd-document-container/mrd-document-container.d.ts +7 -0
  21. package/dist/types/components/layout/mrd-layout-section/mrd-layout-section.d.ts +47 -0
  22. package/dist/types/components/memo/mrd-memo-container/mrd-memo-container.d.ts +4 -0
  23. package/dist/types/components/table/mrd-table/mrd-table.d.ts +45 -0
  24. package/dist/types/components.d.ts +49 -0
  25. package/package.json +1 -1
  26. package/dist/mosterdcomponents/cell-renderer-CMUxFREW.js.map +0 -1
  27. package/dist/mosterdcomponents/client-layout-BJkVeSq6.js.map +0 -1
  28. package/dist/mosterdcomponents/document-attachments-BufPmMRv.js.map +0 -1
  29. package/dist/mosterdcomponents/field-helpers-BWAp5fD8.js.map +0 -1
  30. package/dist/mosterdcomponents/file-upload-common-DDWuC9-3.js.map +0 -1
  31. package/dist/mosterdcomponents/format-gcecItcD.js.map +0 -1
  32. package/dist/mosterdcomponents/i18n-OzbszktW.js.map +0 -1
  33. package/dist/mosterdcomponents/index-1ayBojyN.js.map +0 -1
  34. package/dist/mosterdcomponents/index-CkcFwdPc.js.map +0 -1
  35. package/dist/mosterdcomponents/index.esm.js.map +0 -1
  36. package/dist/mosterdcomponents/mosterdcomponents.esm.js.map +0 -1
  37. package/dist/mosterdcomponents/p-8a7fa81d.entry.js +0 -3
  38. package/dist/mosterdcomponents/purify.es-_duHfPgC.js.map +0 -1
  39. package/dist/mosterdcomponents/query-params-3TXd5CUO.js.map +0 -1
  40. package/dist/mosterdcomponents/quill-C9pgw_k-.js.map +0 -1
  41. package/dist/mosterdcomponents/table-query-DJq1uKqJ.js.map +0 -1
  42. package/dist/mosterdcomponents/validation-B_0Lx9DE.js.map +0 -1
@@ -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_28.cjs",[[2,"mrd-form",{"layout":[16],"locale":[1],"values":[16],"referenceHref":[1,"reference-href"],"referenceClass":[1,"reference-class"],"showCancel":[4,"show-cancel"],"showDelete":[4,"show-delete"],"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"],"me":[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],"multiValues":[32],"multiError":[32]},null,{"value":[{"valueChanged":0}]}],[2,"mrd-memo-container",{"item":[16],"archetype":[16],"parentId":[1,"parent-id"],"containerHref":[1,"container-href"],"containerRelated":[4,"container-related"],"showContainerLink":[4,"show-container-link"],"viewKey":[1,"view-key"],"locale":[1],"labelsListItems":[16],"readOnly":[4,"read-only"],"me":[16],"mode":[32],"dialogOpen":[32],"editingHref":[32],"dialogBody":[32],"dialogTitle":[32],"dialogLabels":[32],"dialogImportant":[32],"dialogTouched":[32],"deleteConfirmOpen":[32],"refresh":[64]},null,{"dialogOpen":[{"dialogOpenChanged":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-memo-view",{"archetype":[16],"data":[16],"locale":[1],"labelsListItems":[16]}],[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-longtext-field",{"name":[1],"label":[1],"value":[1],"placeholder":[1],"required":[4],"disabled":[4],"locale":[1],"error":[32]}],[2,"mrd-memo-list",{"item":[16],"archetype":[16],"parentId":[1,"parent-id"],"pageSize":[2,"page-size"],"locale":[1],"readOnly":[4,"read-only"],"labelsListItems":[16],"showContainerLink":[4,"show-container-link"],"rows":[32],"loading":[32],"exhausted":[32],"started":[32],"expandedHrefs":[32],"init":[64],"setPage":[64],"patchRow":[64],"removeRow":[64]}],[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-time-field",{"name":[1],"label":[1],"value":[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],"searchOpen":[32],"searchQuery":[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-boolean-field",{"name":[1],"label":[1],"value":[4],"required":[4],"disabled":[4],"locale":[1],"checked":[32]}],[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-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],"autofocus":[4],"error":[32],"editorReady":[32]},null,{"value":[{"valueChanged":0}]}]]]], 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_28.cjs",[[2,"mrd-form",{"layout":[16],"locale":[1],"values":[16],"referenceHref":[1,"reference-href"],"referenceClass":[1,"reference-class"],"showCancel":[4,"show-cancel"],"showDelete":[4,"show-delete"],"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"],"me":[16],"searchQueryMap":[32],"searchResultsMap":[32],"imagePreviewUrl":[32],"imagePreviews":[32],"openHistoryField":[32],"canCreateMap":[32],"setSearchResults":[64],"setViewPage":[64],"setViewAggregations":[64],"setViewCanCreate":[64],"setViewDistinct":[64],"setViewFileReference":[64],"setViewCreatedObject":[64],"setImagePreview":[64],"openImagePreview":[64]},null,{"data":[{"dataChanged":0}],"items":[{"itemsChanged":0}]}],[2,"mrd-field",{"item":[16],"locale":[1],"value":[16],"historyEntries":[32],"currentValue":[32],"multiValues":[32],"multiError":[32]},null,{"value":[{"valueChanged":0}]}],[2,"mrd-memo-container",{"item":[16],"archetype":[16],"parentId":[1,"parent-id"],"containerHref":[1,"container-href"],"containerRelated":[4,"container-related"],"showContainerLink":[4,"show-container-link"],"viewKey":[1,"view-key"],"locale":[1],"labelsListItems":[16],"readOnly":[4,"read-only"],"canCreate":[4,"can-create"],"me":[16],"mode":[32],"dialogOpen":[32],"editingHref":[32],"dialogBody":[32],"dialogTitle":[32],"dialogLabels":[32],"dialogImportant":[32],"dialogTouched":[32],"deleteConfirmOpen":[32],"refresh":[64]},null,{"dialogOpen":[{"dialogOpenChanged":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"],"mayCreate":[4,"may-create"],"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-memo-view",{"archetype":[16],"data":[16],"locale":[1],"labelsListItems":[16]}],[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-longtext-field",{"name":[1],"label":[1],"value":[1],"placeholder":[1],"required":[4],"disabled":[4],"locale":[1],"error":[32]}],[2,"mrd-memo-list",{"item":[16],"archetype":[16],"parentId":[1,"parent-id"],"pageSize":[2,"page-size"],"locale":[1],"readOnly":[4,"read-only"],"labelsListItems":[16],"showContainerLink":[4,"show-container-link"],"rows":[32],"loading":[32],"exhausted":[32],"started":[32],"expandedHrefs":[32],"init":[64],"setPage":[64],"patchRow":[64],"removeRow":[64]}],[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-time-field",{"name":[1],"label":[1],"value":[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"],"canCreate":[4,"can-create"],"activeViewIdx":[32],"loadedPages":[32],"requestedPages":[32],"failedPages":[32],"renderStart":[32],"renderEnd":[32],"colWidths":[32],"resizingCol":[32],"sortField":[32],"sortDir":[32],"activeFilters":[32],"searchOpen":[32],"searchQuery":[32],"openFilterCol":[32],"pendingFilter":[32],"popupPos":[32],"createPickerOpen":[32],"viewPopoverOpen":[32],"scrollTop":[32],"textblockModal":[32],"jsonModal":[32],"aggregations":[32],"aggregationsTotal":[32],"minKnownTotal":[32],"selfCanCreate":[32],"init":[64],"setPage":[64],"setAggregations":[64],"setCanCreate":[64]},null,{"totalElements":[{"totalElementsChanged":0}],"item":[{"itemChanged":0}],"parentId":[{"parentIdChanged":0}]}],[2,"mrd-boolean-field",{"name":[1],"label":[1],"value":[4],"required":[4],"disabled":[4],"locale":[1],"checked":[32]}],[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-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],"autofocus":[4],"error":[32],"editorReady":[32]},null,{"value":[{"valueChanged":0}]}]]]], 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_28.cjs",[[2,"mrd-form",{"layout":[16],"locale":[1],"values":[16],"referenceHref":[1,"reference-href"],"referenceClass":[1,"reference-class"],"showCancel":[4,"show-cancel"],"showDelete":[4,"show-delete"],"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"],"me":[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],"multiValues":[32],"multiError":[32]},null,{"value":[{"valueChanged":0}]}],[2,"mrd-memo-container",{"item":[16],"archetype":[16],"parentId":[1,"parent-id"],"containerHref":[1,"container-href"],"containerRelated":[4,"container-related"],"showContainerLink":[4,"show-container-link"],"viewKey":[1,"view-key"],"locale":[1],"labelsListItems":[16],"readOnly":[4,"read-only"],"me":[16],"mode":[32],"dialogOpen":[32],"editingHref":[32],"dialogBody":[32],"dialogTitle":[32],"dialogLabels":[32],"dialogImportant":[32],"dialogTouched":[32],"deleteConfirmOpen":[32],"refresh":[64]},null,{"dialogOpen":[{"dialogOpenChanged":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-memo-view",{"archetype":[16],"data":[16],"locale":[1],"labelsListItems":[16]}],[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-longtext-field",{"name":[1],"label":[1],"value":[1],"placeholder":[1],"required":[4],"disabled":[4],"locale":[1],"error":[32]}],[2,"mrd-memo-list",{"item":[16],"archetype":[16],"parentId":[1,"parent-id"],"pageSize":[2,"page-size"],"locale":[1],"readOnly":[4,"read-only"],"labelsListItems":[16],"showContainerLink":[4,"show-container-link"],"rows":[32],"loading":[32],"exhausted":[32],"started":[32],"expandedHrefs":[32],"init":[64],"setPage":[64],"patchRow":[64],"removeRow":[64]}],[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-time-field",{"name":[1],"label":[1],"value":[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],"searchOpen":[32],"searchQuery":[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-boolean-field",{"name":[1],"label":[1],"value":[4],"required":[4],"disabled":[4],"locale":[1],"checked":[32]}],[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-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],"autofocus":[4],"error":[32],"editorReady":[32]},null,{"value":[{"valueChanged":0}]}]]]], 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_28.cjs",[[2,"mrd-form",{"layout":[16],"locale":[1],"values":[16],"referenceHref":[1,"reference-href"],"referenceClass":[1,"reference-class"],"showCancel":[4,"show-cancel"],"showDelete":[4,"show-delete"],"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"],"me":[16],"searchQueryMap":[32],"searchResultsMap":[32],"imagePreviewUrl":[32],"imagePreviews":[32],"openHistoryField":[32],"canCreateMap":[32],"setSearchResults":[64],"setViewPage":[64],"setViewAggregations":[64],"setViewCanCreate":[64],"setViewDistinct":[64],"setViewFileReference":[64],"setViewCreatedObject":[64],"setImagePreview":[64],"openImagePreview":[64]},null,{"data":[{"dataChanged":0}],"items":[{"itemsChanged":0}]}],[2,"mrd-field",{"item":[16],"locale":[1],"value":[16],"historyEntries":[32],"currentValue":[32],"multiValues":[32],"multiError":[32]},null,{"value":[{"valueChanged":0}]}],[2,"mrd-memo-container",{"item":[16],"archetype":[16],"parentId":[1,"parent-id"],"containerHref":[1,"container-href"],"containerRelated":[4,"container-related"],"showContainerLink":[4,"show-container-link"],"viewKey":[1,"view-key"],"locale":[1],"labelsListItems":[16],"readOnly":[4,"read-only"],"canCreate":[4,"can-create"],"me":[16],"mode":[32],"dialogOpen":[32],"editingHref":[32],"dialogBody":[32],"dialogTitle":[32],"dialogLabels":[32],"dialogImportant":[32],"dialogTouched":[32],"deleteConfirmOpen":[32],"refresh":[64]},null,{"dialogOpen":[{"dialogOpenChanged":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"],"mayCreate":[4,"may-create"],"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-memo-view",{"archetype":[16],"data":[16],"locale":[1],"labelsListItems":[16]}],[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-longtext-field",{"name":[1],"label":[1],"value":[1],"placeholder":[1],"required":[4],"disabled":[4],"locale":[1],"error":[32]}],[2,"mrd-memo-list",{"item":[16],"archetype":[16],"parentId":[1,"parent-id"],"pageSize":[2,"page-size"],"locale":[1],"readOnly":[4,"read-only"],"labelsListItems":[16],"showContainerLink":[4,"show-container-link"],"rows":[32],"loading":[32],"exhausted":[32],"started":[32],"expandedHrefs":[32],"init":[64],"setPage":[64],"patchRow":[64],"removeRow":[64]}],[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-time-field",{"name":[1],"label":[1],"value":[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"],"canCreate":[4,"can-create"],"activeViewIdx":[32],"loadedPages":[32],"requestedPages":[32],"failedPages":[32],"renderStart":[32],"renderEnd":[32],"colWidths":[32],"resizingCol":[32],"sortField":[32],"sortDir":[32],"activeFilters":[32],"searchOpen":[32],"searchQuery":[32],"openFilterCol":[32],"pendingFilter":[32],"popupPos":[32],"createPickerOpen":[32],"viewPopoverOpen":[32],"scrollTop":[32],"textblockModal":[32],"jsonModal":[32],"aggregations":[32],"aggregationsTotal":[32],"minKnownTotal":[32],"selfCanCreate":[32],"init":[64],"setPage":[64],"setAggregations":[64],"setCanCreate":[64]},null,{"totalElements":[{"totalElementsChanged":0}],"item":[{"itemChanged":0}],"parentId":[{"parentIdChanged":0}]}],[2,"mrd-boolean-field",{"name":[1],"label":[1],"value":[4],"required":[4],"disabled":[4],"locale":[1],"checked":[32]}],[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-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],"autofocus":[4],"error":[32],"editorReady":[32]},null,{"value":[{"valueChanged":0}]}]]]], options);
23
23
  });
24
24
 
25
25
  exports.setNonce = index.setNonce;
@@ -367,6 +367,13 @@ const MrdDocumentContainer = class {
367
367
  * (with a tooltip explaining why) and the embedded table/list get it passed
368
368
  * through so their own create/upload/drag-drop paths are disabled too. */
369
369
  this.readOnly = false;
370
+ /** Whether the current user may create a document here — set by mrd-layout-section from
371
+ * its generic capability check (TASK-0299/FINDING-0155), the same answer the embedded
372
+ * table gets in list mode. Named `mayCreate` (not `canCreate`) to avoid colliding with
373
+ * the existing `canCreate` state below, which tracks something unrelated: whether the
374
+ * folder tree currently has a valid drop target selected. Defaults to false (hidden)
375
+ * until confirmed, same as mrd-table. */
376
+ this.mayCreate = false;
370
377
  /** Active body: folder tree or flat table. */
371
378
  this.mode = 'tree';
372
379
  /** Whether the folder tree currently has a valid target for "New folder". */
@@ -381,7 +388,7 @@ const MrdDocumentContainer = class {
381
388
  };
382
389
  this.pickFile = () => {
383
390
  var _a;
384
- if (this.readOnly)
391
+ if (this.readOnly || !this.mayCreate)
385
392
  return;
386
393
  (_a = this.fileInputEl) === null || _a === void 0 ? void 0 : _a.click();
387
394
  };
@@ -419,7 +426,7 @@ const MrdDocumentContainer = class {
419
426
  }
420
427
  // ── Toolbar ────────────────────────────────────────────────────────────────
421
428
  renderToolbar() {
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" }))))));
429
+ return (index.h("div", { class: "mrd-document-container__toolbar" }, this.mode === 'tree' && this.mayCreate && (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' && this.mayCreate && (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" }))))));
423
430
  }
424
431
  // ── Bodies ───────────────────────────────────────────────────────────────
425
432
  renderTree() {
@@ -450,7 +457,7 @@ const MrdDocumentContainer = class {
450
457
  } }));
451
458
  }
452
459
  renderList() {
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) => {
460
+ 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, canCreate: this.mayCreate, onMrdLoadPage: (e) => {
454
461
  e.stopPropagation();
455
462
  this.mrdLoadPage.emit(e.detail);
456
463
  }, onMrdLoadAggregations: (e) => {
@@ -474,7 +481,7 @@ const MrdDocumentContainer = class {
474
481
  }
475
482
  render() {
476
483
  const treeMode = this.mode === 'tree';
477
- return (index.h(index.Host, { key: '6792d49f08dd19f6c51e4b656df06bbd8bc14f3e' }, this.renderToolbar(), index.h("div", { key: '702f4c288f8c40bd2c5999beb392b9dfd022b0bc', class: {
484
+ return (index.h(index.Host, { key: '4b674a508ac7ddf6af80a40836b72dc65f41c741' }, this.renderToolbar(), index.h("div", { key: '19968916f685a2e3cd075dabf170f67fb104251c', class: {
478
485
  'mrd-document-container__body': true,
479
486
  'mrd-document-container__body--tree': treeMode,
480
487
  }, style: treeMode ? { height: `${this.height}px`, overflowY: 'auto' } : {} }, treeMode ? this.renderTree() : this.renderList())));
@@ -5443,6 +5450,7 @@ const MrdLayoutSection = class {
5443
5450
  this.mrdViewAction = index.createEvent(this, "mrdViewAction");
5444
5451
  this.mrdLoadViewAggregations = index.createEvent(this, "mrdLoadViewAggregations");
5445
5452
  this.mrdLoadViewDistinct = index.createEvent(this, "mrdLoadViewDistinct");
5453
+ this.mrdViewCheckCapabilities = index.createEvent(this, "mrdViewCheckCapabilities");
5446
5454
  this.mrdUpdateObject = index.createEvent(this, "mrdUpdateObject");
5447
5455
  this.mrdDeleteObject = index.createEvent(this, "mrdDeleteObject");
5448
5456
  this.mrdViewUpload = index.createEvent(this, "mrdViewUpload");
@@ -5473,7 +5481,16 @@ const MrdLayoutSection = class {
5473
5481
  this.imagePreviewUrl = null;
5474
5482
  this.imagePreviews = {};
5475
5483
  this.openHistoryField = null;
5484
+ /** Answers to mrdViewCheckCapabilities, keyed by view key — see emitCapabilitiesChecks().
5485
+ * Passed straight down as a `canCreate`/`mayCreate` prop to whichever body (mrd-table,
5486
+ * mrd-memo-container, mrd-document-container) is mounted for that key; a missing entry
5487
+ * means "not answered yet" and is treated as false (hidden), same default as mrd-table's
5488
+ * own standalone behaviour (TASK-0299). */
5489
+ this.canCreateMap = {};
5476
5490
  this.historyClickOutside = null;
5491
+ /** Signature last asked per view key (see emitCapabilitiesChecks()) — avoids re-emitting
5492
+ * mrdViewCheckCapabilities on every data/items update when the binding hasn't changed. */
5493
+ this.capabilitiesAsked = new Map();
5477
5494
  this.searchTimers = {};
5478
5495
  this.handleViewLoadPage = (e, name) => {
5479
5496
  e.stopPropagation();
@@ -5493,6 +5510,10 @@ const MrdLayoutSection = class {
5493
5510
  };
5494
5511
  }
5495
5512
  componentDidLoad() {
5513
+ // No DOM/child-hydration dependency, unlike initEmbeddedTables()/emitLoadImages() below —
5514
+ // run it immediately rather than deferring, so the host's answer (setViewCanCreate) can
5515
+ // land before the child bodies even mount.
5516
+ this.emitCapabilitiesChecks();
5496
5517
  setTimeout(() => {
5497
5518
  this.initEmbeddedTables();
5498
5519
  this.emitLoadImages();
@@ -5511,9 +5532,15 @@ const MrdLayoutSection = class {
5511
5532
  }
5512
5533
  dataChanged(newVal) {
5513
5534
  if (newVal && Object.keys(newVal).length > 0) {
5535
+ this.emitCapabilitiesChecks();
5514
5536
  setTimeout(() => this.initEmbeddedTables(), 0);
5515
5537
  }
5516
5538
  }
5539
+ /** A host can swap `items` (e.g. a different dashboard layout) without `data` changing —
5540
+ * dataChanged() alone would miss that binding change. */
5541
+ itemsChanged() {
5542
+ this.emitCapabilitiesChecks();
5543
+ }
5517
5544
  async initEmbeddedTables() {
5518
5545
  const tables = this.el.querySelectorAll('mrd-table[data-view]');
5519
5546
  for (const table of Array.from(tables)) {
@@ -5541,6 +5568,53 @@ const MrdLayoutSection = class {
5541
5568
  }
5542
5569
  }
5543
5570
  }
5571
+ /** Parent record id extracted from `data._links.self.href` — the same value every
5572
+ * VIEW/RELATED_VIEW item on this record shares, used for RELATED_VIEW path construction
5573
+ * (renderRelatedView) and capability checks (emitCapabilitiesChecks). */
5574
+ computeParentId() {
5575
+ var _a, _b, _c, _d, _e;
5576
+ const selfHref = (_d = (_c = (_b = (_a = this.data) === null || _a === void 0 ? void 0 : _a._links) === null || _b === void 0 ? void 0 : _b.self) === null || _c === void 0 ? void 0 : _c.href) !== null && _d !== void 0 ? _d : '';
5577
+ return (_e = selfHref.split('/').filter(Boolean).pop()) !== null && _e !== void 0 ? _e : '';
5578
+ }
5579
+ /** Asks, once per VIEW/RELATED_VIEW binding, whether the current user may create a record
5580
+ * there — the single generic place for this check (TASK-0299/FINDING-0155), so mrd-table,
5581
+ * mrd-memo-container and mrd-document-container all get the answer the same way: as a plain
5582
+ * `canCreate`/`mayCreate` prop from this component, computed here and handed down in
5583
+ * renderTable()/renderMemoContainer()/renderDocumentContainer() — none of the three leaf
5584
+ * components need to ask on their own when rendered through mrd-layout-section (mrd-table's
5585
+ * own self-ask only kicks in for standalone use, i.e. its `canCreate` prop left undefined).
5586
+ *
5587
+ * The route/path variables mirror what each renderer already uses for its own rows —
5588
+ * `type` = `dataClass`, `refType`/`refId` = `fromClass`/parentId for a RELATED_VIEW, and
5589
+ * `filterClass` when the view is scoped to one subtype (the same value sent as `?type=` on
5590
+ * the row fetch). A signature (not just the key) is tracked per binding so a genuine route
5591
+ * change re-asks and hides again, without re-asking on every unrelated data/items update. */
5592
+ emitCapabilitiesChecks() {
5593
+ var _a, _b, _c, _d;
5594
+ const parentId = this.computeParentId();
5595
+ for (const item of flattenItems(this.items)) {
5596
+ if (item.type !== clientLayout.ClientLayoutItemType.VIEW && item.type !== clientLayout.ClientLayoutItemType.RELATED_VIEW)
5597
+ continue;
5598
+ const key = viewKeyFor(item);
5599
+ if (!key || !item.view)
5600
+ continue;
5601
+ const isRelatedView = item.type === clientLayout.ClientLayoutItemType.RELATED_VIEW;
5602
+ const type = (_b = (_a = item.dataClass) !== null && _a !== void 0 ? _a : item.relatedClass) !== null && _b !== void 0 ? _b : key;
5603
+ const refType = isRelatedView ? ((_c = item.fromClass) !== null && _c !== void 0 ? _c : '') : undefined;
5604
+ const refId = isRelatedView ? parentId : undefined;
5605
+ const filterClass = (_d = item.filterClass) !== null && _d !== void 0 ? _d : undefined;
5606
+ const signature = JSON.stringify([type, refType, refId, filterClass]);
5607
+ if (this.capabilitiesAsked.get(key) === signature)
5608
+ continue;
5609
+ this.capabilitiesAsked.set(key, signature);
5610
+ if (key in this.canCreateMap) {
5611
+ const next = Object.assign({}, this.canCreateMap);
5612
+ delete next[key];
5613
+ this.canCreateMap = next;
5614
+ }
5615
+ this.mrdViewCheckCapabilities.emit(Object.assign(Object.assign({ name: key, type }, (refType !== undefined ? { refType, refId } : {})), (filterClass ? { filterClass } : {})));
5616
+ }
5617
+ }
5544
5618
  /** Inject search results. Pass dataClass to target a specific SEARCH item; omit when there is only one. */
5545
5619
  async setSearchResults(results, dataClass) {
5546
5620
  const key = dataClass !== null && dataClass !== void 0 ? dataClass : this.resolveSearchKey();
@@ -5582,6 +5656,14 @@ const MrdLayoutSection = class {
5582
5656
  return;
5583
5657
  await table.setAggregations(data);
5584
5658
  }
5659
+ /** Host answer to mrdViewCheckCapabilities — whether the current user may create a record
5660
+ * for the given view's bound route. `name` is the view key from the event detail. Stored in
5661
+ * canCreateMap and passed down as a plain prop to whichever body is mounted for that key
5662
+ * (mrd-table, mrd-memo-container or mrd-document-container) — no DOM lookup needed, unlike
5663
+ * setViewPage/setViewAggregations, since the prop flows through the next render. */
5664
+ async setViewCanCreate(name, value) {
5665
+ this.canCreateMap = Object.assign(Object.assign({}, this.canCreateMap), { [name]: value });
5666
+ }
5585
5667
  /** Inject distinct values into an embedded mrd-document-list for a document view. */
5586
5668
  async setViewDistinct(name, nodeId, values) {
5587
5669
  const list = this.el.querySelector(`mrd-document-list[data-doclist="${name}"]`);
@@ -5669,20 +5751,19 @@ const MrdLayoutSection = class {
5669
5751
  return (index.h("div", { class: "mrd-layout-section__search", key: `search-${dataClass}` }, index.h("div", { class: "mrd-layout-section__search-wrap" }, index.h("svg", { class: "mrd-layout-section__search-icon", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 20 20", fill: "currentColor", "aria-hidden": "true" }, index.h("path", { "fill-rule": "evenodd", d: "M9 3.5a5.5 5.5 0 100 11 5.5 5.5 0 000-11zM2 9a7 7 0 1112.452 4.391l3.328 3.329a.75.75 0 11-1.06 1.06l-3.329-3.328A7 7 0 012 9z", "clip-rule": "evenodd" })), index.h("input", { class: "mrd-layout-section__search-input", type: "text", value: query, placeholder: (_c = item.label) !== null && _c !== void 0 ? _c : '', onInput: e => this.handleSearchInput(dataClass, e.target.value) })), results.length > 0 && (index.h("ul", { class: "mrd-layout-section__search-results" }, results.map(r => (index.h("li", { key: r.id, class: "mrd-layout-section__search-result" }, index.h("button", { class: "mrd-layout-section__search-result-btn", onClick: () => this.mrdNavigate.emit({ href: r.id, label: r.label }) }, index.h("span", { class: "mrd-layout-section__search-result-label" }, r.label), r.description && index.h("span", { class: "mrd-layout-section__search-result-desc" }, r.description)))))))));
5670
5752
  }
5671
5753
  renderRelatedView(item) {
5672
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
5754
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
5673
5755
  const key = viewKeyFor(item);
5674
5756
  if (!key)
5675
5757
  return null;
5676
5758
  if (!item.view)
5677
5759
  return null;
5678
5760
  const showTitle = (_a = item.showTitle) !== null && _a !== void 0 ? _a : false;
5679
- // Extract parentId from data._links.self.href for RELATED_VIEW path construction
5680
5761
  const selfHref = (_e = (_d = (_c = (_b = this.data) === null || _b === void 0 ? void 0 : _b._links) === null || _c === void 0 ? void 0 : _c.self) === null || _d === void 0 ? void 0 : _d.href) !== null && _e !== void 0 ? _e : '';
5681
- const parentId = (_f = selfHref.split('/').filter(Boolean).pop()) !== null && _f !== void 0 ? _f : '';
5762
+ const parentId = this.computeParentId();
5682
5763
  // The API publishes `archetypes` on the VIEW/RELATED_VIEW item itself
5683
5764
  // (sibling of `view`), not inside `view`.
5684
- const docArchetype = clientLayout.resolveArchetype((_g = item.archetypes) !== null && _g !== void 0 ? _g : (_h = item.view) === null || _h === void 0 ? void 0 : _h.archetypes, clientLayout.ARCHETYPE_DOCUMENT);
5685
- const memoArchetype = !docArchetype ? clientLayout.resolveArchetype((_j = item.archetypes) !== null && _j !== void 0 ? _j : (_k = item.view) === null || _k === void 0 ? void 0 : _k.archetypes, clientLayout.ARCHETYPE_MEMO) : undefined;
5765
+ const docArchetype = clientLayout.resolveArchetype((_f = item.archetypes) !== null && _f !== void 0 ? _f : (_g = item.view) === null || _g === void 0 ? void 0 : _g.archetypes, clientLayout.ARCHETYPE_DOCUMENT);
5766
+ const memoArchetype = !docArchetype ? clientLayout.resolveArchetype((_h = item.archetypes) !== null && _h !== void 0 ? _h : (_j = item.view) === null || _j === void 0 ? void 0 : _j.archetypes, clientLayout.ARCHETYPE_MEMO) : undefined;
5686
5767
  // Canonical parent href for single-container seeding: use the RELATED_VIEW's
5687
5768
  // fromClass (base class) rather than the route class, so polymorphic subtypes
5688
5769
  // resolve to the same container the documents actually reference.
@@ -5693,7 +5774,7 @@ const MrdLayoutSection = class {
5693
5774
  // back to this parent; only when it matches the container slot does the
5694
5775
  // parent's own href double as the memo's container.
5695
5776
  const memoContainerRelated = item.type !== clientLayout.ClientLayoutItemType.RELATED_VIEW
5696
- || item.inverseRelation === ((_l = memoArchetype === null || memoArchetype === void 0 ? void 0 : memoArchetype.slots) === null || _l === void 0 ? void 0 : _l.container);
5777
+ || item.inverseRelation === ((_k = memoArchetype === null || memoArchetype === void 0 ? void 0 : memoArchetype.slots) === null || _k === void 0 ? void 0 : _k.container);
5697
5778
  const memoContainerHref = memoContainerRelated ? containerHref : '';
5698
5779
  // Distinct from memoContainerRelated: only a genuine container-scoped
5699
5780
  // RELATED_VIEW (a company's own memo tab) makes every card's container
@@ -5706,7 +5787,8 @@ const MrdLayoutSection = class {
5706
5787
  * swaps between the folder tree and the flat table. Events are re-emitted to
5707
5788
  * the host with the view key, exactly as the raw list/table events were. */
5708
5789
  renderDocumentContainer(item, key, parentId, archetype, containerHref) {
5709
- return (index.h("mrd-document-container", { item: item, archetype: archetype, parentId: parentId, containerHref: containerHref, viewKey: key, locale: this.locale, readOnly: this.readOnly, onMrdLoadDistinct: (e) => {
5790
+ var _a;
5791
+ return (index.h("mrd-document-container", { item: item, archetype: archetype, parentId: parentId, containerHref: containerHref, viewKey: key, locale: this.locale, readOnly: this.readOnly, mayCreate: (_a = this.canCreateMap[key]) !== null && _a !== void 0 ? _a : false, onMrdLoadDistinct: (e) => {
5710
5792
  e.stopPropagation();
5711
5793
  this.mrdLoadViewDistinct.emit(Object.assign({ name: key }, e.detail));
5712
5794
  }, onMrdLoadPage: (e) => {
@@ -5741,9 +5823,9 @@ const MrdLayoutSection = class {
5741
5823
  /** Memo collection view: owns the view-switch + "New memo" and swaps between
5742
5824
  * the card list and the flat table, mirroring renderDocumentContainer(). */
5743
5825
  renderMemoContainer(item, key, parentId, archetype, containerHref, containerRelated, showContainerLink) {
5744
- var _a, _b, _c, _d;
5826
+ var _a, _b, _c, _d, _e;
5745
5827
  const labelsListItems = (_d = (_c = (_b = (_a = item.view) === null || _a === void 0 ? void 0 : _a.values) === null || _b === void 0 ? void 0 : _b.find(v => { var _a; return v.name === ((_a = archetype.slots) === null || _a === void 0 ? void 0 : _a.labels); })) === null || _c === void 0 ? void 0 : _c.listItems) !== null && _d !== void 0 ? _d : null;
5746
- return (index.h("mrd-memo-container", { "data-view": key, item: item, archetype: archetype, parentId: parentId, containerHref: containerHref, containerRelated: containerRelated, showContainerLink: showContainerLink, viewKey: key, locale: this.locale, readOnly: this.readOnly, me: this.me, labelsListItems: labelsListItems, onMrdNavigate: (e) => {
5828
+ return (index.h("mrd-memo-container", { "data-view": key, item: item, archetype: archetype, parentId: parentId, containerHref: containerHref, containerRelated: containerRelated, showContainerLink: showContainerLink, viewKey: key, locale: this.locale, readOnly: this.readOnly, canCreate: (_e = this.canCreateMap[key]) !== null && _e !== void 0 ? _e : false, me: this.me, labelsListItems: labelsListItems, onMrdNavigate: (e) => {
5747
5829
  var _a;
5748
5830
  e.stopPropagation();
5749
5831
  this.mrdNavigate.emit(Object.assign(Object.assign({}, e.detail), { navigateBehaviour: (_a = item.navigateBehaviour) !== null && _a !== void 0 ? _a : clientLayout.ClientLayoutNavigateBehaviour.PAGE }));
@@ -5770,7 +5852,8 @@ const MrdLayoutSection = class {
5770
5852
  } }));
5771
5853
  }
5772
5854
  renderTable(item, key, parentId) {
5773
- 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) => {
5855
+ var _a;
5856
+ return (index.h("mrd-table", { "data-view": key, item: item, parentId: parentId, locale: this.locale, readOnly: this.readOnly, canCreate: (_a = this.canCreateMap[key]) !== null && _a !== void 0 ? _a : false, onMrdLoadPage: (e) => this.handleViewLoadPage(e, key), onMrdLoadAggregations: (e) => {
5774
5857
  var _a;
5775
5858
  e.stopPropagation();
5776
5859
  this.mrdLoadViewAggregations.emit(Object.assign({ name: key, dataClass: (_a = item.dataClass) !== null && _a !== void 0 ? _a : key }, e.detail));
@@ -5908,12 +5991,15 @@ const MrdLayoutSection = class {
5908
5991
  const emailArchetype = !docArchetype && !invoiceArchetype ? clientLayout.resolveArchetype(this.archetypes, clientLayout.ARCHETYPE_EMAIL) : undefined;
5909
5992
  const memoArchetype = !docArchetype && !invoiceArchetype && !emailArchetype ? clientLayout.resolveArchetype(this.archetypes, clientLayout.ARCHETYPE_MEMO) : undefined;
5910
5993
  const anyArchetype = docArchetype || invoiceArchetype || emailArchetype || memoArchetype;
5911
- return (index.h(index.Host, { key: '057d145da172e68f84b6ff34f71ae649d6d6bf92' }, index.h("div", { key: 'e03a1761dc6bcd9ff54b264fee56130270bddc2f', class: "mrd-layout-section" }, docArchetype && this.renderDocumentObject(docArchetype), invoiceArchetype && this.renderInvoiceObject(invoiceArchetype), emailArchetype && this.renderEmailObject(emailArchetype), memoArchetype && this.renderMemoObject(memoArchetype), !anyArchetype && this.items.map((item, i) => this.renderItem(item, this.items, i))), this.renderImageModal()));
5994
+ return (index.h(index.Host, { key: '508ca481c777d65d1739f7b5f30f5f3ad8722655' }, index.h("div", { key: 'c02630235a2a21511b391ff7b5bebeca1bcc6903', class: "mrd-layout-section" }, docArchetype && this.renderDocumentObject(docArchetype), invoiceArchetype && this.renderInvoiceObject(invoiceArchetype), emailArchetype && this.renderEmailObject(emailArchetype), memoArchetype && this.renderMemoObject(memoArchetype), !anyArchetype && this.items.map((item, i) => this.renderItem(item, this.items, i))), this.renderImageModal()));
5912
5995
  }
5913
5996
  get el() { return index.getElement(this); }
5914
5997
  static get watchers() { return {
5915
5998
  "data": [{
5916
5999
  "dataChanged": 0
6000
+ }],
6001
+ "items": [{
6002
+ "itemsChanged": 0
5917
6003
  }]
5918
6004
  }; }
5919
6005
  };
@@ -6075,6 +6161,10 @@ const MrdMemoContainer = class {
6075
6161
  * tooltip, cards/rows are not clickable, and the embedded table's own
6076
6162
  * create action is disabled too. */
6077
6163
  this.readOnly = false;
6164
+ /** Whether the current user may create a memo here — set by mrd-layout-section from its
6165
+ * generic capability check (TASK-0299/FINDING-0155), the same answer the embedded table
6166
+ * gets in table mode. Defaults to false (hidden) until confirmed, same as mrd-table. */
6167
+ this.canCreate = false;
6078
6168
  /** The active account's linked person record (userProfile.links.person), if any.
6079
6169
  * Used both to gate "New memo" (see effectiveContainerHref) and, on submit, to
6080
6170
  * fill the author slot. */
@@ -6307,7 +6397,7 @@ const MrdMemoContainer = class {
6307
6397
  * the dialog), so without it there is nothing valid to create — regardless
6308
6398
  * of whether a parent record already supplies a container. */
6309
6399
  get canAdd() {
6310
- return !this.readOnly && !!this.meHref() && !!this.effectiveContainerHref;
6400
+ return this.canCreate && !this.readOnly && !!this.meHref() && !!this.effectiveContainerHref;
6311
6401
  }
6312
6402
  /** Path for creating a new memo: `/{dataClass}` for a top-level VIEW, or
6313
6403
  * `/{fromClass}/{parentId}/{dataClass}` when nested under a parent record. */
@@ -6321,7 +6411,7 @@ const MrdMemoContainer = class {
6321
6411
  });
6322
6412
  }
6323
6413
  renderToolbar() {
6324
- return (index.h("div", { class: "mrd-memo-container__toolbar" }, this.mode === 'cards' && (index.h("button", { type: "button", class: "mrd-memo-container__action", disabled: !this.canAdd, title: this.readOnly ? cellRenderer.t('readonly_access', this.locale) : undefined, onClick: this.openCreate }, 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 5v14M5 12h14" })), cellRenderer.t('memo_new', this.locale))), index.h("div", { class: "mrd-memo-container__seg", role: "group", "aria-label": cellRenderer.t('doc_view_switch', this.locale) }, index.h("button", { class: "mrd-memo-container__seg-btn", "aria-pressed": String(this.mode === 'cards'), title: cellRenderer.t('memo_view_cards', this.locale), "aria-label": cellRenderer.t('memo_view_cards', this.locale), onClick: () => this.setMode('cards') }, 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("rect", { x: "3", y: "4", width: "7", height: "7", rx: "1" }), index.h("rect", { x: "14", y: "4", width: "7", height: "7", rx: "1" }), index.h("rect", { x: "3", y: "15", width: "7", height: "5", rx: "1" }), index.h("rect", { x: "14", y: "15", width: "7", height: "5", rx: "1" }))), index.h("button", { class: "mrd-memo-container__seg-btn", "aria-pressed": String(this.mode === 'table'), title: cellRenderer.t('memo_view_table', this.locale), "aria-label": cellRenderer.t('memo_view_table', this.locale), onClick: () => this.setMode('table') }, 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" }))))));
6414
+ return (index.h("div", { class: "mrd-memo-container__toolbar" }, this.mode === 'cards' && this.canCreate && (index.h("button", { type: "button", class: "mrd-memo-container__action", disabled: !this.canAdd, title: this.readOnly ? cellRenderer.t('readonly_access', this.locale) : undefined, onClick: this.openCreate }, 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 5v14M5 12h14" })), cellRenderer.t('memo_new', this.locale))), index.h("div", { class: "mrd-memo-container__seg", role: "group", "aria-label": cellRenderer.t('doc_view_switch', this.locale) }, index.h("button", { class: "mrd-memo-container__seg-btn", "aria-pressed": String(this.mode === 'cards'), title: cellRenderer.t('memo_view_cards', this.locale), "aria-label": cellRenderer.t('memo_view_cards', this.locale), onClick: () => this.setMode('cards') }, 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("rect", { x: "3", y: "4", width: "7", height: "7", rx: "1" }), index.h("rect", { x: "14", y: "4", width: "7", height: "7", rx: "1" }), index.h("rect", { x: "3", y: "15", width: "7", height: "5", rx: "1" }), index.h("rect", { x: "14", y: "15", width: "7", height: "5", rx: "1" }))), index.h("button", { class: "mrd-memo-container__seg-btn", "aria-pressed": String(this.mode === 'table'), title: cellRenderer.t('memo_view_table', this.locale), "aria-label": cellRenderer.t('memo_view_table', this.locale), onClick: () => this.setMode('table') }, 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" }))))));
6325
6415
  }
6326
6416
  renderDeleteConfirm() {
6327
6417
  return (index.h("div", null, index.h("h2", { class: "mrd-memo-container__modal-title" }, cellRenderer.t('memo_delete_confirm_title', this.locale)), index.h("p", { class: "mrd-memo-container__modal-warning" }, cellRenderer.t('memo_delete_confirm_body', this.locale)), index.h("div", { class: "mrd-memo-container__modal-actions" }, index.h("button", { type: "button", class: "mrd-memo-container__modal-cancel", onClick: this.cancelDeleteConfirm }, cellRenderer.t('cancel', this.locale)), index.h("button", { type: "button", class: "mrd-memo-container__modal-delete-confirm", onClick: this.confirmDelete }, cellRenderer.t('delete', this.locale)))));
@@ -6358,7 +6448,7 @@ const MrdMemoContainer = class {
6358
6448
  } }));
6359
6449
  }
6360
6450
  renderTable() {
6361
- 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) => {
6451
+ 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, canCreate: this.canCreate, onMrdLoadPage: (e) => {
6362
6452
  e.stopPropagation();
6363
6453
  this.mrdLoadPage.emit(e.detail);
6364
6454
  }, onMrdLoadAggregations: (e) => {
@@ -6373,7 +6463,7 @@ const MrdMemoContainer = class {
6373
6463
  } }));
6374
6464
  }
6375
6465
  render() {
6376
- return (index.h(index.Host, { key: 'a000221db6b1ba12351f38619f319b277b791f68' }, this.renderToolbar(), index.h("div", { key: '712951c8e391ed693bf6e4263c4f1076172b0451', class: "mrd-memo-container__body" }, this.mode === 'cards' ? this.renderCards() : this.renderTable()), this.renderDialog()));
6466
+ return (index.h(index.Host, { key: 'b0479aad6dc49935442183fcbdf30c07c2c490ff' }, this.renderToolbar(), index.h("div", { key: '40d0fb882186001ad4984c1ba64c5a5c529f4d76', class: "mrd-memo-container__body" }, this.mode === 'cards' ? this.renderCards() : this.renderTable()), this.renderDialog()));
6377
6467
  }
6378
6468
  static get watchers() { return {
6379
6469
  "dialogOpen": [{
@@ -7505,6 +7595,7 @@ const MrdTable = class {
7505
7595
  this.mrdAction = index.createEvent(this, "mrdAction");
7506
7596
  this.mrdDownload = index.createEvent(this, "mrdDownload");
7507
7597
  this.mrdLoadAggregations = index.createEvent(this, "mrdLoadAggregations");
7598
+ this.mrdCheckCapabilities = index.createEvent(this, "mrdCheckCapabilities");
7508
7599
  // ── Non-state internals ────────────────────────────────────────────────────
7509
7600
  this.pendingPages = new Set();
7510
7601
  this.debounceTimer = null;
@@ -7610,6 +7701,10 @@ const MrdTable = class {
7610
7701
  this.aggregationsPending = false;
7611
7702
  /** Lower bound on total derived from setPage() hasNext info; grows as pages load. */
7612
7703
  this.minKnownTotal = 0;
7704
+ /** Self-asked answer for standalone use (the `canCreate` prop is undefined) — defaults to
7705
+ * hidden (TASK-0299) until the host answers mrdCheckCapabilities via setCanCreate(). Ignored
7706
+ * when the host controls `canCreate` directly; see effectiveCanCreate(). */
7707
+ this.selfCanCreate = false;
7613
7708
  this.handleScroll = (e) => {
7614
7709
  const scroller = e.currentTarget;
7615
7710
  const { renderStart, renderEnd } = computeWindow(scroller.scrollTop, this.rowHeight, this.tableHeight, this.baseTotal);
@@ -7644,6 +7739,14 @@ const MrdTable = class {
7644
7739
  this.searchOpen = false;
7645
7740
  this.searchQuery = '';
7646
7741
  this.stashedFilters = null;
7742
+ this.emitCapabilitiesCheck();
7743
+ }
7744
+ /** A parent-record navigation can reuse the same `item` reference while only `parentId`
7745
+ * changes (e.g. clicking a different dossier for the same RELATED_VIEW layout) — itemChanged()
7746
+ * would not fire for that. Re-ask so a stale canCreate answer from the previous parent never
7747
+ * leaks into the new one. */
7748
+ parentIdChanged() {
7749
+ this.emitCapabilitiesCheck();
7647
7750
  }
7648
7751
  // ── Lifecycle ──────────────────────────────────────────────────────────────
7649
7752
  componentWillLoad() {
@@ -7651,6 +7754,7 @@ const MrdTable = class {
7651
7754
  this.applyDefaultSort((_c = (_b = (_a = this.item) === null || _a === void 0 ? void 0 : _a.view) === null || _b === void 0 ? void 0 : _b.defaultSort) !== null && _c !== void 0 ? _c : '');
7652
7755
  }
7653
7756
  componentDidLoad() {
7757
+ this.emitCapabilitiesCheck();
7654
7758
  this.staleCheckTimer = setInterval(() => this.checkStalePages(), STALE_CHECK_INTERVAL_MS);
7655
7759
  // A table inside a hidden tab pane renders and loads page 0 without ever having a box, so
7656
7760
  // the width freeze cannot measure anything. ResizeObserver fires the moment the pane is
@@ -7769,6 +7873,14 @@ const MrdTable = class {
7769
7873
  // Fresh totals can be wider than the ones the columns were checked against.
7770
7874
  this.fixedContentMeasured = false;
7771
7875
  }
7876
+ /** Host answer to mrdCheckCapabilities — whether the current user may create a record for
7877
+ * the table's currently bound route (standalone use only; ignored while the `canCreate`
7878
+ * prop is set, since the host controls it directly in that mode). Call it any time after
7879
+ * the event fires; a stale answer for an old binding is discarded automatically
7880
+ * (selfCanCreate is reset to false before every new mrdCheckCapabilities emission). */
7881
+ async setCanCreate(value) {
7882
+ this.selfCanCreate = value;
7883
+ }
7772
7884
  // ── Lifecycle ──────────────────────────────────────────────────────────────
7773
7885
  disconnectedCallback() {
7774
7886
  if (this.resizeObserver) {
@@ -8128,6 +8240,22 @@ const MrdTable = class {
8128
8240
  dataClass: v.dataClass,
8129
8241
  });
8130
8242
  }
8243
+ /** Asks the host whether creating is allowed for the table's current binding (item, parent
8244
+ * and active view) — only in standalone use (`canCreate` prop undefined). A host that
8245
+ * controls `canCreate` directly already knows the answer, so the table never asks on its
8246
+ * own in that mode. Resets selfCanCreate to false first so the add button stays hidden for
8247
+ * the new binding until the host answers — it never inherits the previous binding's answer. */
8248
+ emitCapabilitiesCheck() {
8249
+ var _a, _b;
8250
+ if (this.canCreate !== undefined)
8251
+ return;
8252
+ this.selfCanCreate = false;
8253
+ const v = this.allViews[this.activeViewIdx];
8254
+ if (!(v === null || v === void 0 ? void 0 : v.dataClass))
8255
+ return;
8256
+ const isRelatedView = ((_a = this.item) === null || _a === void 0 ? void 0 : _a.type) === 'RELATED_VIEW';
8257
+ this.mrdCheckCapabilities.emit(Object.assign(Object.assign({ type: v.dataClass }, (isRelatedView ? { refType: (_b = v.fromClass) !== null && _b !== void 0 ? _b : '', refId: this.parentId } : {})), (v.filterClass ? { filterClass: v.filterClass } : {})));
8258
+ }
8131
8259
  /** Build query params for a page request from current sort, view filters, filterClass and active column filters.
8132
8260
  *
8133
8261
  * `q` and column filters are mutually exclusive on the backend — combining them breaks
@@ -8162,11 +8290,17 @@ const MrdTable = class {
8162
8290
  var _a, _b, _c;
8163
8291
  return ((_c = (_b = (_a = this.allViews[this.activeViewIdx]) === null || _a === void 0 ? void 0 : _a.view) === null || _b === void 0 ? void 0 : _b.values) !== null && _c !== void 0 ? _c : []);
8164
8292
  }
8293
+ /** `canCreate` when the host controls it directly, else the table's own self-asked answer. */
8294
+ get effectiveCanCreate() {
8295
+ return this.canCreate !== undefined ? this.canCreate : this.selfCanCreate;
8296
+ }
8165
8297
  get tableActions() {
8166
8298
  var _a, _b;
8167
8299
  const raw = (_b = (_a = this.item) === null || _a === void 0 ? void 0 : _a.actions) !== null && _b !== void 0 ? _b : [];
8168
8300
  return (raw !== null && raw !== void 0 ? raw : []).reduce((acc, a) => {
8169
- if (a === 'NEW')
8301
+ // Hidden (not just disabled) until creating is confirmed allowed for this binding —
8302
+ // see effectiveCanCreate() / emitCapabilitiesCheck() (TASK-0299).
8303
+ if (a === 'NEW' && this.effectiveCanCreate)
8170
8304
  acc.push({ action: 'create', label: cellRenderer.t('table_new_record', this.locale), icon: 'assets/sprites.svg#icon-plus', variant: 'primary', disabled: this.readOnly });
8171
8305
  if (a === 'EXPORT')
8172
8306
  acc.push({ action: 'export', label: cellRenderer.t('table_export_excel', this.locale), icon: 'assets/sprites.svg#icon-file-excel' });
@@ -8574,6 +8708,7 @@ const MrdTable = class {
8574
8708
  this.searchOpen = false;
8575
8709
  this.searchQuery = '';
8576
8710
  this.stashedFilters = null;
8711
+ this.emitCapabilitiesCheck();
8577
8712
  this.init();
8578
8713
  }
8579
8714
  toggleViewPopover(e) {
@@ -8751,6 +8886,9 @@ const MrdTable = class {
8751
8886
  }],
8752
8887
  "item": [{
8753
8888
  "itemChanged": 0
8889
+ }],
8890
+ "parentId": [{
8891
+ "parentIdChanged": 0
8754
8892
  }]
8755
8893
  }; }
8756
8894
  };
@@ -2,6 +2,7 @@
2
2
  "entries": [
3
3
  "components/documents/mrd-document-container/mrd-document-container.js",
4
4
  "components/documents/mrd-document-list/mrd-document-list.js",
5
+ "components/table/mrd-table/mrd-table.js",
5
6
  "components/documents/mrd-document-view/mrd-document-view.js",
6
7
  "components/email/mrd-email-view/mrd-email-view.js",
7
8
  "components/fields/mrd-boolean-field/mrd-boolean-field.js",
@@ -27,8 +28,7 @@
27
28
  "components/memo/mrd-memo-container/mrd-memo-container.js",
28
29
  "components/memo/mrd-memo-list/mrd-memo-list.js",
29
30
  "components/memo/mrd-memo-view/mrd-memo-view.js",
30
- "components/merge/mrd-merge-view/mrd-merge-view.js",
31
- "components/table/mrd-table/mrd-table.js"
31
+ "components/merge/mrd-merge-view/mrd-merge-view.js"
32
32
  ],
33
33
  "mixins": [],
34
34
  "compiler": {