@mmlogic/components 0.3.10 → 0.3.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/mosterdcomponents.cjs.js +1 -1
- package/dist/cjs/mrd-boolean-field_23.cjs.entry.js +103 -15
- package/dist/collection/components/mrd-document-container/mrd-document-container.js +48 -2
- package/dist/collection/components/mrd-document-list/mrd-document-list.js +95 -9
- package/dist/collection/components/mrd-document-list/mrd-document-list.scss +11 -0
- package/dist/collection/components/mrd-layout-section/mrd-layout-section.js +19 -4
- package/dist/collection/utils/i18n.js +2 -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/esm/loader.js +1 -1
- package/dist/esm/mosterdcomponents.js +1 -1
- package/dist/esm/mrd-boolean-field_23.entry.js +103 -15
- package/dist/mosterdcomponents/mosterdcomponents.esm.js +1 -1
- package/dist/mosterdcomponents/p-a9618055.entry.js +1 -0
- package/dist/types/components/mrd-document-container/mrd-document-container.d.ts +5 -0
- package/dist/types/components/mrd-document-list/mrd-document-list.d.ts +24 -1
- package/dist/types/components/mrd-layout-section/mrd-layout-section.d.ts +3 -0
- package/dist/types/components.d.ts +33 -0
- package/dist/types/types/client-layout.d.ts +5 -0
- package/package.json +1 -1
- package/dist/mosterdcomponents/cell-renderer-B-AJDBcj.js.map +0 -1
- package/dist/mosterdcomponents/client-layout-ChqRA3AF.js.map +0 -1
- package/dist/mosterdcomponents/format-BAfsQfy1.js.map +0 -1
- package/dist/mosterdcomponents/i18n-s1XrKcD2.js.map +0 -1
- package/dist/mosterdcomponents/index-DkY-NQj0.js.map +0 -1
- package/dist/mosterdcomponents/index-DwF_Sp__.js.map +0 -1
- package/dist/mosterdcomponents/index.esm.js.map +0 -1
- package/dist/mosterdcomponents/mosterdcomponents.esm.js.map +0 -1
- package/dist/mosterdcomponents/p-69452249.entry.js +0 -1
- package/dist/mosterdcomponents/quill-C9pgw_k-.js.map +0 -1
- package/dist/mosterdcomponents/validation-Br9k2Ztw.js.map +0 -1
|
@@ -103,6 +103,7 @@ const translations = {
|
|
|
103
103
|
folder_name_placeholder: 'Foldernaam',
|
|
104
104
|
folder_no_slash: "Een foldernaam mag geen '/' bevatten",
|
|
105
105
|
folder_duplicate: 'Er bestaat al een folder met deze naam',
|
|
106
|
+
doc_empty_drop: 'Nog geen documenten — sleep bestanden hierheen',
|
|
106
107
|
},
|
|
107
108
|
en: {
|
|
108
109
|
required: 'This field is required',
|
|
@@ -174,6 +175,7 @@ const translations = {
|
|
|
174
175
|
folder_name_placeholder: 'Folder name',
|
|
175
176
|
folder_no_slash: "A folder name cannot contain '/'",
|
|
176
177
|
folder_duplicate: 'A folder with this name already exists',
|
|
178
|
+
doc_empty_drop: 'No documents yet — drop files here',
|
|
177
179
|
},
|
|
178
180
|
ar: {
|
|
179
181
|
required: 'هذا الحقل مطلوب',
|
|
@@ -879,8 +881,13 @@ const MrdDocumentContainer = class {
|
|
|
879
881
|
this.item = null;
|
|
880
882
|
/** Parent record id — required for RELATED_VIEW path building. */
|
|
881
883
|
this.parentId = '';
|
|
884
|
+
/** Canonical parent href, forwarded to the folder tree for single-container seeding. */
|
|
885
|
+
this.containerHref = '';
|
|
882
886
|
/** Lookup key used for the embedded `data-doclist` / `data-view` attributes. */
|
|
883
887
|
this.viewKey = '';
|
|
888
|
+
/** Fixed height (px) of the scrolling folder-tree body — the toolbar stays put
|
|
889
|
+
* on top, Finder-style. The table manages its own height. */
|
|
890
|
+
this.height = 460;
|
|
884
891
|
this.locale = navigator.language;
|
|
885
892
|
/** Active body: folder tree or flat table. */
|
|
886
893
|
this.mode = 'tree';
|
|
@@ -920,7 +927,7 @@ const MrdDocumentContainer = class {
|
|
|
920
927
|
}
|
|
921
928
|
// ── Bodies ───────────────────────────────────────────────────────────────
|
|
922
929
|
renderTree() {
|
|
923
|
-
return (h("mrd-document-list", { "data-doclist": this.viewKey, ref: el => (this.listEl = el), item: this.item, archetype: this.archetype, parentId: this.parentId, locale: this.locale, onMrdLoadDistinct: (e) => {
|
|
930
|
+
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) => {
|
|
924
931
|
e.stopPropagation();
|
|
925
932
|
this.mrdLoadDistinct.emit(e.detail);
|
|
926
933
|
}, onMrdLoadPage: (e) => {
|
|
@@ -961,13 +968,14 @@ const MrdDocumentContainer = class {
|
|
|
961
968
|
} }));
|
|
962
969
|
}
|
|
963
970
|
render() {
|
|
964
|
-
|
|
971
|
+
const treeMode = this.mode === 'tree';
|
|
972
|
+
return (h(Host, { key: '5d8a9a9bb4f1126a304b796aff9d1cb0100b8fc6' }, this.renderToolbar(), h("div", { key: '80ac7e5dd39ffcc4161059447221045a6e035099', class: "mrd-document-container__body", style: treeMode ? { height: `${this.height}px`, overflowY: 'auto' } : {} }, treeMode ? this.renderTree() : this.renderList())));
|
|
965
973
|
}
|
|
966
974
|
get el() { return getElement(this); }
|
|
967
975
|
};
|
|
968
976
|
MrdDocumentContainer.style = mrdDocumentContainerScss();
|
|
969
977
|
|
|
970
|
-
const mrdDocumentListScss = () => `.sc-mrd-document-list-h{display:block}.mrd-document-list.sc-mrd-document-list{padding:var(--mrd-space-2) 0}.mrd-document-list__row.sc-mrd-document-list{display:flex;align-items:center;gap:var(--mrd-space-2);height:2.125rem;padding:0 var(--mrd-space-4);cursor:pointer;user-select:none;font-size:var(--mrd-font-size-sm);color:var(--mrd-color-neutral-800)}.mrd-document-list__row.sc-mrd-document-list:hover{background:var(--mrd-color-neutral-50)}.mrd-document-list__row--selected.sc-mrd-document-list{background:var(--mrd-color-primary-50, rgba(22, 163, 74, 0.1))}.mrd-document-list__row--selected.sc-mrd-document-list:hover{background:var(--mrd-color-primary-50, rgba(22, 163, 74, 0.1))}.mrd-document-list__row--pending.sc-mrd-document-list .mrd-document-list__label.sc-mrd-document-list{font-style:italic;color:var(--mrd-color-neutral-500)}.mrd-document-list__row--doc.sc-mrd-document-list{cursor:grab}.mrd-document-list__row--doc.sc-mrd-document-list:active{cursor:grabbing}.mrd-document-list__row--drop.sc-mrd-document-list{background:var(--mrd-color-primary-50, rgba(22, 163, 74, 0.1));box-shadow:inset 0 0 0 1px var(--mrd-color-primary)}.mrd-document-list__row--drop.sc-mrd-document-list:hover{background:var(--mrd-color-primary-50, rgba(22, 163, 74, 0.1))}.mrd-document-list__row--edit.sc-mrd-document-list{cursor:default}.mrd-document-list__name-input.sc-mrd-document-list{flex:1;min-width:0;height:1.625rem;padding:0 var(--mrd-space-2);font-size:var(--mrd-font-size-sm);font-family:inherit;color:var(--mrd-color-neutral-800);border:1px solid var(--mrd-color-primary);border-radius:var(--mrd-border-radius);outline:none;box-shadow:var(--mrd-shadow-focus)}.mrd-document-list__error.sc-mrd-document-list{font-size:var(--mrd-font-size-xs);color:var(--mrd-color-danger, #dc2626);padding-top:0.125rem;padding-bottom:0.25rem}.mrd-document-list__row--dossier.sc-mrd-document-list .mrd-document-list__label.sc-mrd-document-list{font-weight:var(--mrd-font-weight-semibold)}.mrd-document-list__indent.sc-mrd-document-list{flex:none}.mrd-document-list__chev.sc-mrd-document-list{width:1rem;height:1rem;flex:none;display:grid;place-items:center;color:var(--mrd-color-neutral-400);transition:transform var(--mrd-transition-fast)}.mrd-document-list__chev.sc-mrd-document-list svg.sc-mrd-document-list{width:0.6875rem;height:0.6875rem}.mrd-document-list__chev--open.sc-mrd-document-list{transform:rotate(90deg)}.mrd-document-list__chev--leaf.sc-mrd-document-list{visibility:hidden}.mrd-document-list__icon.sc-mrd-document-list{width:1.0625rem;height:1.0625rem;flex:none}.mrd-document-list__icon--dossier.sc-mrd-document-list{color:var(--mrd-color-primary)}.mrd-document-list__icon--folder.sc-mrd-document-list{color:#d9a441}.mrd-document-list__icon--doc.sc-mrd-document-list{color:var(--mrd-color-neutral-400)}.mrd-document-list__label.sc-mrd-document-list{flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mrd-document-list__count.sc-mrd-document-list{flex:none;font-family:var(--mrd-font-family-mono);font-size:var(--mrd-font-size-xs);color:var(--mrd-color-neutral-500);background:var(--mrd-color-neutral-100);border-radius:var(--mrd-border-radius-full);padding:0.0625rem 0.5rem}.mrd-document-list__date.sc-mrd-document-list{flex:none;font-size:var(--mrd-font-size-xs);color:var(--mrd-color-neutral-400);font-variant-numeric:tabular-nums}.mrd-document-list__loading.sc-mrd-document-list{display:flex;align-items:center;gap:var(--mrd-space-2);height:1.875rem;padding:0 var(--mrd-space-4);font-size:var(--mrd-font-size-xs);color:var(--mrd-color-neutral-400)}.mrd-document-list__spinner.sc-mrd-document-list{width:0.75rem;height:0.75rem;border:2px solid var(--mrd-color-neutral-300);border-top-color:var(--mrd-color-primary);border-radius:50%;animation:mrd-document-list-spin 0.7s linear infinite}@keyframes mrd-document-list-spin{to{transform:rotate(360deg)}}.mrd-document-list__empty.sc-mrd-document-list{padding:var(--mrd-space-8) var(--mrd-space-4);text-align:center;color:var(--mrd-color-neutral-400);font-size:var(--mrd-font-size-sm)}`;
|
|
978
|
+
const mrdDocumentListScss = () => `.sc-mrd-document-list-h{display:block;height:100%}.mrd-document-list.sc-mrd-document-list{padding:var(--mrd-space-2) 0;min-height:100%;box-sizing:border-box}.mrd-document-list--drop-active.sc-mrd-document-list{outline:2px dashed var(--mrd-color-primary);outline-offset:-4px;background:var(--mrd-color-primary-50, rgba(22, 163, 74, 0.06))}.mrd-document-list__row.sc-mrd-document-list{display:flex;align-items:center;gap:var(--mrd-space-2);height:2.125rem;padding:0 var(--mrd-space-4);cursor:pointer;user-select:none;font-size:var(--mrd-font-size-sm);color:var(--mrd-color-neutral-800)}.mrd-document-list__row.sc-mrd-document-list:hover{background:var(--mrd-color-neutral-50)}.mrd-document-list__row--selected.sc-mrd-document-list{background:var(--mrd-color-primary-50, rgba(22, 163, 74, 0.1))}.mrd-document-list__row--selected.sc-mrd-document-list:hover{background:var(--mrd-color-primary-50, rgba(22, 163, 74, 0.1))}.mrd-document-list__row--pending.sc-mrd-document-list .mrd-document-list__label.sc-mrd-document-list{font-style:italic;color:var(--mrd-color-neutral-500)}.mrd-document-list__row--doc.sc-mrd-document-list{cursor:grab}.mrd-document-list__row--doc.sc-mrd-document-list:active{cursor:grabbing}.mrd-document-list__row--drop.sc-mrd-document-list{background:var(--mrd-color-primary-50, rgba(22, 163, 74, 0.1));box-shadow:inset 0 0 0 1px var(--mrd-color-primary)}.mrd-document-list__row--drop.sc-mrd-document-list:hover{background:var(--mrd-color-primary-50, rgba(22, 163, 74, 0.1))}.mrd-document-list__row--edit.sc-mrd-document-list{cursor:default}.mrd-document-list__name-input.sc-mrd-document-list{flex:1;min-width:0;height:1.625rem;padding:0 var(--mrd-space-2);font-size:var(--mrd-font-size-sm);font-family:inherit;color:var(--mrd-color-neutral-800);border:1px solid var(--mrd-color-primary);border-radius:var(--mrd-border-radius);outline:none;box-shadow:var(--mrd-shadow-focus)}.mrd-document-list__error.sc-mrd-document-list{font-size:var(--mrd-font-size-xs);color:var(--mrd-color-danger, #dc2626);padding-top:0.125rem;padding-bottom:0.25rem}.mrd-document-list__row--dossier.sc-mrd-document-list .mrd-document-list__label.sc-mrd-document-list{font-weight:var(--mrd-font-weight-semibold)}.mrd-document-list__indent.sc-mrd-document-list{flex:none}.mrd-document-list__chev.sc-mrd-document-list{width:1rem;height:1rem;flex:none;display:grid;place-items:center;color:var(--mrd-color-neutral-400);transition:transform var(--mrd-transition-fast)}.mrd-document-list__chev.sc-mrd-document-list svg.sc-mrd-document-list{width:0.6875rem;height:0.6875rem}.mrd-document-list__chev--open.sc-mrd-document-list{transform:rotate(90deg)}.mrd-document-list__chev--leaf.sc-mrd-document-list{visibility:hidden}.mrd-document-list__icon.sc-mrd-document-list{width:1.0625rem;height:1.0625rem;flex:none}.mrd-document-list__icon--dossier.sc-mrd-document-list{color:var(--mrd-color-primary)}.mrd-document-list__icon--folder.sc-mrd-document-list{color:#d9a441}.mrd-document-list__icon--doc.sc-mrd-document-list{color:var(--mrd-color-neutral-400)}.mrd-document-list__label.sc-mrd-document-list{flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mrd-document-list__count.sc-mrd-document-list{flex:none;font-family:var(--mrd-font-family-mono);font-size:var(--mrd-font-size-xs);color:var(--mrd-color-neutral-500);background:var(--mrd-color-neutral-100);border-radius:var(--mrd-border-radius-full);padding:0.0625rem 0.5rem}.mrd-document-list__date.sc-mrd-document-list{flex:none;font-size:var(--mrd-font-size-xs);color:var(--mrd-color-neutral-400);font-variant-numeric:tabular-nums}.mrd-document-list__loading.sc-mrd-document-list{display:flex;align-items:center;gap:var(--mrd-space-2);height:1.875rem;padding:0 var(--mrd-space-4);font-size:var(--mrd-font-size-xs);color:var(--mrd-color-neutral-400)}.mrd-document-list__spinner.sc-mrd-document-list{width:0.75rem;height:0.75rem;border:2px solid var(--mrd-color-neutral-300);border-top-color:var(--mrd-color-primary);border-radius:50%;animation:mrd-document-list-spin 0.7s linear infinite}@keyframes mrd-document-list-spin{to{transform:rotate(360deg)}}.mrd-document-list__empty.sc-mrd-document-list{padding:var(--mrd-space-8) var(--mrd-space-4);text-align:center;color:var(--mrd-color-neutral-400);font-size:var(--mrd-font-size-sm)}`;
|
|
971
979
|
|
|
972
980
|
const MrdDocumentList = class {
|
|
973
981
|
constructor(hostRef) {
|
|
@@ -983,6 +991,11 @@ const MrdDocumentList = class {
|
|
|
983
991
|
this.item = null;
|
|
984
992
|
/** Parent record id — required for RELATED_VIEW path building. */
|
|
985
993
|
this.parentId = '';
|
|
994
|
+
/** Canonical parent href (`/{base}/{tenant}/{fromClass}/{parentId}`) supplied by
|
|
995
|
+
* the host. When the RELATED_VIEW's `inverseRelation` equals the archetype
|
|
996
|
+
* `container` slot, this seeds a single container so an empty dossier still
|
|
997
|
+
* accepts file drops and folder creation. */
|
|
998
|
+
this.containerHref = '';
|
|
986
999
|
this.locale = navigator.language;
|
|
987
1000
|
this.containers = [];
|
|
988
1001
|
this.rootLoading = true;
|
|
@@ -994,6 +1007,8 @@ const MrdDocumentList = class {
|
|
|
994
1007
|
this.dropTargetId = null;
|
|
995
1008
|
/** Node id showing an "uploading…" indicator while a dropped file is processed. */
|
|
996
1009
|
this.uploadingNodeId = null;
|
|
1010
|
+
/** Whether a drag is hovering the root drop-zone (single-container area highlight). */
|
|
1011
|
+
this.rootDropActive = false;
|
|
997
1012
|
this.nodeIndex = new Map();
|
|
998
1013
|
// ── New-folder editing state ───────────────────────────────────────────────
|
|
999
1014
|
/** The pending node whose inline name input is open (null = not creating). */
|
|
@@ -1118,8 +1133,18 @@ const MrdDocumentList = class {
|
|
|
1118
1133
|
e.preventDefault();
|
|
1119
1134
|
if (e.dataTransfer)
|
|
1120
1135
|
e.dataTransfer.dropEffect = file ? 'copy' : 'move';
|
|
1136
|
+
if (!this.rootDropActive)
|
|
1137
|
+
this.rootDropActive = true;
|
|
1138
|
+
};
|
|
1139
|
+
this.onRootDragLeave = (e) => {
|
|
1140
|
+
const related = e.relatedTarget;
|
|
1141
|
+
if (related && this.el.contains(related))
|
|
1142
|
+
return; // moved onto a child, still inside
|
|
1143
|
+
if (this.rootDropActive)
|
|
1144
|
+
this.rootDropActive = false;
|
|
1121
1145
|
};
|
|
1122
1146
|
this.onRootDrop = (e) => {
|
|
1147
|
+
this.rootDropActive = false;
|
|
1123
1148
|
if (!this.singleContainer)
|
|
1124
1149
|
return;
|
|
1125
1150
|
const only = this.containers[0];
|
|
@@ -1136,7 +1161,33 @@ const MrdDocumentList = class {
|
|
|
1136
1161
|
};
|
|
1137
1162
|
}
|
|
1138
1163
|
componentDidLoad() {
|
|
1139
|
-
this.
|
|
1164
|
+
if (this.isSeededSingleContainer()) {
|
|
1165
|
+
this.seedSingleContainer();
|
|
1166
|
+
}
|
|
1167
|
+
else {
|
|
1168
|
+
this.emitContainerDistinct();
|
|
1169
|
+
}
|
|
1170
|
+
}
|
|
1171
|
+
/** True when the view is a single-container context: a RELATED_VIEW whose
|
|
1172
|
+
* `inverseRelation` matches the archetype `container` slot, with a known
|
|
1173
|
+
* parent href. The container is then implied by context (not by distinct),
|
|
1174
|
+
* so it works even with zero documents. */
|
|
1175
|
+
isSeededSingleContainer() {
|
|
1176
|
+
var _a, _b;
|
|
1177
|
+
return (((_a = this.item) === null || _a === void 0 ? void 0 : _a.type) === ClientLayoutItemType.RELATED_VIEW &&
|
|
1178
|
+
!!((_b = this.item) === null || _b === void 0 ? void 0 : _b.inverseRelation) &&
|
|
1179
|
+
this.item.inverseRelation === this.containerField &&
|
|
1180
|
+
!!this.containerHref);
|
|
1181
|
+
}
|
|
1182
|
+
/** Seed the single implied container from context and load its folders. */
|
|
1183
|
+
seedSingleContainer() {
|
|
1184
|
+
const node = this.makeContainerNode(this.containerHref, this.containerField, 0);
|
|
1185
|
+
this.nodeIndex.set(node.id, node);
|
|
1186
|
+
this.containers = [node];
|
|
1187
|
+
this.rootLoading = false;
|
|
1188
|
+
this.singleContainer = true;
|
|
1189
|
+
node.open = true;
|
|
1190
|
+
this.emitFolderDistinct(node);
|
|
1140
1191
|
}
|
|
1141
1192
|
componentDidRender() {
|
|
1142
1193
|
if (this.pendingNeedsFocus && this.pendingInputEl) {
|
|
@@ -1172,7 +1223,10 @@ const MrdDocumentList = class {
|
|
|
1172
1223
|
return (_b = (_a = this.archetype) === null || _a === void 0 ? void 0 : _a.slots) === null || _b === void 0 ? void 0 : _b.date;
|
|
1173
1224
|
}
|
|
1174
1225
|
// ── Path / query building (mirrors mrd-table conventions) ────────────────
|
|
1175
|
-
/** VIEW: `/{dataClass}`; RELATED_VIEW: `/{fromClass}/{parentId}/{dataClass}`.
|
|
1226
|
+
/** VIEW: `/{dataClass}`; RELATED_VIEW: `/{fromClass}/{parentId}/{dataClass}`.
|
|
1227
|
+
* Used for reads (list/distinct): `dataClass`/`relatedClass` may be an abstract
|
|
1228
|
+
* type (e.g. "contents"), filtered down to the concrete `filterClass` via the
|
|
1229
|
+
* `type` query param — see baseParams(). */
|
|
1176
1230
|
buildDataPath() {
|
|
1177
1231
|
var _a, _b, _c;
|
|
1178
1232
|
const it = this.item;
|
|
@@ -1182,6 +1236,19 @@ const MrdDocumentList = class {
|
|
|
1182
1236
|
}
|
|
1183
1237
|
return `/${dataClass}`;
|
|
1184
1238
|
}
|
|
1239
|
+
/** Path for creating a new document (file-drop). Unlike buildDataPath(), this
|
|
1240
|
+
* must target the concrete type: `dataClass`/`relatedClass` can be an abstract
|
|
1241
|
+
* base type (e.g. "contents") that cannot be POSTed to directly, so prefer
|
|
1242
|
+
* `filterClass` (e.g. "documents") when present. */
|
|
1243
|
+
buildCreatePath() {
|
|
1244
|
+
var _a, _b, _c, _d;
|
|
1245
|
+
const it = this.item;
|
|
1246
|
+
const dataClass = (_c = (_b = (_a = it === null || it === void 0 ? void 0 : it.filterClass) !== null && _a !== void 0 ? _a : it === null || it === void 0 ? void 0 : it.dataClass) !== null && _b !== void 0 ? _b : it === null || it === void 0 ? void 0 : it.relatedClass) !== null && _c !== void 0 ? _c : '';
|
|
1247
|
+
if ((it === null || it === void 0 ? void 0 : it.type) === ClientLayoutItemType.RELATED_VIEW) {
|
|
1248
|
+
return `/${(_d = it.fromClass) !== null && _d !== void 0 ? _d : ''}/${this.parentId}/${dataClass}`;
|
|
1249
|
+
}
|
|
1250
|
+
return `/${dataClass}`;
|
|
1251
|
+
}
|
|
1185
1252
|
/** View-level static filters + filterClass, shared by every request. */
|
|
1186
1253
|
baseParams() {
|
|
1187
1254
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
@@ -1517,7 +1584,7 @@ const MrdDocumentList = class {
|
|
|
1517
1584
|
[this.folderField]: folder,
|
|
1518
1585
|
[this.containerField]: container.href,
|
|
1519
1586
|
};
|
|
1520
|
-
this.mrdCreateObject.emit({ path: this.
|
|
1587
|
+
this.mrdCreateObject.emit({ path: this.buildCreatePath(), values });
|
|
1521
1588
|
// Optimistically show the new document (no href until a reload).
|
|
1522
1589
|
const optimistic = { [this.titleField]: this.stripExtension(file.name), _optimistic: true };
|
|
1523
1590
|
const wasUnloadedEmpty = !node.docsLoaded && node.docCount === 0;
|
|
@@ -1697,19 +1764,25 @@ const MrdDocumentList = class {
|
|
|
1697
1764
|
body = this.renderLoadingRow(0);
|
|
1698
1765
|
}
|
|
1699
1766
|
else if (this.containers.length === 0) {
|
|
1700
|
-
body = h("div", { key: '
|
|
1767
|
+
body = h("div", { key: '9c38a2e26320a8173ba82cac412c1b32a8a1882e', class: "mrd-document-list__empty" }, t('no_results', this.locale));
|
|
1701
1768
|
}
|
|
1702
1769
|
else if (this.singleContainer) {
|
|
1703
1770
|
// Dossier context: render the single container's folder tree at the root.
|
|
1704
1771
|
const only = this.containers[0];
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1772
|
+
if (only.loading && !only.foldersLoaded) {
|
|
1773
|
+
body = this.renderLoadingRow(0);
|
|
1774
|
+
}
|
|
1775
|
+
else {
|
|
1776
|
+
const kids = this.renderChildren(only, only, 0);
|
|
1777
|
+
body = kids.length
|
|
1778
|
+
? kids
|
|
1779
|
+
: h("div", { class: "mrd-document-list__empty" }, t('doc_empty_drop', this.locale));
|
|
1780
|
+
}
|
|
1708
1781
|
}
|
|
1709
1782
|
else {
|
|
1710
1783
|
body = this.containers.map(c => this.renderContainerNode(c, 0));
|
|
1711
1784
|
}
|
|
1712
|
-
return (h(Host, { key: '
|
|
1785
|
+
return (h(Host, { key: 'dd83a6a609e01d21a2b5da5b3ab929f6f9315402' }, h("div", { key: 'd539d938e1efd759730cccc90c4d6c2e535db936', class: 'mrd-document-list' + (this.rootDropActive ? ' mrd-document-list--drop-active' : ''), onDragOver: this.onRootDragOver, onDragLeave: this.onRootDragLeave, onDrop: this.onRootDrop }, body)));
|
|
1713
1786
|
}
|
|
1714
1787
|
get el() { return getElement(this); }
|
|
1715
1788
|
};
|
|
@@ -3089,15 +3162,30 @@ const MrdLayoutSection = class {
|
|
|
3089
3162
|
// The API publishes `archetypes` on the VIEW/RELATED_VIEW item itself
|
|
3090
3163
|
// (sibling of `view`), not inside `view`.
|
|
3091
3164
|
const docArchetype = resolveArchetype((_g = item.archetypes) !== null && _g !== void 0 ? _g : (_h = item.view) === null || _h === void 0 ? void 0 : _h.archetypes, ARCHETYPE_DOCUMENT);
|
|
3165
|
+
// Canonical parent href for single-container seeding: use the RELATED_VIEW's
|
|
3166
|
+
// fromClass (base class) rather than the route class, so polymorphic subtypes
|
|
3167
|
+
// resolve to the same container the documents actually reference.
|
|
3168
|
+
const containerHref = this.buildContainerHref(item, selfHref, parentId);
|
|
3092
3169
|
return (h("div", { class: "mrd-layout-section__related-view", key: `view-${key}` }, showTitle && item.label && h("h3", { class: "mrd-layout-section__related-view-title" }, item.label), docArchetype
|
|
3093
|
-
? this.renderDocumentContainer(item, key, parentId, docArchetype)
|
|
3170
|
+
? this.renderDocumentContainer(item, key, parentId, docArchetype, containerHref)
|
|
3094
3171
|
: this.renderTable(item, key, parentId)));
|
|
3095
3172
|
}
|
|
3173
|
+
/** Build the canonical parent href `/{base}/{tenant}/{fromClass}/{parentId}` from
|
|
3174
|
+
* the object's self href. Empty unless it is a RELATED_VIEW with a fromClass. */
|
|
3175
|
+
buildContainerHref(item, selfHref, parentId) {
|
|
3176
|
+
if (item.type !== ClientLayoutItemType.RELATED_VIEW || !item.fromClass || !parentId)
|
|
3177
|
+
return '';
|
|
3178
|
+
const segs = selfHref.split('/').filter(Boolean);
|
|
3179
|
+
if (segs.length < 2)
|
|
3180
|
+
return '';
|
|
3181
|
+
const [base, tenant] = segs;
|
|
3182
|
+
return `/${base}/${tenant}/${item.fromClass}/${parentId}`;
|
|
3183
|
+
}
|
|
3096
3184
|
/** Document collection view: owns the view-switch + collection actions and
|
|
3097
3185
|
* swaps between the folder tree and the flat table. Events are re-emitted to
|
|
3098
3186
|
* the host with the view key, exactly as the raw list/table events were. */
|
|
3099
|
-
renderDocumentContainer(item, key, parentId, archetype) {
|
|
3100
|
-
return (h("mrd-document-container", { item: item, archetype: archetype, parentId: parentId, viewKey: key, locale: this.locale, onMrdLoadDistinct: (e) => {
|
|
3187
|
+
renderDocumentContainer(item, key, parentId, archetype, containerHref) {
|
|
3188
|
+
return (h("mrd-document-container", { item: item, archetype: archetype, parentId: parentId, containerHref: containerHref, viewKey: key, locale: this.locale, onMrdLoadDistinct: (e) => {
|
|
3101
3189
|
e.stopPropagation();
|
|
3102
3190
|
this.mrdLoadViewDistinct.emit(Object.assign({ name: key }, e.detail));
|
|
3103
3191
|
}, onMrdLoadPage: (e) => {
|
|
@@ -3193,7 +3281,7 @@ const MrdLayoutSection = class {
|
|
|
3193
3281
|
}
|
|
3194
3282
|
render() {
|
|
3195
3283
|
const docArchetype = resolveArchetype(this.archetypes, ARCHETYPE_DOCUMENT);
|
|
3196
|
-
return (h(Host, { key: '
|
|
3284
|
+
return (h(Host, { key: '231f5c3e282375b5850291611645fe3c904831bb' }, h("div", { key: '314e39ec3aa1eabeb1a98f6e6d63fcf07e13ccec', class: "mrd-layout-section" }, docArchetype
|
|
3197
3285
|
? this.renderDocumentObject(docArchetype)
|
|
3198
3286
|
: this.items.map(item => this.renderItem(item))), this.renderImageModal()));
|
|
3199
3287
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e,b as l}from"./p-_tsCCkAi.js";export{s as setNonce}from"./p-_tsCCkAi.js";import{g as a}from"./p-DQuL1Twl.js";(()=>{const l=import.meta.url,a={};return""!==l&&(a.resourcesUrl=new URL(".",l).href),e(a)})().then((async e=>(await a(),l([["p-
|
|
1
|
+
import{p as e,b as l}from"./p-_tsCCkAi.js";export{s as setNonce}from"./p-_tsCCkAi.js";import{g as a}from"./p-DQuL1Twl.js";(()=>{const l=import.meta.url,a={};return""!==l&&(a.resourcesUrl=new URL(".",l).href),e(a)})().then((async e=>(await a(),l([["p-a9618055",[[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]}],[2,"mrd-document-view",{archetype:[16],data:[16],locale:[1]}],[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]}],[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],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"],fileName:[32],isDragging:[32],uploading:[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"],previewUrl:[32],fileName:[32],isDragging:[32],uploading:[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]}],[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"],activeViewIdx:[32],loadedPages:[32],requestedPages:[32],renderStart:[32],renderEnd:[32],colWidths:[32],sortField:[32],sortDir:[32],filterMode:[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]}]]]],e))));
|