@mmlogic/components 0.3.8 → 0.3.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.cjs.js +13 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/mosterdcomponents.cjs.js +1 -1
- package/dist/cjs/{mrd-boolean-field_20.cjs.entry.js → mrd-boolean-field_23.cjs.entry.js} +1059 -23
- package/dist/collection/collection-manifest.json +3 -0
- package/dist/collection/components/mrd-boolean-field/mrd-boolean-field.js +1 -1
- package/dist/collection/components/mrd-currency-field/mrd-currency-field.js +1 -1
- package/dist/collection/components/mrd-date-field/mrd-date-field.js +1 -1
- package/dist/collection/components/mrd-datetime-field/mrd-datetime-field.js +1 -1
- package/dist/collection/components/mrd-document-container/mrd-document-container.js +375 -0
- package/dist/collection/components/mrd-document-container/mrd-document-container.scss +79 -0
- package/dist/collection/components/mrd-document-list/mrd-document-list.js +1129 -0
- package/dist/collection/components/mrd-document-list/mrd-document-list.scss +181 -0
- package/dist/collection/components/mrd-document-view/mrd-document-view.js +177 -0
- package/dist/collection/components/mrd-document-view/mrd-document-view.scss +121 -0
- package/dist/collection/components/mrd-email-field/mrd-email-field.js +1 -1
- package/dist/collection/components/mrd-file-field/mrd-file-field.js +1 -1
- package/dist/collection/components/mrd-image-field/mrd-image-field.js +1 -1
- package/dist/collection/components/mrd-layout-section/mrd-layout-section.js +288 -14
- package/dist/collection/components/mrd-layout-section/mrd-layout-section.scss +2 -3
- package/dist/collection/components/mrd-longtext-field/mrd-longtext-field.js +1 -1
- package/dist/collection/components/mrd-number-field/mrd-number-field.js +1 -1
- package/dist/collection/components/mrd-secret-field/mrd-secret-field.js +2 -2
- package/dist/collection/components/mrd-text-field/mrd-text-field.js +1 -1
- package/dist/collection/components/mrd-textarea-field/mrd-textarea-field.js +1 -1
- package/dist/collection/components/mrd-time-field/mrd-time-field.js +1 -1
- package/dist/collection/dev/app.js +66 -2
- package/dist/collection/types/client-layout.js +10 -0
- package/dist/collection/utils/i18n.js +34 -0
- package/dist/components/client-layout.js +1 -1
- package/dist/components/format.js +1 -1
- package/dist/components/i18n.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/mrd-boolean-field2.js +1 -1
- package/dist/components/mrd-currency-field2.js +1 -1
- package/dist/components/mrd-date-field2.js +1 -1
- package/dist/components/mrd-datetime-field2.js +1 -1
- package/dist/components/mrd-document-container.d.ts +11 -0
- package/dist/components/mrd-document-container.js +1 -0
- package/dist/components/mrd-document-container2.js +1 -0
- package/dist/components/mrd-document-list.d.ts +11 -0
- package/dist/components/mrd-document-list.js +1 -0
- package/dist/components/mrd-document-list2.js +1 -0
- package/dist/components/mrd-document-view.d.ts +11 -0
- package/dist/components/mrd-document-view.js +1 -0
- package/dist/components/mrd-document-view2.js +1 -0
- package/dist/components/mrd-email-field2.js +1 -1
- package/dist/components/mrd-file-field2.js +1 -1
- package/dist/components/mrd-image-field2.js +1 -1
- package/dist/components/mrd-layout-section.js +1 -1
- package/dist/components/mrd-longtext-field2.js +1 -1
- package/dist/components/mrd-number-field2.js +1 -1
- package/dist/components/mrd-secret-field2.js +1 -1
- package/dist/components/mrd-table2.js +1 -1
- package/dist/components/mrd-text-field2.js +1 -1
- package/dist/components/mrd-textarea-field2.js +1 -1
- package/dist/components/mrd-time-field2.js +1 -1
- package/dist/esm/index.js +11 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/mosterdcomponents.js +1 -1
- package/dist/esm/{mrd-boolean-field_20.entry.js → mrd-boolean-field_23.entry.js} +1058 -25
- package/dist/mosterdcomponents/{cell-renderer-CbRwLOo8.js.map → cell-renderer-B-AJDBcj.js.map} +1 -1
- package/dist/mosterdcomponents/{client-layout-D88nn5zf.js.map → client-layout-ChqRA3AF.js.map} +1 -1
- package/dist/mosterdcomponents/i18n-s1XrKcD2.js.map +1 -0
- package/dist/mosterdcomponents/index-DkY-NQj0.js.map +1 -0
- package/dist/mosterdcomponents/index-DwF_Sp__.js.map +1 -0
- package/dist/mosterdcomponents/index.esm.js +1 -1
- package/dist/mosterdcomponents/mosterdcomponents.css +1 -1
- package/dist/mosterdcomponents/mosterdcomponents.esm.js +1 -1
- package/dist/mosterdcomponents/p-69452249.entry.js +1 -0
- package/dist/mosterdcomponents/{validation-ixb43cqU.js.map → validation-Br9k2Ztw.js.map} +1 -1
- package/dist/types/components/mrd-document-container/mrd-document-container.d.ts +94 -0
- package/dist/types/components/mrd-document-list/mrd-document-list.d.ts +210 -0
- package/dist/types/components/mrd-document-view/mrd-document-view.d.ts +36 -0
- package/dist/types/components/mrd-layout-section/mrd-layout-section.d.ts +57 -6
- package/dist/types/components.d.ts +507 -15
- package/dist/types/types/client-layout.d.ts +38 -0
- package/package.json +1 -1
- package/dist/mosterdcomponents/i18n-hoGGKbKU.js.map +0 -1
- package/dist/mosterdcomponents/index-6yQUNVww.js.map +0 -1
- package/dist/mosterdcomponents/index-I5SuYv7a.js.map +0 -1
- package/dist/mosterdcomponents/p-7bfaee51.entry.js +0 -1
|
@@ -29,7 +29,7 @@ const MrdBooleanField = class {
|
|
|
29
29
|
this.checked = !!this.value;
|
|
30
30
|
}
|
|
31
31
|
render() {
|
|
32
|
-
return (index.h(index.Host, { key: '
|
|
32
|
+
return (index.h(index.Host, { key: '38e65a1c7971912f8259d09281b272d7cbd446f2' }, index.h("div", { key: 'e10919998731d744cc2a13130c5f355c9b8fc9aa', class: "mrd-boolean-field" }, index.h("label", { key: 'db85a2c80cc62fdfd25237e3f5c7750bf1666819', class: "mrd-boolean-field__toggle-label" }, index.h("input", { key: 'cddd7004593fa4671abb89f4f805c4a009db99ef', class: "mrd-boolean-field__checkbox", type: "checkbox", name: this.name, checked: this.checked, disabled: this.disabled, onChange: this.handleChange, onBlur: this.handleBlur }), index.h("span", { key: 'f90f0ed6d74d6688e51b8d85a5397a0597d95ad8', class: "mrd-boolean-field__toggle", "aria-hidden": "true" }), this.label && (index.h("span", { key: '7e4582b1d9a5b08c00c220bec53baa6c14cbfe43', class: `mrd-boolean-field__text${this.required ? ' mrd-boolean-field__text--required' : ''}` }, this.label))))));
|
|
33
33
|
}
|
|
34
34
|
};
|
|
35
35
|
MrdBooleanField.style = mrdBooleanFieldScss();
|
|
@@ -68,6 +68,9 @@ const translations = {
|
|
|
68
68
|
table_filter_clear_all: 'Alle filters wissen',
|
|
69
69
|
table_new_record: 'Nieuw record',
|
|
70
70
|
table_export_excel: 'Exporteer naar Excel',
|
|
71
|
+
doc_view_switch: 'Weergave wisselen',
|
|
72
|
+
doc_view_tree: 'Boomweergave',
|
|
73
|
+
doc_view_list: 'Lijstweergave',
|
|
71
74
|
// mrd-table filter popup
|
|
72
75
|
filter_sorting: 'Sortering',
|
|
73
76
|
filter_ascending: 'Oplopend',
|
|
@@ -97,6 +100,11 @@ const translations = {
|
|
|
97
100
|
history_until: 'tot',
|
|
98
101
|
history_badge_tooltip: 'Vorige waarden',
|
|
99
102
|
hyperlink_name: 'Linktekst (optioneel)',
|
|
103
|
+
// mrd-document-list
|
|
104
|
+
new_folder: 'Nieuwe folder',
|
|
105
|
+
folder_name_placeholder: 'Foldernaam',
|
|
106
|
+
folder_no_slash: "Een foldernaam mag geen '/' bevatten",
|
|
107
|
+
folder_duplicate: 'Er bestaat al een folder met deze naam',
|
|
100
108
|
},
|
|
101
109
|
en: {
|
|
102
110
|
required: 'This field is required',
|
|
@@ -131,6 +139,9 @@ const translations = {
|
|
|
131
139
|
table_filter_clear_all: 'Clear all filters',
|
|
132
140
|
table_new_record: 'New record',
|
|
133
141
|
table_export_excel: 'Export to Excel',
|
|
142
|
+
doc_view_switch: 'Switch view',
|
|
143
|
+
doc_view_tree: 'Tree view',
|
|
144
|
+
doc_view_list: 'List view',
|
|
134
145
|
// mrd-table filter popup
|
|
135
146
|
filter_sorting: 'Sorting',
|
|
136
147
|
filter_ascending: 'Ascending',
|
|
@@ -160,6 +171,11 @@ const translations = {
|
|
|
160
171
|
history_until: 'until',
|
|
161
172
|
history_badge_tooltip: 'Previous values',
|
|
162
173
|
hyperlink_name: 'Link text (optional)',
|
|
174
|
+
// mrd-document-list
|
|
175
|
+
new_folder: 'New folder',
|
|
176
|
+
folder_name_placeholder: 'Folder name',
|
|
177
|
+
folder_no_slash: "A folder name cannot contain '/'",
|
|
178
|
+
folder_duplicate: 'A folder with this name already exists',
|
|
163
179
|
},
|
|
164
180
|
ar: {
|
|
165
181
|
required: 'هذا الحقل مطلوب',
|
|
@@ -194,6 +210,9 @@ const translations = {
|
|
|
194
210
|
table_filter_clear_all: 'مسح جميع الفلاتر',
|
|
195
211
|
table_new_record: 'سجل جديد',
|
|
196
212
|
table_export_excel: 'تصدير إلى Excel',
|
|
213
|
+
doc_view_switch: 'تبديل العرض',
|
|
214
|
+
doc_view_tree: 'عرض شجري',
|
|
215
|
+
doc_view_list: 'عرض القائمة',
|
|
197
216
|
// mrd-table filter popup
|
|
198
217
|
filter_sorting: 'الترتيب',
|
|
199
218
|
filter_ascending: 'تصاعدي',
|
|
@@ -257,6 +276,9 @@ const translations = {
|
|
|
257
276
|
table_filter_clear_all: 'Effacer tous les filtres',
|
|
258
277
|
table_new_record: 'Nouvel enregistrement',
|
|
259
278
|
table_export_excel: 'Exporter vers Excel',
|
|
279
|
+
doc_view_switch: 'Changer de vue',
|
|
280
|
+
doc_view_tree: 'Vue arborescente',
|
|
281
|
+
doc_view_list: 'Vue liste',
|
|
260
282
|
// mrd-table filter popup
|
|
261
283
|
filter_sorting: 'Tri',
|
|
262
284
|
filter_ascending: 'Croissant',
|
|
@@ -320,6 +342,9 @@ const translations = {
|
|
|
320
342
|
table_filter_clear_all: 'Alle Filter löschen',
|
|
321
343
|
table_new_record: 'Neuer Eintrag',
|
|
322
344
|
table_export_excel: 'Als Excel exportieren',
|
|
345
|
+
doc_view_switch: 'Ansicht wechseln',
|
|
346
|
+
doc_view_tree: 'Baumansicht',
|
|
347
|
+
doc_view_list: 'Listenansicht',
|
|
323
348
|
// mrd-table filter popup
|
|
324
349
|
filter_sorting: 'Sortierung',
|
|
325
350
|
filter_ascending: 'Aufsteigend',
|
|
@@ -383,6 +408,9 @@ const translations = {
|
|
|
383
408
|
table_filter_clear_all: 'Borrar todos los filtros',
|
|
384
409
|
table_new_record: 'Nuevo registro',
|
|
385
410
|
table_export_excel: 'Exportar a Excel',
|
|
411
|
+
doc_view_switch: 'Cambiar vista',
|
|
412
|
+
doc_view_tree: 'Vista de árbol',
|
|
413
|
+
doc_view_list: 'Vista de lista',
|
|
386
414
|
// mrd-table filter popup
|
|
387
415
|
filter_sorting: 'Ordenación',
|
|
388
416
|
filter_ascending: 'Ascendente',
|
|
@@ -446,6 +474,9 @@ const translations = {
|
|
|
446
474
|
table_filter_clear_all: 'Cancella tutti i filtri',
|
|
447
475
|
table_new_record: 'Nuovo record',
|
|
448
476
|
table_export_excel: 'Esporta in Excel',
|
|
477
|
+
doc_view_switch: 'Cambia vista',
|
|
478
|
+
doc_view_tree: 'Vista ad albero',
|
|
479
|
+
doc_view_list: 'Vista elenco',
|
|
449
480
|
// mrd-table filter popup
|
|
450
481
|
filter_sorting: 'Ordinamento',
|
|
451
482
|
filter_ascending: 'Crescente',
|
|
@@ -509,6 +540,9 @@ const translations = {
|
|
|
509
540
|
table_filter_clear_all: 'Очистити всі фільтри',
|
|
510
541
|
table_new_record: 'Новий запис',
|
|
511
542
|
table_export_excel: 'Експортувати до Excel',
|
|
543
|
+
doc_view_switch: 'Змінити вигляд',
|
|
544
|
+
doc_view_tree: 'Деревоподібний вигляд',
|
|
545
|
+
doc_view_list: 'Список',
|
|
512
546
|
// mrd-table filter popup
|
|
513
547
|
filter_sorting: 'Сортування',
|
|
514
548
|
filter_ascending: 'За зростанням',
|
|
@@ -721,7 +755,7 @@ const MrdCurrencyField = class {
|
|
|
721
755
|
}
|
|
722
756
|
render() {
|
|
723
757
|
const hasError = !!this.error;
|
|
724
|
-
return (index.h(index.Host, { key: '
|
|
758
|
+
return (index.h(index.Host, { key: 'fe3520c44d831caf36b388cb5968a9518b16cb8b' }, index.h("div", { key: '50c1fd2d53038e46da575d3e46e1ec26c2da423b', class: "mrd-currency-field" }, this.label && (index.h("label", { key: 'a2649d41bf6e3765c8a62ba6559c64c41615027a', class: `mrd-currency-field__label${this.required ? ' mrd-currency-field__label--required' : ''}` }, this.label)), index.h("div", { key: '952b51f315b4a5c05a8373ce3a3f1041086ba8b8', class: "mrd-currency-field__row" }, index.h("input", { key: '137a72ffc5d79fc8e0a8cf44c012d84a50c26d5b', class: `mrd-currency-field__amount${hasError ? ' mrd-currency-field__amount--error' : ''}`, type: "text", inputMode: "decimal", name: `${this.name}_amount`, value: this.amountDisplay, placeholder: "0.00", required: this.required, disabled: this.disabled, onInput: this.handleAmountInput, onBlur: this.handleAmountBlur }), index.h("select", { key: '1755854ca9b76dc4b41ad84b6b788685931ace36', class: "mrd-currency-field__currency", disabled: this.disabled, onChange: this.handleCurrencyChange }, COMMON_CURRENCIES.map(c => (index.h("option", { key: c, value: c, selected: c === this.currency }, c))))), hasError && index.h("span", { key: '0f10eb98c2e6444651d79d1de92acd0dbcc7133b', class: "mrd-currency-field__error" }, this.error))));
|
|
725
759
|
}
|
|
726
760
|
};
|
|
727
761
|
MrdCurrencyField.style = mrdCurrencyFieldScss();
|
|
@@ -757,7 +791,7 @@ const MrdDateField = class {
|
|
|
757
791
|
}
|
|
758
792
|
render() {
|
|
759
793
|
const hasError = !!this.error;
|
|
760
|
-
return (index.h(index.Host, { key: '
|
|
794
|
+
return (index.h(index.Host, { key: '2c0dc2311068a5c759fe8efe58a98a71a9cf4b7b' }, index.h("div", { key: 'ee1cc0e9a2943cc42439825b8f21cd3492eaca05', class: "mrd-date-field" }, this.label && (index.h("label", { key: '3f836a991e676b6070a8b3800edfce00cc0d3b3d', class: `mrd-date-field__label${this.required ? ' mrd-date-field__label--required' : ''}` }, this.label)), index.h("input", { key: '575185661987eea3dc91950f51995b2cc75debea', class: `mrd-date-field__input${hasError ? ' mrd-date-field__input--error' : ''}`, type: "date", name: this.name, value: this.value, required: this.required, disabled: this.disabled, onChange: this.handleChange, onBlur: this.handleBlur }), hasError && index.h("span", { key: '480ec99200989f3dc543d9afc648d83d31992b3c', class: "mrd-date-field__error" }, this.error))));
|
|
761
795
|
}
|
|
762
796
|
};
|
|
763
797
|
MrdDateField.style = mrdDateFieldScss();
|
|
@@ -820,7 +854,7 @@ const MrdDatetimeField = class {
|
|
|
820
854
|
}
|
|
821
855
|
render() {
|
|
822
856
|
const hasError = !!this.error;
|
|
823
|
-
return (index.h(index.Host, { key: '
|
|
857
|
+
return (index.h(index.Host, { key: 'ea8b3b68100ffdb316bc5048f82d85d238bb2e4b' }, index.h("div", { key: 'c192c6998ee474aaf4df7b3b97ae0bd61f6d624d', class: "mrd-datetime-field" }, this.label && (index.h("label", { key: '1fbd66c17d76508f0d698a2c258be6779e98d85e', class: `mrd-datetime-field__label${this.required ? ' mrd-datetime-field__label--required' : ''}` }, this.label)), index.h("input", { key: 'fc9612c062a1cab5076a06598cabf227adce996c', class: `mrd-datetime-field__input${hasError ? ' mrd-datetime-field__input--error' : ''}`, type: "datetime-local", name: this.name, value: this.localValue, required: this.required, disabled: this.disabled, onChange: this.handleChange, onBlur: this.handleBlur }), hasError && index.h("span", { key: '8788ac01739302f6ad61010b238ff38d45e1b68a', class: "mrd-datetime-field__error" }, this.error))));
|
|
824
858
|
}
|
|
825
859
|
static get watchers() { return {
|
|
826
860
|
"value": [{
|
|
@@ -830,6 +864,916 @@ const MrdDatetimeField = class {
|
|
|
830
864
|
};
|
|
831
865
|
MrdDatetimeField.style = mrdDatetimeFieldScss();
|
|
832
866
|
|
|
867
|
+
const mrdDocumentContainerScss = () => `.sc-mrd-document-container-h{display:block}.mrd-document-container__toolbar.sc-mrd-document-container{display:flex;align-items:center;justify-content:flex-end;gap:var(--mrd-space-2);padding:var(--mrd-space-2) var(--mrd-space-4);border-bottom:1px solid var(--mrd-color-neutral-100)}.mrd-document-container__action.sc-mrd-document-container{display:inline-flex;align-items:center;gap:var(--mrd-space-2);height:1.625rem;padding:0 var(--mrd-space-3);font-size:var(--mrd-font-size-sm);color:var(--mrd-color-neutral-700);background:var(--mrd-color-white);border:1px solid var(--mrd-color-neutral-200);border-radius:var(--mrd-border-radius);cursor:pointer;transition:background var(--mrd-transition-fast), border-color var(--mrd-transition-fast)}.mrd-document-container__action.sc-mrd-document-container svg.sc-mrd-document-container{width:1rem;height:1rem;color:#d9a441}.mrd-document-container__action.sc-mrd-document-container:hover:not(:disabled){background:var(--mrd-color-neutral-50);border-color:var(--mrd-color-neutral-300)}.mrd-document-container__action.sc-mrd-document-container:disabled{opacity:0.5;cursor:not-allowed}.mrd-document-container__seg.sc-mrd-document-container{display:inline-flex;gap:2px;padding:2px;background:var(--mrd-color-neutral-100);border-radius:var(--mrd-border-radius)}.mrd-document-container__seg-btn.sc-mrd-document-container{width:1.875rem;height:1.625rem;display:grid;place-items:center;border:none;background:none;border-radius:var(--mrd-border-radius-sm);color:var(--mrd-color-neutral-500);cursor:pointer;transition:color var(--mrd-transition-fast), background var(--mrd-transition-fast)}.mrd-document-container__seg-btn.sc-mrd-document-container:hover{color:var(--mrd-color-neutral-800)}.mrd-document-container__seg-btn[aria-pressed='true'].sc-mrd-document-container{background:var(--mrd-color-white);color:var(--mrd-color-primary-dark);box-shadow:var(--mrd-shadow-sm)}.mrd-document-container__seg-btn.sc-mrd-document-container svg.sc-mrd-document-container{width:1rem;height:1rem}`;
|
|
868
|
+
|
|
869
|
+
const MrdDocumentContainer = class {
|
|
870
|
+
constructor(hostRef) {
|
|
871
|
+
index.registerInstance(this, hostRef);
|
|
872
|
+
this.mrdLoadPage = index.createEvent(this, "mrdLoadPage");
|
|
873
|
+
this.mrdLoadDistinct = index.createEvent(this, "mrdLoadDistinct");
|
|
874
|
+
this.mrdLoadAggregations = index.createEvent(this, "mrdLoadAggregations");
|
|
875
|
+
this.mrdNavigate = index.createEvent(this, "mrdNavigate");
|
|
876
|
+
this.mrdAction = index.createEvent(this, "mrdAction");
|
|
877
|
+
this.mrdUpdateObject = index.createEvent(this, "mrdUpdateObject");
|
|
878
|
+
this.mrdUpload = index.createEvent(this, "mrdUpload");
|
|
879
|
+
this.mrdCreateObject = index.createEvent(this, "mrdCreateObject");
|
|
880
|
+
/** The VIEW or RELATED_VIEW layout item (dataClass, fromClass, view config). */
|
|
881
|
+
this.item = null;
|
|
882
|
+
/** Parent record id — required for RELATED_VIEW path building. */
|
|
883
|
+
this.parentId = '';
|
|
884
|
+
/** Lookup key used for the embedded `data-doclist` / `data-view` attributes. */
|
|
885
|
+
this.viewKey = '';
|
|
886
|
+
this.locale = navigator.language;
|
|
887
|
+
/** Active body: folder tree or flat table. */
|
|
888
|
+
this.mode = 'tree';
|
|
889
|
+
/** Whether the folder tree currently has a valid target for "New folder". */
|
|
890
|
+
this.canCreate = false;
|
|
891
|
+
/** Whether the currently mounted table has been init()'d. Reset on every mode switch. */
|
|
892
|
+
this.tableInited = false;
|
|
893
|
+
this.createFolder = () => {
|
|
894
|
+
var _a, _b;
|
|
895
|
+
(_b = (_a = this.listEl) === null || _a === void 0 ? void 0 : _a.createFolder) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
896
|
+
};
|
|
897
|
+
}
|
|
898
|
+
/** The embedded table does not self-load: like every mrd-table it waits for the
|
|
899
|
+
* host to call init() (which emits mrdLoadPage, and — once page 0 lands —
|
|
900
|
+
* mrdLoadAggregations). The section only init()s tables mounted at load time, so
|
|
901
|
+
* when the user switches to list view we init the freshly mounted table here. */
|
|
902
|
+
componentDidRender() {
|
|
903
|
+
var _a;
|
|
904
|
+
if (this.mode === 'list' && this.tableEl && !this.tableInited) {
|
|
905
|
+
this.tableInited = true;
|
|
906
|
+
const table = this.tableEl;
|
|
907
|
+
Promise.resolve((_a = table.componentOnReady) === null || _a === void 0 ? void 0 : _a.call(table)).then(() => { var _a; return (_a = table.init) === null || _a === void 0 ? void 0 : _a.call(table); });
|
|
908
|
+
}
|
|
909
|
+
}
|
|
910
|
+
setMode(mode) {
|
|
911
|
+
if (mode === this.mode)
|
|
912
|
+
return;
|
|
913
|
+
// The tree remounts on switch and re-emits mrdCanCreate; until then, disable.
|
|
914
|
+
this.canCreate = false;
|
|
915
|
+
// The table remounts on switch; re-init it once it is back in the DOM.
|
|
916
|
+
this.tableInited = false;
|
|
917
|
+
this.mode = mode;
|
|
918
|
+
}
|
|
919
|
+
// ── Toolbar ────────────────────────────────────────────────────────────────
|
|
920
|
+
renderToolbar() {
|
|
921
|
+
return (index.h("div", { class: "mrd-document-container__toolbar" }, this.mode === 'tree' && (index.h("button", { type: "button", class: "mrd-document-container__action", disabled: !this.canCreate, onClick: this.createFolder }, index.h("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true" }, index.h("path", { d: "M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z" }), index.h("path", { d: "M12 11v4M10 13h4" })), t('new_folder', this.locale))), index.h("div", { class: "mrd-document-container__seg", role: "group", "aria-label": t('doc_view_switch', this.locale) }, index.h("button", { class: "mrd-document-container__seg-btn", "aria-pressed": String(this.mode === 'tree'), title: t('doc_view_tree', this.locale), "aria-label": t('doc_view_tree', this.locale), onClick: () => this.setMode('tree') }, 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: t('doc_view_list', this.locale), "aria-label": 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" }))))));
|
|
922
|
+
}
|
|
923
|
+
// ── Bodies ───────────────────────────────────────────────────────────────
|
|
924
|
+
renderTree() {
|
|
925
|
+
return (index.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) => {
|
|
926
|
+
e.stopPropagation();
|
|
927
|
+
this.mrdLoadDistinct.emit(e.detail);
|
|
928
|
+
}, onMrdLoadPage: (e) => {
|
|
929
|
+
e.stopPropagation();
|
|
930
|
+
this.mrdLoadPage.emit(e.detail);
|
|
931
|
+
}, onMrdNavigate: (e) => {
|
|
932
|
+
e.stopPropagation();
|
|
933
|
+
this.mrdNavigate.emit(e.detail);
|
|
934
|
+
}, onMrdCanCreate: (e) => {
|
|
935
|
+
e.stopPropagation();
|
|
936
|
+
this.canCreate = e.detail;
|
|
937
|
+
}, onMrdUpdateObject: (e) => {
|
|
938
|
+
e.stopPropagation();
|
|
939
|
+
this.mrdUpdateObject.emit(e.detail);
|
|
940
|
+
}, onMrdUpload: (e) => {
|
|
941
|
+
e.stopPropagation();
|
|
942
|
+
this.mrdUpload.emit(e.detail);
|
|
943
|
+
}, onMrdCreateObject: (e) => {
|
|
944
|
+
e.stopPropagation();
|
|
945
|
+
this.mrdCreateObject.emit(e.detail);
|
|
946
|
+
} }));
|
|
947
|
+
}
|
|
948
|
+
renderList() {
|
|
949
|
+
return (index.h("mrd-table", { "data-view": this.viewKey, ref: el => (this.tableEl = el), item: this.item, parentId: this.parentId, locale: this.locale, onMrdLoadPage: (e) => {
|
|
950
|
+
e.stopPropagation();
|
|
951
|
+
this.mrdLoadPage.emit(e.detail);
|
|
952
|
+
}, onMrdLoadAggregations: (e) => {
|
|
953
|
+
e.stopPropagation();
|
|
954
|
+
this.mrdLoadAggregations.emit(e.detail);
|
|
955
|
+
}, onMrdRowClick: (e) => {
|
|
956
|
+
var _a, _b, _c;
|
|
957
|
+
e.stopPropagation();
|
|
958
|
+
const row = e.detail;
|
|
959
|
+
this.mrdNavigate.emit({ href: (_b = (_a = row === null || row === void 0 ? void 0 : row._links) === null || _a === void 0 ? void 0 : _a.self) === null || _b === void 0 ? void 0 : _b.href, label: (_c = row === null || row === void 0 ? void 0 : row.name) !== null && _c !== void 0 ? _c : '' });
|
|
960
|
+
}, onMrdAction: (e) => {
|
|
961
|
+
e.stopPropagation();
|
|
962
|
+
this.mrdAction.emit(e.detail);
|
|
963
|
+
} }));
|
|
964
|
+
}
|
|
965
|
+
render() {
|
|
966
|
+
return (index.h(index.Host, { key: 'a5393d484bdc202b57c6d32d9ce917e760aff95a' }, this.renderToolbar(), index.h("div", { key: '52f82de8f7734e13f34d323e3e831e6de5676f46', class: "mrd-document-container__body" }, this.mode === 'tree' ? this.renderTree() : this.renderList())));
|
|
967
|
+
}
|
|
968
|
+
get el() { return index.getElement(this); }
|
|
969
|
+
};
|
|
970
|
+
MrdDocumentContainer.style = mrdDocumentContainerScss();
|
|
971
|
+
|
|
972
|
+
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)}`;
|
|
973
|
+
|
|
974
|
+
const MrdDocumentList = class {
|
|
975
|
+
constructor(hostRef) {
|
|
976
|
+
index.registerInstance(this, hostRef);
|
|
977
|
+
this.mrdLoadDistinct = index.createEvent(this, "mrdLoadDistinct");
|
|
978
|
+
this.mrdLoadPage = index.createEvent(this, "mrdLoadPage");
|
|
979
|
+
this.mrdNavigate = index.createEvent(this, "mrdNavigate");
|
|
980
|
+
this.mrdCanCreate = index.createEvent(this, "mrdCanCreate");
|
|
981
|
+
this.mrdUpdateObject = index.createEvent(this, "mrdUpdateObject");
|
|
982
|
+
this.mrdUpload = index.createEvent(this, "mrdUpload");
|
|
983
|
+
this.mrdCreateObject = index.createEvent(this, "mrdCreateObject");
|
|
984
|
+
/** The VIEW or RELATED_VIEW layout item (dataClass, fromClass, view config). */
|
|
985
|
+
this.item = null;
|
|
986
|
+
/** Parent record id — required for RELATED_VIEW path building. */
|
|
987
|
+
this.parentId = '';
|
|
988
|
+
this.locale = navigator.language;
|
|
989
|
+
this.containers = [];
|
|
990
|
+
this.rootLoading = true;
|
|
991
|
+
/** True when the single-container level is collapsed away (dossier context). */
|
|
992
|
+
this.singleContainer = false;
|
|
993
|
+
/** Currently selected node id — the target for "New folder" and (later) drops. */
|
|
994
|
+
this.selectedId = null;
|
|
995
|
+
/** Node id currently highlighted as a drag-drop target (null = none). */
|
|
996
|
+
this.dropTargetId = null;
|
|
997
|
+
/** Node id showing an "uploading…" indicator while a dropped file is processed. */
|
|
998
|
+
this.uploadingNodeId = null;
|
|
999
|
+
this.nodeIndex = new Map();
|
|
1000
|
+
// ── New-folder editing state ───────────────────────────────────────────────
|
|
1001
|
+
/** The pending node whose inline name input is open (null = not creating). */
|
|
1002
|
+
this.pendingNode = null;
|
|
1003
|
+
/** The node the pending folder is being created under. */
|
|
1004
|
+
this.pendingParent = null;
|
|
1005
|
+
/** The container the pending folder belongs to. */
|
|
1006
|
+
this.pendingContainer = null;
|
|
1007
|
+
/** Current text in the inline name input. */
|
|
1008
|
+
this.pendingName = '';
|
|
1009
|
+
/** Ref to the inline input, so we can focus it after it mounts. */
|
|
1010
|
+
this.pendingInputEl = null;
|
|
1011
|
+
/** Set when a fresh input needs focus on the next render. */
|
|
1012
|
+
this.pendingNeedsFocus = false;
|
|
1013
|
+
/** Monotonic counter for unique temporary pending-node ids. */
|
|
1014
|
+
this.newFolderSeq = 0;
|
|
1015
|
+
/** Last emitted canCreateFolder value, to only emit mrdCanCreate on change. */
|
|
1016
|
+
this.lastCanCreate = false;
|
|
1017
|
+
// ── Drag & drop (move a document into another folder) ──────────────────────
|
|
1018
|
+
/** The document row currently being dragged. */
|
|
1019
|
+
this.dragDoc = null;
|
|
1020
|
+
/** Id of the node the dragged document currently lives in. */
|
|
1021
|
+
this.dragFromId = null;
|
|
1022
|
+
/** External file dropped onto a node, awaiting its upload to complete. */
|
|
1023
|
+
this.pendingUpload = null;
|
|
1024
|
+
/** The optimistic document row awaiting its self href from the create POST. */
|
|
1025
|
+
this.lastOptimisticDoc = null;
|
|
1026
|
+
this.startCreateFolder = () => {
|
|
1027
|
+
const resolved = this.resolveTarget();
|
|
1028
|
+
if (!resolved || this.pendingNode)
|
|
1029
|
+
return;
|
|
1030
|
+
const { target, container } = resolved;
|
|
1031
|
+
const tempId = `${container.id}/__new__${this.newFolderSeq++}`;
|
|
1032
|
+
const node = this.makeFolderNode(tempId, '', container.id);
|
|
1033
|
+
node.pending = true;
|
|
1034
|
+
node.editing = true;
|
|
1035
|
+
target.children = [...target.children, node];
|
|
1036
|
+
target.open = true;
|
|
1037
|
+
this.nodeIndex.set(node.id, node);
|
|
1038
|
+
this.pendingNode = node;
|
|
1039
|
+
this.pendingParent = target;
|
|
1040
|
+
this.pendingContainer = container;
|
|
1041
|
+
this.pendingName = '';
|
|
1042
|
+
this.pendingNeedsFocus = true;
|
|
1043
|
+
this.bump();
|
|
1044
|
+
};
|
|
1045
|
+
this.onPendingInput = (e) => {
|
|
1046
|
+
var _a;
|
|
1047
|
+
this.pendingName = e.target.value;
|
|
1048
|
+
if ((_a = this.pendingNode) === null || _a === void 0 ? void 0 : _a.error) {
|
|
1049
|
+
this.pendingNode.error = undefined;
|
|
1050
|
+
this.bump();
|
|
1051
|
+
}
|
|
1052
|
+
};
|
|
1053
|
+
this.onPendingKeyDown = (e) => {
|
|
1054
|
+
if (e.key === 'Enter') {
|
|
1055
|
+
e.preventDefault();
|
|
1056
|
+
this.commitFolder();
|
|
1057
|
+
}
|
|
1058
|
+
else if (e.key === 'Escape') {
|
|
1059
|
+
e.preventDefault();
|
|
1060
|
+
this.cancelFolder();
|
|
1061
|
+
}
|
|
1062
|
+
};
|
|
1063
|
+
// ── Drag & drop: move a document into another folder / container ────────────
|
|
1064
|
+
this.onDocDragStart = (e, doc, node) => {
|
|
1065
|
+
var _a, _b, _c;
|
|
1066
|
+
this.dragDoc = doc;
|
|
1067
|
+
this.dragFromId = node.id;
|
|
1068
|
+
if (e.dataTransfer) {
|
|
1069
|
+
e.dataTransfer.effectAllowed = 'move';
|
|
1070
|
+
// A payload is required for a drag to start in some browsers.
|
|
1071
|
+
e.dataTransfer.setData('text/plain', (_c = (_b = (_a = doc === null || doc === void 0 ? void 0 : doc._links) === null || _a === void 0 ? void 0 : _a.self) === null || _b === void 0 ? void 0 : _b.href) !== null && _c !== void 0 ? _c : '');
|
|
1072
|
+
}
|
|
1073
|
+
};
|
|
1074
|
+
this.onDocDragEnd = () => {
|
|
1075
|
+
this.dragDoc = null;
|
|
1076
|
+
this.dragFromId = null;
|
|
1077
|
+
if (this.dropTargetId !== null)
|
|
1078
|
+
this.dropTargetId = null;
|
|
1079
|
+
};
|
|
1080
|
+
/** A folder/container node (or a document inside it) accepts an internal move
|
|
1081
|
+
* or an external file drop. Always claims the event so it never bubbles to the
|
|
1082
|
+
* root drop-zone; a different node is highlighted (its own folder = no-op). */
|
|
1083
|
+
this.onNodeDragOver = (e, node) => {
|
|
1084
|
+
const file = this.isFileDrag(e);
|
|
1085
|
+
if (!this.dragDoc && !file)
|
|
1086
|
+
return;
|
|
1087
|
+
e.preventDefault();
|
|
1088
|
+
e.stopPropagation();
|
|
1089
|
+
if (e.dataTransfer)
|
|
1090
|
+
e.dataTransfer.dropEffect = file ? 'copy' : 'move';
|
|
1091
|
+
const target = !file && node.id === this.dragFromId ? null : node.id;
|
|
1092
|
+
if (this.dropTargetId !== target)
|
|
1093
|
+
this.dropTargetId = target;
|
|
1094
|
+
};
|
|
1095
|
+
this.onNodeDragLeave = (node) => {
|
|
1096
|
+
if (this.dropTargetId === node.id)
|
|
1097
|
+
this.dropTargetId = null;
|
|
1098
|
+
};
|
|
1099
|
+
this.onNodeDrop = (e, node, container) => {
|
|
1100
|
+
if (this.isFileDrag(e)) {
|
|
1101
|
+
e.preventDefault();
|
|
1102
|
+
e.stopPropagation();
|
|
1103
|
+
this.startFileUpload(e, node, container);
|
|
1104
|
+
return;
|
|
1105
|
+
}
|
|
1106
|
+
if (!this.dragDoc)
|
|
1107
|
+
return;
|
|
1108
|
+
e.preventDefault();
|
|
1109
|
+
e.stopPropagation();
|
|
1110
|
+
this.moveDocument(node, container);
|
|
1111
|
+
this.onDocDragEnd();
|
|
1112
|
+
};
|
|
1113
|
+
/** Root-zone drop (dossier context): target the single container's root. */
|
|
1114
|
+
this.onRootDragOver = (e) => {
|
|
1115
|
+
if (!this.singleContainer)
|
|
1116
|
+
return;
|
|
1117
|
+
const file = this.isFileDrag(e);
|
|
1118
|
+
if (!this.dragDoc && !file)
|
|
1119
|
+
return;
|
|
1120
|
+
e.preventDefault();
|
|
1121
|
+
if (e.dataTransfer)
|
|
1122
|
+
e.dataTransfer.dropEffect = file ? 'copy' : 'move';
|
|
1123
|
+
};
|
|
1124
|
+
this.onRootDrop = (e) => {
|
|
1125
|
+
if (!this.singleContainer)
|
|
1126
|
+
return;
|
|
1127
|
+
const only = this.containers[0];
|
|
1128
|
+
if (this.isFileDrag(e)) {
|
|
1129
|
+
e.preventDefault();
|
|
1130
|
+
this.startFileUpload(e, only, only);
|
|
1131
|
+
return;
|
|
1132
|
+
}
|
|
1133
|
+
if (!this.dragDoc)
|
|
1134
|
+
return;
|
|
1135
|
+
e.preventDefault();
|
|
1136
|
+
this.moveDocument(only, only);
|
|
1137
|
+
this.onDocDragEnd();
|
|
1138
|
+
};
|
|
1139
|
+
}
|
|
1140
|
+
componentDidLoad() {
|
|
1141
|
+
this.emitContainerDistinct();
|
|
1142
|
+
}
|
|
1143
|
+
componentDidRender() {
|
|
1144
|
+
if (this.pendingNeedsFocus && this.pendingInputEl) {
|
|
1145
|
+
this.pendingInputEl.focus();
|
|
1146
|
+
this.pendingInputEl.select();
|
|
1147
|
+
this.pendingNeedsFocus = false;
|
|
1148
|
+
}
|
|
1149
|
+
const can = this.canCreateFolder;
|
|
1150
|
+
if (can !== this.lastCanCreate) {
|
|
1151
|
+
this.lastCanCreate = can;
|
|
1152
|
+
this.mrdCanCreate.emit(can);
|
|
1153
|
+
}
|
|
1154
|
+
}
|
|
1155
|
+
// ── Slot field names ─────────────────────────────────────────────────────
|
|
1156
|
+
get containerField() {
|
|
1157
|
+
var _a, _b, _c;
|
|
1158
|
+
return (_c = (_b = (_a = this.archetype) === null || _a === void 0 ? void 0 : _a.slots) === null || _b === void 0 ? void 0 : _b.container) !== null && _c !== void 0 ? _c : 'container';
|
|
1159
|
+
}
|
|
1160
|
+
get folderField() {
|
|
1161
|
+
var _a, _b, _c;
|
|
1162
|
+
return (_c = (_b = (_a = this.archetype) === null || _a === void 0 ? void 0 : _a.slots) === null || _b === void 0 ? void 0 : _b.folder) !== null && _c !== void 0 ? _c : 'folder';
|
|
1163
|
+
}
|
|
1164
|
+
get titleField() {
|
|
1165
|
+
var _a, _b, _c;
|
|
1166
|
+
return (_c = (_b = (_a = this.archetype) === null || _a === void 0 ? void 0 : _a.slots) === null || _b === void 0 ? void 0 : _b.title) !== null && _c !== void 0 ? _c : 'name';
|
|
1167
|
+
}
|
|
1168
|
+
get fileField() {
|
|
1169
|
+
var _a, _b, _c;
|
|
1170
|
+
return (_c = (_b = (_a = this.archetype) === null || _a === void 0 ? void 0 : _a.slots) === null || _b === void 0 ? void 0 : _b.file) !== null && _c !== void 0 ? _c : 'file';
|
|
1171
|
+
}
|
|
1172
|
+
get dateField() {
|
|
1173
|
+
var _a, _b;
|
|
1174
|
+
return (_b = (_a = this.archetype) === null || _a === void 0 ? void 0 : _a.slots) === null || _b === void 0 ? void 0 : _b.date;
|
|
1175
|
+
}
|
|
1176
|
+
// ── Path / query building (mirrors mrd-table conventions) ────────────────
|
|
1177
|
+
/** VIEW: `/{dataClass}`; RELATED_VIEW: `/{fromClass}/{parentId}/{dataClass}`. */
|
|
1178
|
+
buildDataPath() {
|
|
1179
|
+
var _a, _b, _c;
|
|
1180
|
+
const it = this.item;
|
|
1181
|
+
const dataClass = (_b = (_a = it === null || it === void 0 ? void 0 : it.dataClass) !== null && _a !== void 0 ? _a : it === null || it === void 0 ? void 0 : it.relatedClass) !== null && _b !== void 0 ? _b : '';
|
|
1182
|
+
if ((it === null || it === void 0 ? void 0 : it.type) === index$1.ClientLayoutItemType.RELATED_VIEW) {
|
|
1183
|
+
return `/${(_c = it.fromClass) !== null && _c !== void 0 ? _c : ''}/${this.parentId}/${dataClass}`;
|
|
1184
|
+
}
|
|
1185
|
+
return `/${dataClass}`;
|
|
1186
|
+
}
|
|
1187
|
+
/** View-level static filters + filterClass, shared by every request. */
|
|
1188
|
+
baseParams() {
|
|
1189
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
1190
|
+
const p = new URLSearchParams();
|
|
1191
|
+
const filterClass = (_a = this.item) === null || _a === void 0 ? void 0 : _a.filterClass;
|
|
1192
|
+
if (filterClass)
|
|
1193
|
+
p.set('type', filterClass);
|
|
1194
|
+
for (const f of ((_d = (_c = (_b = this.item) === null || _b === void 0 ? void 0 : _b.view) === null || _c === void 0 ? void 0 : _c.filter) !== null && _d !== void 0 ? _d : [])) {
|
|
1195
|
+
if (!f.name)
|
|
1196
|
+
continue;
|
|
1197
|
+
if (f.operator === 'EMPTY') {
|
|
1198
|
+
p.set(f.name, '');
|
|
1199
|
+
continue;
|
|
1200
|
+
}
|
|
1201
|
+
if (f.operator === 'NOT_EMPTY') {
|
|
1202
|
+
p.set(f.name + '_notempty', 'true');
|
|
1203
|
+
continue;
|
|
1204
|
+
}
|
|
1205
|
+
if (f.operator === 'STARTS_WITH') {
|
|
1206
|
+
p.set(f.name + '_startswith', String((_e = f.value) !== null && _e !== void 0 ? _e : ''));
|
|
1207
|
+
continue;
|
|
1208
|
+
}
|
|
1209
|
+
if (f.operator === 'FROM') {
|
|
1210
|
+
p.set(f.name + '_from', String((_f = f.value) !== null && _f !== void 0 ? _f : ''));
|
|
1211
|
+
continue;
|
|
1212
|
+
}
|
|
1213
|
+
if (f.operator === 'TO') {
|
|
1214
|
+
p.set(f.name + '_to', String((_g = f.value) !== null && _g !== void 0 ? _g : ''));
|
|
1215
|
+
continue;
|
|
1216
|
+
}
|
|
1217
|
+
if (f.value != null) {
|
|
1218
|
+
p.set(f.name, String(f.value));
|
|
1219
|
+
}
|
|
1220
|
+
}
|
|
1221
|
+
return p;
|
|
1222
|
+
}
|
|
1223
|
+
emitContainerDistinct() {
|
|
1224
|
+
const p = this.baseParams();
|
|
1225
|
+
p.set('distinct', this.containerField);
|
|
1226
|
+
this.mrdLoadDistinct.emit({
|
|
1227
|
+
nodeId: MrdDocumentList.ROOT,
|
|
1228
|
+
distinct: this.containerField,
|
|
1229
|
+
path: this.buildDataPath() + '/distinct',
|
|
1230
|
+
qs: p.toString(),
|
|
1231
|
+
});
|
|
1232
|
+
}
|
|
1233
|
+
emitFolderDistinct(container) {
|
|
1234
|
+
var _a;
|
|
1235
|
+
const p = this.baseParams();
|
|
1236
|
+
p.set('distinct', this.folderField);
|
|
1237
|
+
p.set(this.containerField + '_href', (_a = container.href) !== null && _a !== void 0 ? _a : '');
|
|
1238
|
+
container.loading = true;
|
|
1239
|
+
this.mrdLoadDistinct.emit({
|
|
1240
|
+
nodeId: container.id,
|
|
1241
|
+
distinct: this.folderField,
|
|
1242
|
+
path: this.buildDataPath() + '/distinct',
|
|
1243
|
+
qs: p.toString(),
|
|
1244
|
+
});
|
|
1245
|
+
}
|
|
1246
|
+
emitDocuments(container, node) {
|
|
1247
|
+
var _a, _b;
|
|
1248
|
+
const p = this.baseParams();
|
|
1249
|
+
p.set(this.containerField + '_href', (_a = container.href) !== null && _a !== void 0 ? _a : '');
|
|
1250
|
+
p.set(this.folderField, (_b = node.fullPath) !== null && _b !== void 0 ? _b : '');
|
|
1251
|
+
node.loading = true;
|
|
1252
|
+
this.mrdLoadPage.emit({
|
|
1253
|
+
nodeId: node.id,
|
|
1254
|
+
page: 0,
|
|
1255
|
+
sort: '',
|
|
1256
|
+
path: this.buildDataPath(),
|
|
1257
|
+
qs: p.toString(),
|
|
1258
|
+
});
|
|
1259
|
+
}
|
|
1260
|
+
// ── Public injection API ─────────────────────────────────────────────────
|
|
1261
|
+
/** Inject distinct values for a node. `nodeId` is the sentinel root (containers)
|
|
1262
|
+
* or a container node id (folders). */
|
|
1263
|
+
async setDistinct(nodeId, values) {
|
|
1264
|
+
if (nodeId === MrdDocumentList.ROOT) {
|
|
1265
|
+
this.applyContainers(values);
|
|
1266
|
+
}
|
|
1267
|
+
else {
|
|
1268
|
+
this.applyFolders(nodeId, values);
|
|
1269
|
+
}
|
|
1270
|
+
}
|
|
1271
|
+
/** Inject the documents loaded for one folder node. */
|
|
1272
|
+
async setDocuments(nodeId, docs) {
|
|
1273
|
+
const node = this.nodeIndex.get(nodeId);
|
|
1274
|
+
if (!node)
|
|
1275
|
+
return;
|
|
1276
|
+
node.docs = docs !== null && docs !== void 0 ? docs : [];
|
|
1277
|
+
node.docsLoaded = true;
|
|
1278
|
+
node.loading = false;
|
|
1279
|
+
this.bump();
|
|
1280
|
+
}
|
|
1281
|
+
applyContainers(values) {
|
|
1282
|
+
const nodes = [];
|
|
1283
|
+
for (const v of values) {
|
|
1284
|
+
if (!v.value || typeof v.value !== 'object')
|
|
1285
|
+
continue;
|
|
1286
|
+
const href = v.value.href;
|
|
1287
|
+
const node = this.makeContainerNode(href, v.value.name, v.count);
|
|
1288
|
+
nodes.push(node);
|
|
1289
|
+
this.nodeIndex.set(node.id, node);
|
|
1290
|
+
}
|
|
1291
|
+
this.containers = nodes;
|
|
1292
|
+
this.rootLoading = false;
|
|
1293
|
+
this.singleContainer = nodes.length === 1;
|
|
1294
|
+
// Single container (dossier context): collapse the level away, load its folders now.
|
|
1295
|
+
if (this.singleContainer) {
|
|
1296
|
+
const only = nodes[0];
|
|
1297
|
+
only.open = true;
|
|
1298
|
+
this.emitFolderDistinct(only);
|
|
1299
|
+
}
|
|
1300
|
+
}
|
|
1301
|
+
applyFolders(containerId, values) {
|
|
1302
|
+
const container = this.nodeIndex.get(containerId);
|
|
1303
|
+
if (!container)
|
|
1304
|
+
return;
|
|
1305
|
+
container.children = [];
|
|
1306
|
+
container.hasDocs = false;
|
|
1307
|
+
container.docCount = 0;
|
|
1308
|
+
for (const v of values) {
|
|
1309
|
+
const raw = typeof v.value === 'string' ? v.value : v.value == null ? '' : String(v.value);
|
|
1310
|
+
const segs = this.splitFolder(raw);
|
|
1311
|
+
if (segs.length === 0) {
|
|
1312
|
+
// Root documents — the container's own direct documents.
|
|
1313
|
+
container.hasDocs = true;
|
|
1314
|
+
container.docCount = v.count;
|
|
1315
|
+
container.fullPath = raw;
|
|
1316
|
+
continue;
|
|
1317
|
+
}
|
|
1318
|
+
let node = container;
|
|
1319
|
+
const acc = [];
|
|
1320
|
+
for (const seg of segs) {
|
|
1321
|
+
acc.push(seg);
|
|
1322
|
+
let child = node.children.find(c => c.label === seg);
|
|
1323
|
+
if (!child) {
|
|
1324
|
+
child = this.makeFolderNode(container.id + '/' + acc.join('/'), seg, container.id);
|
|
1325
|
+
node.children.push(child);
|
|
1326
|
+
this.nodeIndex.set(child.id, child);
|
|
1327
|
+
}
|
|
1328
|
+
node = child;
|
|
1329
|
+
}
|
|
1330
|
+
node.hasDocs = true;
|
|
1331
|
+
node.docCount = v.count;
|
|
1332
|
+
node.fullPath = raw;
|
|
1333
|
+
}
|
|
1334
|
+
this.computeTotals(container);
|
|
1335
|
+
container.foldersLoaded = true;
|
|
1336
|
+
container.loading = false;
|
|
1337
|
+
// If the container has root documents, load them now (they show inline on expand).
|
|
1338
|
+
if (container.hasDocs && !container.docsLoaded) {
|
|
1339
|
+
this.emitDocuments(container, container);
|
|
1340
|
+
}
|
|
1341
|
+
this.bump();
|
|
1342
|
+
}
|
|
1343
|
+
// ── Tree helpers ─────────────────────────────────────────────────────────
|
|
1344
|
+
/** Normalise a folder path: null/""/"/" → root ([]); else split on "/" dropping empties. */
|
|
1345
|
+
splitFolder(path) {
|
|
1346
|
+
if (path == null)
|
|
1347
|
+
return [];
|
|
1348
|
+
const s = String(path).trim();
|
|
1349
|
+
if (s === '' || s === '/')
|
|
1350
|
+
return [];
|
|
1351
|
+
return s.split('/').map(x => x.trim()).filter(Boolean);
|
|
1352
|
+
}
|
|
1353
|
+
makeContainerNode(href, label, count) {
|
|
1354
|
+
return {
|
|
1355
|
+
id: 'c:' + href, kind: 'container', label, href,
|
|
1356
|
+
hasDocs: false, docCount: 0, totalCount: count, children: [],
|
|
1357
|
+
open: false, loading: false, foldersLoaded: false, docsLoaded: false, docs: [],
|
|
1358
|
+
};
|
|
1359
|
+
}
|
|
1360
|
+
makeFolderNode(id, label, containerId) {
|
|
1361
|
+
return {
|
|
1362
|
+
id, kind: 'folder', label, containerId,
|
|
1363
|
+
hasDocs: false, docCount: 0, totalCount: 0, children: [],
|
|
1364
|
+
open: false, loading: false, foldersLoaded: false, docsLoaded: false, docs: [],
|
|
1365
|
+
};
|
|
1366
|
+
}
|
|
1367
|
+
computeTotals(node) {
|
|
1368
|
+
let total = node.docCount;
|
|
1369
|
+
for (const c of node.children)
|
|
1370
|
+
total += this.computeTotals(c);
|
|
1371
|
+
node.totalCount = total;
|
|
1372
|
+
return total;
|
|
1373
|
+
}
|
|
1374
|
+
/** Force a re-render after mutating nodes in place. */
|
|
1375
|
+
bump() {
|
|
1376
|
+
this.containers = [...this.containers];
|
|
1377
|
+
}
|
|
1378
|
+
// ── Interaction ──────────────────────────────────────────────────────────
|
|
1379
|
+
toggleContainer(node) {
|
|
1380
|
+
this.selectedId = node.id;
|
|
1381
|
+
node.open = !node.open;
|
|
1382
|
+
if (node.open && !node.foldersLoaded && !node.loading) {
|
|
1383
|
+
this.emitFolderDistinct(node);
|
|
1384
|
+
}
|
|
1385
|
+
this.bump();
|
|
1386
|
+
}
|
|
1387
|
+
toggleFolder(container, node) {
|
|
1388
|
+
this.selectedId = node.id;
|
|
1389
|
+
node.open = !node.open;
|
|
1390
|
+
if (node.open && node.hasDocs && !node.docsLoaded && !node.loading) {
|
|
1391
|
+
this.emitDocuments(container, node);
|
|
1392
|
+
}
|
|
1393
|
+
this.bump();
|
|
1394
|
+
}
|
|
1395
|
+
// ── New folder (client-side pending, materialises on document drop) ─────────
|
|
1396
|
+
/** Resolve the node a new folder should be created under, and its container.
|
|
1397
|
+
* Uses the current selection; falls back to the single container (dossier). */
|
|
1398
|
+
resolveTarget() {
|
|
1399
|
+
if (this.selectedId) {
|
|
1400
|
+
const n = this.nodeIndex.get(this.selectedId);
|
|
1401
|
+
if (n && n.kind === 'container')
|
|
1402
|
+
return { target: n, container: n };
|
|
1403
|
+
if (n && n.kind === 'folder') {
|
|
1404
|
+
const container = n.containerId ? this.nodeIndex.get(n.containerId) : undefined;
|
|
1405
|
+
if (container)
|
|
1406
|
+
return { target: n, container };
|
|
1407
|
+
}
|
|
1408
|
+
}
|
|
1409
|
+
if (this.singleContainer && this.containers[0]) {
|
|
1410
|
+
const only = this.containers[0];
|
|
1411
|
+
return { target: only, container: only };
|
|
1412
|
+
}
|
|
1413
|
+
return null;
|
|
1414
|
+
}
|
|
1415
|
+
get canCreateFolder() {
|
|
1416
|
+
return !this.pendingNode && this.resolveTarget() !== null;
|
|
1417
|
+
}
|
|
1418
|
+
/** Start creating a folder under the current target. Called by the host toolbar
|
|
1419
|
+
* (mrd-document-container). No-op when there is no valid target. */
|
|
1420
|
+
async createFolder() {
|
|
1421
|
+
this.startCreateFolder();
|
|
1422
|
+
}
|
|
1423
|
+
/** Folder path segments of a node relative to its container (derived from its id). */
|
|
1424
|
+
segmentsOf(node, container) {
|
|
1425
|
+
if (node.kind === 'container')
|
|
1426
|
+
return [];
|
|
1427
|
+
const prefix = container.id + '/';
|
|
1428
|
+
const rest = node.id.startsWith(prefix) ? node.id.slice(prefix.length) : '';
|
|
1429
|
+
return rest ? rest.split('/') : [];
|
|
1430
|
+
}
|
|
1431
|
+
commitFolder() {
|
|
1432
|
+
const node = this.pendingNode;
|
|
1433
|
+
const parent = this.pendingParent;
|
|
1434
|
+
const container = this.pendingContainer;
|
|
1435
|
+
if (!node || !parent || !container)
|
|
1436
|
+
return;
|
|
1437
|
+
const name = this.pendingName.trim();
|
|
1438
|
+
if (!name) {
|
|
1439
|
+
this.cancelFolder();
|
|
1440
|
+
return;
|
|
1441
|
+
}
|
|
1442
|
+
if (name.includes('/')) {
|
|
1443
|
+
node.error = t('folder_no_slash', this.locale);
|
|
1444
|
+
this.bump();
|
|
1445
|
+
return;
|
|
1446
|
+
}
|
|
1447
|
+
const dup = parent.children.some(c => c !== node && c.label.toLowerCase() === name.toLowerCase());
|
|
1448
|
+
if (dup) {
|
|
1449
|
+
node.error = t('folder_duplicate', this.locale);
|
|
1450
|
+
this.bump();
|
|
1451
|
+
return;
|
|
1452
|
+
}
|
|
1453
|
+
// Finalise: swap the temp id for the real path-derived id so a later distinct
|
|
1454
|
+
// value with the same folder string merges onto this node.
|
|
1455
|
+
const segs = [...this.segmentsOf(parent, container), name];
|
|
1456
|
+
this.nodeIndex.delete(node.id);
|
|
1457
|
+
node.id = container.id + '/' + segs.join('/');
|
|
1458
|
+
node.fullPath = '/' + segs.join('/');
|
|
1459
|
+
node.label = name;
|
|
1460
|
+
node.editing = false;
|
|
1461
|
+
node.error = undefined;
|
|
1462
|
+
node.open = true;
|
|
1463
|
+
this.nodeIndex.set(node.id, node);
|
|
1464
|
+
this.selectedId = node.id;
|
|
1465
|
+
this.clearPending();
|
|
1466
|
+
this.bump();
|
|
1467
|
+
}
|
|
1468
|
+
cancelFolder() {
|
|
1469
|
+
const node = this.pendingNode;
|
|
1470
|
+
const parent = this.pendingParent;
|
|
1471
|
+
if (node && parent) {
|
|
1472
|
+
parent.children = parent.children.filter(c => c !== node);
|
|
1473
|
+
this.nodeIndex.delete(node.id);
|
|
1474
|
+
}
|
|
1475
|
+
this.clearPending();
|
|
1476
|
+
this.bump();
|
|
1477
|
+
}
|
|
1478
|
+
clearPending() {
|
|
1479
|
+
this.pendingNode = null;
|
|
1480
|
+
this.pendingParent = null;
|
|
1481
|
+
this.pendingContainer = null;
|
|
1482
|
+
this.pendingName = '';
|
|
1483
|
+
this.pendingInputEl = null;
|
|
1484
|
+
this.pendingNeedsFocus = false;
|
|
1485
|
+
}
|
|
1486
|
+
/** True when the drag carries external files (an OS file drop, not an internal move). */
|
|
1487
|
+
isFileDrag(e) {
|
|
1488
|
+
return !this.dragDoc && !!e.dataTransfer && Array.from(e.dataTransfer.types).includes('Files');
|
|
1489
|
+
}
|
|
1490
|
+
// ── External file drop → upload → create document ──────────────────────────
|
|
1491
|
+
/** Begin an upload: emit mrdUpload; the host uploads and calls setFileReference. */
|
|
1492
|
+
startFileUpload(e, node, container) {
|
|
1493
|
+
var _a, _b;
|
|
1494
|
+
const file = (_b = (_a = e.dataTransfer) === null || _a === void 0 ? void 0 : _a.files) === null || _b === void 0 ? void 0 : _b[0]; // single file per drop
|
|
1495
|
+
this.dropTargetId = null;
|
|
1496
|
+
if (!file)
|
|
1497
|
+
return;
|
|
1498
|
+
this.pendingUpload = { file, node, container };
|
|
1499
|
+
node.open = true;
|
|
1500
|
+
this.uploadingNodeId = node.id;
|
|
1501
|
+
this.bump();
|
|
1502
|
+
this.mrdUpload.emit({ file });
|
|
1503
|
+
}
|
|
1504
|
+
/** Strip a single trailing extension for the document title. */
|
|
1505
|
+
stripExtension(name) {
|
|
1506
|
+
return name.replace(/\.[^./\\]+$/, '');
|
|
1507
|
+
}
|
|
1508
|
+
/** Host callback with the uploaded file reference. Builds the create payload
|
|
1509
|
+
* from the archetype slots and requests the new document. */
|
|
1510
|
+
async setFileReference(uri) {
|
|
1511
|
+
const up = this.pendingUpload;
|
|
1512
|
+
if (!up)
|
|
1513
|
+
return;
|
|
1514
|
+
const { file, node, container } = up;
|
|
1515
|
+
const folder = this.folderStringOf(node, container);
|
|
1516
|
+
const values = {
|
|
1517
|
+
[this.fileField]: uri,
|
|
1518
|
+
[this.titleField]: this.stripExtension(file.name),
|
|
1519
|
+
[this.folderField]: folder,
|
|
1520
|
+
[this.containerField]: container.href,
|
|
1521
|
+
};
|
|
1522
|
+
this.mrdCreateObject.emit({ path: this.buildDataPath(), values });
|
|
1523
|
+
// Optimistically show the new document (no href until a reload).
|
|
1524
|
+
const optimistic = { [this.titleField]: this.stripExtension(file.name), _optimistic: true };
|
|
1525
|
+
const wasUnloadedEmpty = !node.docsLoaded && node.docCount === 0;
|
|
1526
|
+
node.hasDocs = true;
|
|
1527
|
+
node.pending = false;
|
|
1528
|
+
node.docCount += 1;
|
|
1529
|
+
if (wasUnloadedEmpty) {
|
|
1530
|
+
node.docsLoaded = true;
|
|
1531
|
+
node.docs = [optimistic];
|
|
1532
|
+
}
|
|
1533
|
+
else if (node.docsLoaded)
|
|
1534
|
+
node.docs = [...node.docs, optimistic];
|
|
1535
|
+
this.recomputeContainerTotals(container, 1);
|
|
1536
|
+
this.lastOptimisticDoc = optimistic;
|
|
1537
|
+
this.pendingUpload = null;
|
|
1538
|
+
this.uploadingNodeId = null;
|
|
1539
|
+
this.bump();
|
|
1540
|
+
}
|
|
1541
|
+
/** Host callback with the created document's self href, so the optimistic row
|
|
1542
|
+
* becomes navigable without waiting for a reload. */
|
|
1543
|
+
async setCreatedHref(href) {
|
|
1544
|
+
var _a;
|
|
1545
|
+
const doc = this.lastOptimisticDoc;
|
|
1546
|
+
if (!doc || !href)
|
|
1547
|
+
return;
|
|
1548
|
+
doc._links = Object.assign(Object.assign({}, ((_a = doc._links) !== null && _a !== void 0 ? _a : {})), { self: { href } });
|
|
1549
|
+
doc._optimistic = false;
|
|
1550
|
+
this.lastOptimisticDoc = null;
|
|
1551
|
+
this.bump();
|
|
1552
|
+
}
|
|
1553
|
+
/** Folder string a node represents: the raw distinct value when it holds
|
|
1554
|
+
* documents, else derived from its path segments; null for a container root. */
|
|
1555
|
+
folderStringOf(node, container) {
|
|
1556
|
+
if (node.kind === 'container')
|
|
1557
|
+
return null;
|
|
1558
|
+
if (node.fullPath != null && node.fullPath !== '')
|
|
1559
|
+
return node.fullPath;
|
|
1560
|
+
const segs = this.segmentsOf(node, container);
|
|
1561
|
+
return segs.length ? '/' + segs.join('/') : null;
|
|
1562
|
+
}
|
|
1563
|
+
moveDocument(toNode, toContainer) {
|
|
1564
|
+
var _a, _b;
|
|
1565
|
+
const doc = this.dragDoc;
|
|
1566
|
+
const fromNode = this.dragFromId ? this.nodeIndex.get(this.dragFromId) : undefined;
|
|
1567
|
+
if (!doc || !fromNode)
|
|
1568
|
+
return;
|
|
1569
|
+
const fromContainer = fromNode.kind === 'container'
|
|
1570
|
+
? fromNode
|
|
1571
|
+
: (fromNode.containerId ? this.nodeIndex.get(fromNode.containerId) : undefined);
|
|
1572
|
+
if (!fromContainer)
|
|
1573
|
+
return;
|
|
1574
|
+
const targetFolder = this.folderStringOf(toNode, toContainer);
|
|
1575
|
+
const sourceFolder = this.folderStringOf(fromNode, fromContainer);
|
|
1576
|
+
const sameContainer = toContainer === fromContainer;
|
|
1577
|
+
// No-op: dropped back onto its own folder.
|
|
1578
|
+
if (toNode === fromNode || (sameContainer && targetFolder === sourceFolder))
|
|
1579
|
+
return;
|
|
1580
|
+
// ── Optimistic tree update (fire-and-forget; no refetch) ──
|
|
1581
|
+
fromNode.docs = fromNode.docs.filter(d => d !== doc);
|
|
1582
|
+
fromNode.docCount = Math.max(0, fromNode.docCount - 1);
|
|
1583
|
+
// A now-empty folder should stop showing an expand chevron (it disappears on
|
|
1584
|
+
// the next reload anyway, since it is derived from document folder strings).
|
|
1585
|
+
if (fromNode.docsLoaded)
|
|
1586
|
+
fromNode.hasDocs = fromNode.docs.length > 0;
|
|
1587
|
+
toNode.hasDocs = true;
|
|
1588
|
+
toNode.pending = false; // a pending folder is now materialised
|
|
1589
|
+
toNode.docCount += 1;
|
|
1590
|
+
if (toNode.kind === 'folder')
|
|
1591
|
+
toNode.fullPath = targetFolder !== null && targetFolder !== void 0 ? targetFolder : '';
|
|
1592
|
+
if (toNode.docsLoaded)
|
|
1593
|
+
toNode.docs = [...toNode.docs, doc];
|
|
1594
|
+
this.recomputeContainerTotals(fromContainer, -1);
|
|
1595
|
+
if (!sameContainer)
|
|
1596
|
+
this.recomputeContainerTotals(toContainer, 1);
|
|
1597
|
+
// ── Emit the generic update; host PATCHes the document ──
|
|
1598
|
+
const href = (_b = (_a = doc === null || doc === void 0 ? void 0 : doc._links) === null || _a === void 0 ? void 0 : _a.self) === null || _b === void 0 ? void 0 : _b.href;
|
|
1599
|
+
if (href) {
|
|
1600
|
+
const values = { [this.folderField]: targetFolder };
|
|
1601
|
+
if (!sameContainer)
|
|
1602
|
+
values[this.containerField] = toContainer.href;
|
|
1603
|
+
this.mrdUpdateObject.emit({ href, values });
|
|
1604
|
+
}
|
|
1605
|
+
this.bump();
|
|
1606
|
+
}
|
|
1607
|
+
/** Recompute a container's subtree totals from docCounts when its folders are
|
|
1608
|
+
* loaded; otherwise just nudge the aggregate badge by the delta. */
|
|
1609
|
+
recomputeContainerTotals(container, delta) {
|
|
1610
|
+
if (container.foldersLoaded) {
|
|
1611
|
+
this.computeTotals(container);
|
|
1612
|
+
}
|
|
1613
|
+
else {
|
|
1614
|
+
container.totalCount = Math.max(0, container.totalCount + delta);
|
|
1615
|
+
}
|
|
1616
|
+
}
|
|
1617
|
+
openDoc(doc) {
|
|
1618
|
+
var _a, _b, _c, _d;
|
|
1619
|
+
const href = (_b = (_a = doc === null || doc === void 0 ? void 0 : doc._links) === null || _a === void 0 ? void 0 : _a.self) === null || _b === void 0 ? void 0 : _b.href;
|
|
1620
|
+
const label = (_d = (_c = doc === null || doc === void 0 ? void 0 : doc[this.titleField]) !== null && _c !== void 0 ? _c : doc === null || doc === void 0 ? void 0 : doc.name) !== null && _d !== void 0 ? _d : '';
|
|
1621
|
+
this.mrdNavigate.emit({ href, label });
|
|
1622
|
+
}
|
|
1623
|
+
// ── Render ───────────────────────────────────────────────────────────────
|
|
1624
|
+
renderChevron(open, leaf) {
|
|
1625
|
+
return (index.h("span", { class: `mrd-document-list__chev${leaf ? ' mrd-document-list__chev--leaf' : ''}${open ? ' mrd-document-list__chev--open' : ''}` }, 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: "M9 6l6 6-6 6" }))));
|
|
1626
|
+
}
|
|
1627
|
+
renderDossierIcon() {
|
|
1628
|
+
return (index.h("svg", { class: "mrd-document-list__icon mrd-document-list__icon--dossier", 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" })));
|
|
1629
|
+
}
|
|
1630
|
+
renderFolderIcon() {
|
|
1631
|
+
return (index.h("svg", { class: "mrd-document-list__icon mrd-document-list__icon--folder", 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" })));
|
|
1632
|
+
}
|
|
1633
|
+
renderDocIcon() {
|
|
1634
|
+
return (index.h("svg", { class: "mrd-document-list__icon mrd-document-list__icon--doc", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true" }, index.h("path", { d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" }), index.h("path", { d: "M14 2v6h6" })));
|
|
1635
|
+
}
|
|
1636
|
+
indent(depth) {
|
|
1637
|
+
return index.h("span", { class: "mrd-document-list__indent", style: { width: `${depth * 18}px` } });
|
|
1638
|
+
}
|
|
1639
|
+
renderDocRow(doc, node, container, depth) {
|
|
1640
|
+
var _a, _b, _c, _d, _e;
|
|
1641
|
+
const label = (_b = (_a = doc === null || doc === void 0 ? void 0 : doc[this.titleField]) !== null && _a !== void 0 ? _a : doc === null || doc === void 0 ? void 0 : doc.name) !== null && _b !== void 0 ? _b : '';
|
|
1642
|
+
const dateRaw = this.dateField ? doc === null || doc === void 0 ? void 0 : doc[this.dateField] : undefined;
|
|
1643
|
+
const date = dateRaw ? formatDate(dateRaw, this.locale) : '';
|
|
1644
|
+
return (index.h("div", { class: "mrd-document-list__row mrd-document-list__row--doc", key: (_e = (_d = (_c = doc === null || doc === void 0 ? void 0 : doc._links) === null || _c === void 0 ? void 0 : _c.self) === null || _d === void 0 ? void 0 : _d.href) !== null && _e !== void 0 ? _e : label, draggable: true, onClick: () => this.openDoc(doc), onDragStart: (e) => this.onDocDragStart(e, doc, node), onDragEnd: this.onDocDragEnd, onDragOver: (e) => this.onNodeDragOver(e, node), onDragLeave: () => this.onNodeDragLeave(node), onDrop: (e) => this.onNodeDrop(e, node, container) }, this.indent(depth), this.renderChevron(false, true), this.renderDocIcon(), index.h("span", { class: "mrd-document-list__label" }, label), date && index.h("span", { class: "mrd-document-list__date" }, date)));
|
|
1645
|
+
}
|
|
1646
|
+
renderLoadingRow(depth) {
|
|
1647
|
+
return (index.h("div", { class: "mrd-document-list__loading", key: "loading" }, this.indent(depth), index.h("span", { class: "mrd-document-list__spinner" }), t('loading', this.locale)));
|
|
1648
|
+
}
|
|
1649
|
+
renderChildren(container, node, depth) {
|
|
1650
|
+
const out = [];
|
|
1651
|
+
// Direct documents of this node (root docs live on the container node).
|
|
1652
|
+
if (node.hasDocs) {
|
|
1653
|
+
if (node.docsLoaded) {
|
|
1654
|
+
for (const doc of node.docs)
|
|
1655
|
+
out.push(this.renderDocRow(doc, node, container, depth));
|
|
1656
|
+
}
|
|
1657
|
+
else if (node.loading) {
|
|
1658
|
+
out.push(this.renderLoadingRow(depth));
|
|
1659
|
+
}
|
|
1660
|
+
}
|
|
1661
|
+
// Child folders.
|
|
1662
|
+
for (const child of node.children) {
|
|
1663
|
+
out.push(this.renderFolderNode(container, child, depth));
|
|
1664
|
+
}
|
|
1665
|
+
// An uploading file dropped onto this node.
|
|
1666
|
+
if (node.id === this.uploadingNodeId)
|
|
1667
|
+
out.push(this.renderUploadingRow(depth));
|
|
1668
|
+
return out;
|
|
1669
|
+
}
|
|
1670
|
+
renderUploadingRow(depth) {
|
|
1671
|
+
return (index.h("div", { class: "mrd-document-list__loading", key: "uploading" }, this.indent(depth), index.h("span", { class: "mrd-document-list__spinner" }), t('upload_file', this.locale)));
|
|
1672
|
+
}
|
|
1673
|
+
renderFolderEditRow(node, depth) {
|
|
1674
|
+
return (index.h("div", { class: "mrd-document-list__node", key: node.id }, index.h("div", { class: "mrd-document-list__row mrd-document-list__row--edit" }, this.indent(depth), this.renderChevron(false, true), this.renderFolderIcon(), index.h("input", { class: "mrd-document-list__name-input", type: "text", placeholder: t('folder_name_placeholder', this.locale), ref: el => (this.pendingInputEl = el), onInput: this.onPendingInput, onKeyDown: this.onPendingKeyDown, onBlur: () => this.cancelFolder() })), node.error && (index.h("div", { class: "mrd-document-list__error", style: { paddingLeft: `${depth * 18 + 52}px` } }, node.error))));
|
|
1675
|
+
}
|
|
1676
|
+
renderFolderNode(container, node, depth) {
|
|
1677
|
+
if (node.editing)
|
|
1678
|
+
return this.renderFolderEditRow(node, depth);
|
|
1679
|
+
const leaf = node.children.length === 0 && !node.hasDocs;
|
|
1680
|
+
const selected = node.id === this.selectedId;
|
|
1681
|
+
const cls = 'mrd-document-list__row'
|
|
1682
|
+
+ (selected ? ' mrd-document-list__row--selected' : '')
|
|
1683
|
+
+ (node.pending ? ' mrd-document-list__row--pending' : '')
|
|
1684
|
+
+ (node.id === this.dropTargetId ? ' mrd-document-list__row--drop' : '');
|
|
1685
|
+
return (index.h("div", { class: "mrd-document-list__node", key: node.id }, index.h("div", { class: cls, onClick: () => this.toggleFolder(container, node), onDragOver: (e) => this.onNodeDragOver(e, node), onDragLeave: () => this.onNodeDragLeave(node), onDrop: (e) => this.onNodeDrop(e, node, container) }, this.indent(depth), this.renderChevron(node.open, leaf), this.renderFolderIcon(), index.h("span", { class: "mrd-document-list__label" }, node.label), index.h("span", { class: "mrd-document-list__count" }, node.totalCount)), node.open && index.h("div", { class: "mrd-document-list__kids" }, this.renderChildren(container, node, depth + 1))));
|
|
1686
|
+
}
|
|
1687
|
+
renderContainerNode(node, depth) {
|
|
1688
|
+
const selected = node.id === this.selectedId;
|
|
1689
|
+
const cls = 'mrd-document-list__row mrd-document-list__row--dossier'
|
|
1690
|
+
+ (selected ? ' mrd-document-list__row--selected' : '')
|
|
1691
|
+
+ (node.id === this.dropTargetId ? ' mrd-document-list__row--drop' : '');
|
|
1692
|
+
return (index.h("div", { class: "mrd-document-list__node", key: node.id }, index.h("div", { class: cls, onClick: () => this.toggleContainer(node), onDragOver: (e) => this.onNodeDragOver(e, node), onDragLeave: () => this.onNodeDragLeave(node), onDrop: (e) => this.onNodeDrop(e, node, node) }, this.indent(depth), this.renderChevron(node.open, false), this.renderDossierIcon(), index.h("span", { class: "mrd-document-list__label" }, node.label), index.h("span", { class: "mrd-document-list__count" }, node.totalCount)), node.open && (index.h("div", { class: "mrd-document-list__kids" }, node.loading && !node.foldersLoaded
|
|
1693
|
+
? this.renderLoadingRow(depth + 1)
|
|
1694
|
+
: this.renderChildren(node, node, depth + 1)))));
|
|
1695
|
+
}
|
|
1696
|
+
render() {
|
|
1697
|
+
let body;
|
|
1698
|
+
if (this.rootLoading) {
|
|
1699
|
+
body = this.renderLoadingRow(0);
|
|
1700
|
+
}
|
|
1701
|
+
else if (this.containers.length === 0) {
|
|
1702
|
+
body = index.h("div", { key: 'b8c3297cd7cff5bf79ce694d2ee1a64c570df5ce', class: "mrd-document-list__empty" }, t('no_results', this.locale));
|
|
1703
|
+
}
|
|
1704
|
+
else if (this.singleContainer) {
|
|
1705
|
+
// Dossier context: render the single container's folder tree at the root.
|
|
1706
|
+
const only = this.containers[0];
|
|
1707
|
+
body = only.loading && !only.foldersLoaded
|
|
1708
|
+
? this.renderLoadingRow(0)
|
|
1709
|
+
: this.renderChildren(only, only, 0);
|
|
1710
|
+
}
|
|
1711
|
+
else {
|
|
1712
|
+
body = this.containers.map(c => this.renderContainerNode(c, 0));
|
|
1713
|
+
}
|
|
1714
|
+
return (index.h(index.Host, { key: 'ff3b024a79ba2270aa28861923bc6406f98061aa' }, index.h("div", { key: '9db121e5336a4e3c82443257f6424db5ab4f0baf', class: "mrd-document-list", onDragOver: this.onRootDragOver, onDrop: this.onRootDrop }, body)));
|
|
1715
|
+
}
|
|
1716
|
+
get el() { return index.getElement(this); }
|
|
1717
|
+
};
|
|
1718
|
+
/** Root sentinel id for the container-level distinct request. */
|
|
1719
|
+
MrdDocumentList.ROOT = '__root__';
|
|
1720
|
+
MrdDocumentList.style = mrdDocumentListScss();
|
|
1721
|
+
|
|
1722
|
+
const mrdDocumentViewScss = () => `.sc-mrd-document-view-h{display:block}.mrd-document-view.sc-mrd-document-view{max-width:720px}.mrd-document-view__crumb.sc-mrd-document-view{display:inline-flex;align-items:center;gap:var(--mrd-space-2);margin-bottom:var(--mrd-space-4);padding:var(--mrd-space-1) var(--mrd-space-3);background:var(--mrd-color-primary-light);border:1px solid transparent;border-radius:var(--mrd-border-radius);font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-sm);color:var(--mrd-color-primary-dark);cursor:pointer}.mrd-document-view__crumb.sc-mrd-document-view:hover{border-color:var(--mrd-color-primary)}.mrd-document-view__crumb-icon.sc-mrd-document-view{width:0.875rem;height:0.875rem;flex-shrink:0}.mrd-document-view__title.sc-mrd-document-view{font-size:var(--mrd-font-size-2xl);font-weight:var(--mrd-font-weight-bold);color:var(--mrd-color-neutral-900);letter-spacing:-0.02em;margin:0 0 var(--mrd-space-1) 0}.mrd-document-view__date.sc-mrd-document-view{font-size:var(--mrd-font-size-sm);color:var(--mrd-color-neutral-400);font-variant-numeric:tabular-nums;margin:0 0 var(--mrd-space-6) 0}.mrd-document-view__file.sc-mrd-document-view{display:flex;align-items:center;gap:var(--mrd-space-4);padding:var(--mrd-space-4);border:1px solid var(--mrd-border-color);border-radius:var(--mrd-border-radius-md);background:var(--mrd-color-neutral-50);margin-bottom:var(--mrd-space-6)}.mrd-document-view__file-preview.sc-mrd-document-view{width:2.875rem;height:3.625rem;flex-shrink:0;display:grid;place-items:center;border-radius:var(--mrd-border-radius-sm);background:var(--mrd-color-white);border:1px solid var(--mrd-border-color);color:var(--mrd-color-danger);box-shadow:var(--mrd-shadow-sm)}.mrd-document-view__file-preview.sc-mrd-document-view svg.sc-mrd-document-view{width:1.5rem;height:1.5rem}.mrd-document-view__file-meta.sc-mrd-document-view{flex:1;min-width:0}.mrd-document-view__file-name.sc-mrd-document-view{font-weight:var(--mrd-font-weight-semibold);font-size:var(--mrd-font-size-sm);color:var(--mrd-color-neutral-800);word-break:break-word}.mrd-document-view__download.sc-mrd-document-view{display:inline-flex;align-items:center;gap:var(--mrd-space-2);flex-shrink:0;height:2rem;padding:0 var(--mrd-space-3);background:var(--mrd-color-white);border:1px solid var(--mrd-color-neutral-300);border-radius:var(--mrd-border-radius);font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-sm);font-weight:var(--mrd-font-weight-medium);color:var(--mrd-color-neutral-700);cursor:pointer}.mrd-document-view__download.sc-mrd-document-view:hover{background:var(--mrd-color-neutral-100);color:var(--mrd-color-neutral-900)}.mrd-document-view__download.sc-mrd-document-view svg.sc-mrd-document-view{width:0.9375rem;height:0.9375rem}.mrd-document-view__summary-body.sc-mrd-document-view{font-size:var(--mrd-font-size-base);color:var(--mrd-color-neutral-700);line-height:var(--mrd-line-height-relaxed)}`;
|
|
1723
|
+
|
|
1724
|
+
const MrdDocumentView = class {
|
|
1725
|
+
constructor(hostRef) {
|
|
1726
|
+
index.registerInstance(this, hostRef);
|
|
1727
|
+
this.mrdNavigate = index.createEvent(this, "mrdNavigate");
|
|
1728
|
+
this.mrdDownload = index.createEvent(this, "mrdDownload");
|
|
1729
|
+
/** The data record from the /data endpoint. Fields keyed by name; relations under `_links`. */
|
|
1730
|
+
this.data = {};
|
|
1731
|
+
this.locale = navigator.language;
|
|
1732
|
+
}
|
|
1733
|
+
/** Value of a value-slot: reads data[field] via the slot→field map. */
|
|
1734
|
+
slotValue(slot) {
|
|
1735
|
+
var _a, _b;
|
|
1736
|
+
const field = (_b = (_a = this.archetype) === null || _a === void 0 ? void 0 : _a.slots) === null || _b === void 0 ? void 0 : _b[slot];
|
|
1737
|
+
if (!field)
|
|
1738
|
+
return undefined;
|
|
1739
|
+
return this.data[field];
|
|
1740
|
+
}
|
|
1741
|
+
/** Relation link for a relation-slot: reads data._links[field]. */
|
|
1742
|
+
slotLink(slot) {
|
|
1743
|
+
var _a, _b, _c, _d;
|
|
1744
|
+
const field = (_b = (_a = this.archetype) === null || _a === void 0 ? void 0 : _a.slots) === null || _b === void 0 ? void 0 : _b[slot];
|
|
1745
|
+
if (!field)
|
|
1746
|
+
return undefined;
|
|
1747
|
+
const links = ((_d = (_c = this.data) === null || _c === void 0 ? void 0 : _c._links) !== null && _d !== void 0 ? _d : {});
|
|
1748
|
+
return links[field];
|
|
1749
|
+
}
|
|
1750
|
+
renderContainer() {
|
|
1751
|
+
const link = this.slotLink('container');
|
|
1752
|
+
if (!(link === null || link === void 0 ? void 0 : link.href) || !link.name)
|
|
1753
|
+
return null;
|
|
1754
|
+
return (index.h("button", { class: "mrd-document-view__crumb", onClick: () => this.mrdNavigate.emit({ href: link.href, label: link.name }) }, index.h("svg", { class: "mrd-document-view__crumb-icon", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true" }, index.h("path", { d: "M19 12H5M12 19l-7-7 7-7" })), link.name));
|
|
1755
|
+
}
|
|
1756
|
+
renderFile() {
|
|
1757
|
+
var _a, _b;
|
|
1758
|
+
const raw = this.slotValue('file');
|
|
1759
|
+
if (!raw)
|
|
1760
|
+
return null;
|
|
1761
|
+
const href = (_a = raw === null || raw === void 0 ? void 0 : raw.href) !== null && _a !== void 0 ? _a : '';
|
|
1762
|
+
const fileName = (_b = raw === null || raw === void 0 ? void 0 : raw.fileName) !== null && _b !== void 0 ? _b : String(raw);
|
|
1763
|
+
return (index.h("div", { class: "mrd-document-view__file" }, index.h("div", { class: "mrd-document-view__file-preview", "aria-hidden": "true" }, index.h("svg", { viewBox: "0 0 24 24", fill: "currentColor" }, index.h("path", { d: "M6 2a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8l-6-6H6zm7 1.5L18.5 9H13V3.5z" }))), index.h("div", { class: "mrd-document-view__file-meta" }, index.h("span", { class: "mrd-document-view__file-name" }, fileName)), href && (index.h("button", { class: "mrd-document-view__download", onClick: () => this.mrdDownload.emit({ href, fileName }) }, index.h("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true" }, index.h("path", { d: "M12 3v12m0 0l-4-4m4 4l4-4M4 21h16" })), t('download', this.locale)))));
|
|
1764
|
+
}
|
|
1765
|
+
render() {
|
|
1766
|
+
const titleRaw = this.slotValue('title');
|
|
1767
|
+
const title = titleRaw != null && titleRaw !== '' ? String(titleRaw) : null;
|
|
1768
|
+
const dateRaw = this.slotValue('date');
|
|
1769
|
+
const date = dateRaw != null && dateRaw !== '' ? formatDate(dateRaw, this.locale) : null;
|
|
1770
|
+
const summaryRaw = this.slotValue('summary');
|
|
1771
|
+
const summary = summaryRaw != null && summaryRaw !== '' ? String(summaryRaw) : null;
|
|
1772
|
+
return (index.h(index.Host, { key: '0a2071925ecdb21738376d66fa4babf4590e694c' }, index.h("div", { key: 'a2d29c0b6e211cab142adc780466bc885a602e96', class: "mrd-document-view" }, this.renderContainer(), title && index.h("h1", { key: '7f5ac202c21bc8a70f0dd15e2e1fa06e651b5bce', class: "mrd-document-view__title" }, title), date && index.h("p", { key: 'b1dce94d5fd8bfd5e078644f631a38f91b87e7ff', class: "mrd-document-view__date" }, date), this.renderFile(), summary && (index.h("div", { key: '588b9ca40a49ae9ea303852620bde75333b440ab', class: "mrd-document-view__summary" }, index.h("div", { key: 'd3b8adb85ac346b72451e789c10aedd539c966de', class: "mrd-document-view__summary-body", innerHTML: summary }))))));
|
|
1773
|
+
}
|
|
1774
|
+
};
|
|
1775
|
+
MrdDocumentView.style = mrdDocumentViewScss();
|
|
1776
|
+
|
|
833
1777
|
const mrdEmailFieldScss = () => `.sc-mrd-email-field-h{display:block}.mrd-email-field.sc-mrd-email-field{display:flex;flex-direction:column;gap:var(--mrd-space-1);width:100%}.mrd-email-field__label.sc-mrd-email-field{display:block;font-family:var(--mrd-font-family);font-size:var(--mrd-label-font-size);font-weight:var(--mrd-label-font-weight);color:var(--mrd-label-color)}.mrd-email-field__label--required.sc-mrd-email-field::after{content:' *';color:var(--mrd-color-danger)}.mrd-email-field__input.sc-mrd-email-field{display:block;width:100%;height:var(--mrd-input-height);padding:var(--mrd-input-padding-y) var(--mrd-input-padding-x);font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-base);color:var(--mrd-input-color);background-color:var(--mrd-input-bg);border:var(--mrd-border-width) solid var(--mrd-border-color);border-radius:var(--mrd-border-radius);transition:border-color var(--mrd-transition), box-shadow var(--mrd-transition);outline:none;appearance:none;box-sizing:border-box}.mrd-email-field__input.sc-mrd-email-field::placeholder{color:var(--mrd-input-placeholder-color)}.mrd-email-field__input.sc-mrd-email-field:focus{border-color:var(--mrd-border-color-focus);box-shadow:var(--mrd-shadow-focus)}.mrd-email-field__input.sc-mrd-email-field:disabled{background-color:var(--mrd-input-bg-disabled);cursor:not-allowed;opacity:0.7}.mrd-email-field__input--error.sc-mrd-email-field{border-color:var(--mrd-border-color-error)}.mrd-email-field__input--error.sc-mrd-email-field:focus{box-shadow:var(--mrd-shadow-focus-error)}.mrd-email-field__error.sc-mrd-email-field{font-family:var(--mrd-font-family);font-size:var(--mrd-error-font-size);color:var(--mrd-error-color)}`;
|
|
834
1778
|
|
|
835
1779
|
const MrdEmailField = class {
|
|
@@ -865,7 +1809,7 @@ const MrdEmailField = class {
|
|
|
865
1809
|
}
|
|
866
1810
|
render() {
|
|
867
1811
|
const hasError = !!this.error;
|
|
868
|
-
return (index.h(index.Host, { key: '
|
|
1812
|
+
return (index.h(index.Host, { key: '0d442ab2a711c26c83fcdbf0fd8cd006d8dd8649' }, index.h("div", { key: 'ceb2a80679514c4c5b888fe096c90ed6cc973f64', class: "mrd-email-field" }, this.label && (index.h("label", { key: '663f95eff1002ee56cfc3104514bf31b47e26750', class: `mrd-email-field__label${this.required ? ' mrd-email-field__label--required' : ''}` }, this.label)), index.h("input", { key: '42dbdec25a47b37cfd68d00d0b8a481f96fe8241', class: `mrd-email-field__input${hasError ? ' mrd-email-field__input--error' : ''}`, type: "email", name: this.name, value: this.value, placeholder: this.placeholder || 'name@example.com', required: this.required, disabled: this.disabled, onInput: this.handleInput, onBlur: this.handleBlur }), hasError && index.h("span", { key: '626ee856ceaa7051fb9dd1de8b7cbd708e83f617', class: "mrd-email-field__error" }, this.error))));
|
|
869
1813
|
}
|
|
870
1814
|
};
|
|
871
1815
|
MrdEmailField.style = mrdEmailFieldScss();
|
|
@@ -1148,7 +2092,7 @@ const MrdFileField = class {
|
|
|
1148
2092
|
hasError ? 'mrd-file-field__zone--error' : '',
|
|
1149
2093
|
this.disabled || this.uploading ? 'mrd-file-field__zone--disabled' : '',
|
|
1150
2094
|
].filter(Boolean).join(' ');
|
|
1151
|
-
return (index.h(index.Host, { key: '
|
|
2095
|
+
return (index.h(index.Host, { key: '095bb39f3cb1680cf5e7e51bdfd06d8eb087f237' }, index.h("div", { key: '7e5b5fe6e63b6530221083c8bcb82bcac59a5fe7', class: "mrd-file-field" }, this.label && (index.h("label", { key: 'c34723f4199371d6fe8ea87463d878b89c038590', class: `mrd-file-field__label${this.required ? ' mrd-file-field__label--required' : ''}` }, this.label)), index.h("div", { key: '4727667345d3cd4a5c65a431744a09f366943c13', class: zoneClass, onClick: this.handleZoneClick, onDragOver: this.handleDragOver, onDragLeave: this.handleDragLeave, onDrop: this.handleDrop }, index.h("input", { key: '45ed41c0f094dbe269561c8586e473f908cdf4a4', ref: el => (this.fileInputRef = el), class: "mrd-file-field__input", type: "file", name: this.name, accept: this.accept, disabled: this.disabled || this.uploading, required: this.required && !hasFile, onChange: this.handleInputChange }), hasFile ? (index.h("div", { class: "mrd-file-field__selected" }, this.uploading ? (index.h("span", { class: "mrd-file-field__spinner", "aria-label": t('loading', this.locale) })) : (index.h("svg", { class: "mrd-file-field__icon", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2" }, index.h("path", { d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" }), index.h("polyline", { points: "14 2 14 8 20 8" }))), index.h("span", { class: "mrd-file-field__filename" }, this.fileName), !this.uploading && (index.h("button", { class: "mrd-file-field__clear", type: "button", onClick: this.handleClear, "aria-label": t('clear', this.locale) }, "\u2715")))) : (index.h("div", { class: "mrd-file-field__prompt" }, index.h("svg", { class: "mrd-file-field__upload-icon", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2" }, index.h("polyline", { points: "16 16 12 12 8 16" }), index.h("line", { x1: "12", y1: "12", x2: "12", y2: "21" }), index.h("path", { d: "M20.39 18.39A5 5 0 0 0 18 9h-1.26A8 8 0 1 0 3 16.3" })), index.h("span", null, t('drop_file_here', this.locale), ' ', index.h("span", { class: "mrd-file-field__browse" }, t('browse', this.locale)))))), hasError && index.h("span", { key: '00ce94ead3c32ed63e903cfd9d8480084a308d84', class: "mrd-file-field__error" }, this.error))));
|
|
1152
2096
|
}
|
|
1153
2097
|
static get watchers() { return {
|
|
1154
2098
|
"value": [{
|
|
@@ -1709,7 +2653,7 @@ const MrdImageField = class {
|
|
|
1709
2653
|
hasError ? 'mrd-image-field__zone--error' : '',
|
|
1710
2654
|
this.disabled || this.uploading ? 'mrd-image-field__zone--disabled' : '',
|
|
1711
2655
|
].filter(Boolean).join(' ');
|
|
1712
|
-
return (index.h(index.Host, { key: '
|
|
2656
|
+
return (index.h(index.Host, { key: '97db2df72839f36b7a46e153a5dd1c208c52b522' }, index.h("div", { key: 'c8f2d3d858f90d322d26082aaf5adb57acfc78f4', class: "mrd-image-field" }, this.label && (index.h("label", { key: '6625e5031ff0b7c06f76c1ea0387f1bd5c1858a4', class: `mrd-image-field__label${this.required ? ' mrd-image-field__label--required' : ''}` }, this.label)), index.h("div", { key: '364216e6a96e845e21c42e821fdff02bd2612ff8', class: zoneClass, onClick: this.handleZoneClick, onDragOver: this.handleDragOver, onDragLeave: this.handleDragLeave, onDrop: this.handleDrop }, index.h("input", { key: '0487706ddd9f48cda1cb0c2a178809d90674486b', ref: el => (this.fileInputRef = el), class: "mrd-image-field__input", type: "file", name: this.name, accept: this.accept, disabled: this.disabled || this.uploading, required: this.required && !this.previewUrl, onChange: this.handleInputChange }), this.previewUrl ? (index.h("div", { class: "mrd-image-field__preview-container" }, index.h("div", { class: "mrd-image-field__preview-thumb" }, index.h("img", { class: "mrd-image-field__preview", src: this.previewUrl, alt: this.fileName }), this.uploading && index.h("div", { class: "mrd-image-field__preview-overlay" }, index.h("span", { class: "mrd-image-field__spinner" }))), index.h("div", { class: "mrd-image-field__preview-info" }, index.h("span", { class: "mrd-image-field__preview-name" }, this.fileName), this.uploading && (index.h("span", { class: "mrd-image-field__upload-status" }, t('loading', this.locale)))), !this.uploading && (index.h("button", { class: "mrd-image-field__clear", type: "button", onClick: this.handleClear, "aria-label": t('clear', this.locale) }, t('remove', this.locale))))) : (index.h("div", { class: "mrd-image-field__prompt" }, index.h("svg", { class: "mrd-image-field__upload-icon", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2" }, index.h("rect", { x: "3", y: "3", width: "18", height: "18", rx: "2", ry: "2" }), index.h("circle", { cx: "8.5", cy: "8.5", r: "1.5" }), index.h("polyline", { points: "21 15 16 10 5 21" })), index.h("span", null, t('drop_file_here', this.locale), ' ', index.h("span", { class: "mrd-image-field__browse" }, t('browse', this.locale)))))), hasError && index.h("span", { key: 'bd505ef4f4b67c4e9138d8825c6e600f583f4cab', class: "mrd-image-field__error" }, this.error))));
|
|
1713
2657
|
}
|
|
1714
2658
|
static get watchers() { return {
|
|
1715
2659
|
"value": [{
|
|
@@ -1823,7 +2767,7 @@ class CellRenderer {
|
|
|
1823
2767
|
}
|
|
1824
2768
|
}
|
|
1825
2769
|
|
|
1826
|
-
const mrdLayoutSectionScss = () => `.mrd-layout-section.sc-mrd-layout-section{font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-base);color:var(--mrd-color-neutral-800)}.mrd-layout-section__field.sc-mrd-layout-section{display:grid;grid-template-columns:200px 1fr;align-items:baseline;gap:0 var(--mrd-space-2);padding:var(--mrd-space-1) 0}.mrd-layout-section__field-label.sc-mrd-layout-section{font-size:var(--mrd-font-size-xs);font-weight:var(--mrd-font-weight-normal);color:var(--mrd-color-neutral-500);padding-top:1px}.mrd-layout-section__field-value.sc-mrd-layout-section{font-size:var(--mrd-font-size-sm);font-weight:var(--mrd-font-weight-medium);color:var(--mrd-color-neutral-800);word-break:break-word;display:inline-flex;align-items:center;gap:var(--mrd-space-1)}.mrd-layout-section__history-wrap.sc-mrd-layout-section{position:relative;display:inline-flex;align-items:center}.mrd-layout-section__history-btn.sc-mrd-layout-section{display:inline-flex;align-items:center;justify-content:center;width:1.25rem;height:1.25rem;padding:0;background:transparent;border:none;border-radius:var(--mrd-border-radius-sm);color:var(--mrd-color-neutral-400);cursor:pointer;flex-shrink:0;transition:color var(--mrd-transition-fast), background-color var(--mrd-transition-fast)}.mrd-layout-section__history-btn.sc-mrd-layout-section:hover{color:var(--mrd-color-neutral-700);background-color:var(--mrd-color-neutral-100)}.mrd-layout-section__history-btn.sc-mrd-layout-section:focus{outline:none;box-shadow:var(--mrd-shadow-focus)}.mrd-layout-section__history-icon.sc-mrd-layout-section{width:0.875rem;height:0.875rem}.mrd-layout-section__history-popover.sc-mrd-layout-section{position:absolute;top:calc(100% + 0.25rem);left:0;min-width:24rem;max-width:24rem;background-color:var(--mrd-color-white);border:var(--mrd-border-width) solid var(--mrd-border-color);border-radius:var(--mrd-border-radius-md);box-shadow:var(--mrd-shadow-md);padding:var(--mrd-space-1) 0;z-index:var(--mrd-z-dropdown)}.mrd-layout-section__history-entry.sc-mrd-layout-section{font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-sm);font-weight:var(--mrd-font-weight-normal);color:var(--mrd-color-neutral-700);padding:var(--mrd-space-2) var(--mrd-space-3);line-height:var(--mrd-line-height-normal)}.mrd-layout-section__history-entry.sc-mrd-layout-section:not(:last-child){border-bottom:var(--mrd-border-width) solid var(--mrd-color-neutral-100)}.mrd-layout-section__field-header.sc-mrd-layout-section{font-size:var(--mrd-font-size-2xl);font-weight:var(--mrd-font-weight-bold);color:var(--mrd-color-neutral-900);margin:0 0 var(--mrd-space-4) 0;padding:0}.mrd-layout-section__header.sc-mrd-layout-section{font-size:var(--mrd-font-size-xl);font-weight:var(--mrd-font-weight-semibold);color:var(--mrd-color-neutral-800);margin:var(--mrd-space-4) 0 var(--mrd-space-2) 0;padding:0}.mrd-layout-section__text.sc-mrd-layout-section{font-size:var(--mrd-font-size-base);color:var(--mrd-color-neutral-700);line-height:var(--mrd-line-height-relaxed);margin:var(--mrd-space-2) 0}.mrd-layout-section__navigate.sc-mrd-layout-section{display:inline-flex;align-items:center;gap:var(--mrd-space-2);padding:var(--mrd-space-2) var(--mrd-space-3);background:none;border:1px solid var(--mrd-color-neutral-300);border-radius:var(--mrd-border-radius);font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-sm);color:var(--mrd-color-primary);cursor:pointer;margin:var(--mrd-space-2) 0}.mrd-layout-section__navigate.sc-mrd-layout-section:hover{background-color:var(--mrd-color-primary-light);border-color:var(--mrd-color-primary)}.mrd-layout-section__link.sc-mrd-layout-section{color:var(--mrd-color-primary);text-decoration:none}.mrd-layout-section__link.sc-mrd-layout-section:hover{text-decoration:underline}.mrd-layout-section__relation-link.sc-mrd-layout-section{background:none;border:none;padding:0;font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-sm);font-weight:var(--mrd-font-weight-semibold);color:var(--mrd-color-primary);cursor:pointer;text-align:left}.mrd-layout-section__relation-link.sc-mrd-layout-section:hover{text-decoration:underline}.mrd-layout-section__download-link.sc-mrd-layout-section{display:inline-flex;align-items:center;gap:var(--mrd-space-1);background:none;border:none;padding:0;font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-sm);color:var(--mrd-color-primary);cursor:pointer;text-align:left}.mrd-layout-section__download-link.sc-mrd-layout-section:hover{text-decoration:underline;color:var(--mrd-color-primary-dark)}.mrd-layout-section__file-icon.sc-mrd-layout-section{flex-shrink:0;width:1rem;height:1rem}.mrd-layout-section__boolean--true.sc-mrd-layout-section{color:var(--mrd-color-success);font-weight:var(--mrd-font-weight-semibold)}.mrd-layout-section__boolean--false.sc-mrd-layout-section{color:var(--mrd-color-neutral-400)}.mrd-layout-section__field--block.sc-mrd-layout-section{grid-template-columns:1fr}.mrd-layout-section__badge.sc-mrd-layout-section{display:inline-block;font-size:var(--mrd-font-size-xs);font-weight:var(--mrd-font-weight-medium);padding:2px var(--mrd-space-3);border-radius:10px}.mrd-layout-section__badge-dot-row.sc-mrd-layout-section{display:inline-flex;align-items:center;gap:var(--mrd-space-2)}.mrd-layout-section__badge-dot.sc-mrd-layout-section{display:inline-block;width:10px;height:10px;border-radius:50%;flex-shrink:0}.mrd-layout-section__secret-masked.sc-mrd-layout-section{font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-base);color:var(--mrd-label-color);letter-spacing:0.15em;user-select:none;pointer-events:none}.mrd-layout-section__pre.sc-mrd-layout-section{font-family:var(--mrd-font-family-mono);font-size:var(--mrd-font-size-xs);background-color:var(--mrd-color-neutral-50);border:1px solid var(--mrd-color-neutral-200);border-radius:var(--mrd-border-radius);padding:var(--mrd-space-3);margin:0;max-height:calc(10 * 1.5 * var(--mrd-font-size-xs));overflow-x:auto;overflow-y:auto;white-space:pre-wrap;word-break:break-word}.mrd-layout-section__group.sc-mrd-layout-section{margin:var(--mrd-space-4) 0}.mrd-layout-section__group-title.sc-mrd-layout-section{font-size:var(--mrd-font-size-sm);font-weight:var(--mrd-font-weight-semibold);color:var(--mrd-color-neutral-500);margin:0 0 var(--mrd-space-2) 0;padding-bottom:0;text-transform:uppercase;letter-spacing:0.05em}.mrd-layout-section__related-view.sc-mrd-layout-section{margin:var(--mrd-space-4) 0}.mrd-layout-section__related-view-title.sc-mrd-layout-section{font-size:var(--mrd-font-size-lg);font-weight:var(--mrd-font-weight-semibold);color:var(--mrd-color-neutral-800);margin:0 0 var(--mrd-space-3) 0}.mrd-layout-section__search.sc-mrd-layout-section{position:relative;margin:var(--mrd-space-2) 0}.mrd-layout-section__search-wrap.sc-mrd-layout-section{position:relative}.mrd-layout-section__search-icon.sc-mrd-layout-section{position:absolute;left:var(--mrd-input-padding-x);top:50%;transform:translateY(-50%);width:1rem;height:1rem;color:var(--mrd-color-neutral-400);pointer-events:none}.mrd-layout-section__search-input.sc-mrd-layout-section{display:block;width:100%;height:var(--mrd-input-height);padding:var(--mrd-input-padding-y) var(--mrd-input-padding-x) var(--mrd-input-padding-y) calc(var(--mrd-input-padding-x) + 1rem + var(--mrd-space-2));font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-base);color:var(--mrd-input-color);background-color:var(--mrd-input-bg);border:var(--mrd-border-width) solid var(--mrd-border-color);border-radius:var(--mrd-border-radius);outline:none;appearance:none;box-sizing:border-box}.mrd-layout-section__search-input.sc-mrd-layout-section:focus{border-color:var(--mrd-border-color-focus);box-shadow:var(--mrd-shadow-focus)}.mrd-layout-section__search-input.sc-mrd-layout-section::placeholder{color:var(--mrd-input-placeholder-color)}.mrd-layout-section__search-results.sc-mrd-layout-section{position:absolute;top:100%;left:0;right:0;background-color:var(--mrd-color-white);border:1px solid var(--mrd-color-neutral-300);border-top:none;border-radius:0 0 var(--mrd-border-radius) var(--mrd-border-radius);box-shadow:var(--mrd-shadow-sm);z-index:100;max-height:300px;overflow-y:auto;list-style:none;margin:0;padding:var(--mrd-space-1) 0}.mrd-layout-section__search-result.sc-mrd-layout-section{margin:0;padding:0}.mrd-layout-section__search-result-btn.sc-mrd-layout-section{display:flex;flex-direction:column;width:100%;padding:var(--mrd-space-2) var(--mrd-space-3);background:none;border:none;text-align:left;cursor:pointer;font-family:var(--mrd-font-family)}.mrd-layout-section__search-result-btn.sc-mrd-layout-section:hover{background-color:var(--mrd-color-primary-light)}.mrd-layout-section__search-result-label.sc-mrd-layout-section{font-size:var(--mrd-font-size-sm);font-weight:var(--mrd-font-weight-medium);color:var(--mrd-color-neutral-800)}.mrd-layout-section__search-result-desc.sc-mrd-layout-section{font-size:var(--mrd-font-size-xs);color:var(--mrd-color-neutral-500);margin-top:var(--mrd-space-1)}.mrd-layout-section__image-thumb-btn.sc-mrd-layout-section{background:none;border:none;padding:0;cursor:pointer;display:inline-block;border-radius:var(--mrd-border-radius);overflow:hidden;line-height:0}.mrd-layout-section__image-thumb-btn.sc-mrd-layout-section:hover .mrd-layout-section__image-thumb.sc-mrd-layout-section{opacity:0.85}.mrd-layout-section__image-thumb.sc-mrd-layout-section{display:block;max-width:160px;max-height:100px;border-radius:var(--mrd-border-radius);object-fit:cover;transition:opacity 0.15s}.mrd-layout-section__modal-backdrop.sc-mrd-layout-section{position:fixed;inset:0;background:rgba(0, 0, 0, 0.6);z-index:300;display:flex;align-items:center;justify-content:center}.mrd-layout-section__modal.sc-mrd-layout-section{position:relative;background:#fff;border-radius:var(--mrd-border-radius);padding:var(--mrd-space-3);max-width:min(90vw, 900px);max-height:90vh;display:flex;align-items:center;justify-content:center;box-shadow:var(--mrd-shadow-lg)}.mrd-layout-section__modal-close.sc-mrd-layout-section{position:absolute;top:var(--mrd-space-2);right:var(--mrd-space-2);background:rgba(0, 0, 0, 0.5);border:none;border-radius:50%;width:28px;height:28px;display:flex;align-items:center;justify-content:center;color:#fff;cursor:pointer;font-size:var(--mrd-font-size-sm);line-height:1;z-index:1}.mrd-layout-section__modal-close.sc-mrd-layout-section:hover{background:rgba(0, 0, 0, 0.8)}.mrd-layout-section__modal-image.sc-mrd-layout-section{display:block;max-width:100%;max-height:calc(90vh - 2rem);border-radius:var(--mrd-border-radius);object-fit:contain}`;
|
|
2770
|
+
const mrdLayoutSectionScss = () => `.mrd-layout-section.sc-mrd-layout-section{font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-base);color:var(--mrd-color-neutral-800)}.mrd-layout-section__field.sc-mrd-layout-section{display:grid;grid-template-columns:200px 1fr;align-items:baseline;gap:0 var(--mrd-space-2);padding:var(--mrd-space-1) 0}.mrd-layout-section__field-label.sc-mrd-layout-section{font-size:var(--mrd-font-size-xs);font-weight:var(--mrd-font-weight-normal);color:var(--mrd-color-neutral-500);padding-top:1px}.mrd-layout-section__field-value.sc-mrd-layout-section{font-size:var(--mrd-font-size-sm);font-weight:var(--mrd-font-weight-medium);color:var(--mrd-color-neutral-800);word-break:break-word;display:inline-flex;align-items:center;gap:var(--mrd-space-1)}.mrd-layout-section__history-wrap.sc-mrd-layout-section{position:relative;display:inline-flex;align-items:center}.mrd-layout-section__history-btn.sc-mrd-layout-section{display:inline-flex;align-items:center;justify-content:center;width:1.25rem;height:1.25rem;padding:0;background:transparent;border:none;border-radius:var(--mrd-border-radius-sm);color:var(--mrd-color-neutral-400);cursor:pointer;flex-shrink:0;transition:color var(--mrd-transition-fast), background-color var(--mrd-transition-fast)}.mrd-layout-section__history-btn.sc-mrd-layout-section:hover{color:var(--mrd-color-neutral-700);background-color:var(--mrd-color-neutral-100)}.mrd-layout-section__history-btn.sc-mrd-layout-section:focus{outline:none;box-shadow:var(--mrd-shadow-focus)}.mrd-layout-section__history-icon.sc-mrd-layout-section{width:0.875rem;height:0.875rem}.mrd-layout-section__history-popover.sc-mrd-layout-section{position:absolute;top:calc(100% + 0.25rem);left:0;min-width:24rem;max-width:24rem;background-color:var(--mrd-color-white);border:var(--mrd-border-width) solid var(--mrd-border-color);border-radius:var(--mrd-border-radius-md);box-shadow:var(--mrd-shadow-md);padding:var(--mrd-space-1) 0;z-index:var(--mrd-z-dropdown)}.mrd-layout-section__history-entry.sc-mrd-layout-section{font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-sm);font-weight:var(--mrd-font-weight-normal);color:var(--mrd-color-neutral-700);padding:var(--mrd-space-2) var(--mrd-space-3);line-height:var(--mrd-line-height-normal)}.mrd-layout-section__history-entry.sc-mrd-layout-section:not(:last-child){border-bottom:var(--mrd-border-width) solid var(--mrd-color-neutral-100)}.mrd-layout-section__field-header.sc-mrd-layout-section{font-size:var(--mrd-font-size-2xl);font-weight:var(--mrd-font-weight-bold);color:var(--mrd-color-neutral-900);margin:0 0 var(--mrd-space-4) 0;padding:0}.mrd-layout-section__header.sc-mrd-layout-section{font-size:var(--mrd-font-size-xl);font-weight:var(--mrd-font-weight-semibold);color:var(--mrd-color-neutral-800);margin:var(--mrd-space-4) 0 var(--mrd-space-2) 0;padding:0}.mrd-layout-section__text.sc-mrd-layout-section{font-size:var(--mrd-font-size-base);color:var(--mrd-color-neutral-700);line-height:var(--mrd-line-height-relaxed);margin:var(--mrd-space-2) 0}.mrd-layout-section__navigate.sc-mrd-layout-section{display:inline-flex;align-items:center;gap:var(--mrd-space-2);padding:var(--mrd-space-2) var(--mrd-space-3);background:none;border:1px solid var(--mrd-color-neutral-300);border-radius:var(--mrd-border-radius);font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-sm);color:var(--mrd-color-primary);cursor:pointer;margin:var(--mrd-space-2) 0}.mrd-layout-section__navigate.sc-mrd-layout-section:hover{background-color:var(--mrd-color-primary-light);border-color:var(--mrd-color-primary)}.mrd-layout-section__link.sc-mrd-layout-section{color:var(--mrd-color-primary);text-decoration:none}.mrd-layout-section__link.sc-mrd-layout-section:hover{text-decoration:underline}.mrd-layout-section__relation-link.sc-mrd-layout-section{background:none;border:none;padding:0;font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-sm);font-weight:var(--mrd-font-weight-semibold);color:var(--mrd-color-primary);cursor:pointer;text-align:left}.mrd-layout-section__relation-link.sc-mrd-layout-section:hover{text-decoration:underline}.mrd-layout-section__download-link.sc-mrd-layout-section{display:inline-flex;align-items:center;gap:var(--mrd-space-1);background:none;border:none;padding:0;font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-sm);color:var(--mrd-color-primary);cursor:pointer;text-align:left}.mrd-layout-section__download-link.sc-mrd-layout-section:hover{text-decoration:underline;color:var(--mrd-color-primary-dark)}.mrd-layout-section__file-icon.sc-mrd-layout-section{flex-shrink:0;width:1rem;height:1rem}.mrd-layout-section__boolean--true.sc-mrd-layout-section{color:var(--mrd-color-success);font-weight:var(--mrd-font-weight-semibold)}.mrd-layout-section__boolean--false.sc-mrd-layout-section{color:var(--mrd-color-neutral-400)}.mrd-layout-section__field--block.sc-mrd-layout-section{grid-template-columns:1fr}.mrd-layout-section__badge.sc-mrd-layout-section{display:inline-block;font-size:var(--mrd-font-size-xs);font-weight:var(--mrd-font-weight-medium);padding:2px var(--mrd-space-3);border-radius:10px}.mrd-layout-section__badge-dot-row.sc-mrd-layout-section{display:inline-flex;align-items:center;gap:var(--mrd-space-2)}.mrd-layout-section__badge-dot.sc-mrd-layout-section{display:inline-block;width:10px;height:10px;border-radius:50%;flex-shrink:0}.mrd-layout-section__secret-masked.sc-mrd-layout-section{font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-base);color:var(--mrd-label-color);letter-spacing:0.15em;user-select:none;pointer-events:none}.mrd-layout-section__pre.sc-mrd-layout-section{font-family:var(--mrd-font-family-mono);font-size:var(--mrd-font-size-xs);background-color:var(--mrd-color-neutral-50);border:1px solid var(--mrd-color-neutral-200);border-radius:var(--mrd-border-radius);padding:var(--mrd-space-3);margin:0;max-height:calc(10 * 1.5 * var(--mrd-font-size-xs));overflow-x:auto;overflow-y:auto;white-space:pre-wrap;word-break:break-word}.mrd-layout-section__group.sc-mrd-layout-section{margin:var(--mrd-space-4) 0}.mrd-layout-section__group-title.sc-mrd-layout-section{font-size:var(--mrd-font-size-xs);font-weight:var(--mrd-font-weight-semibold);color:var(--mrd-color-neutral-500);margin:0 0 var(--mrd-space-2) 0;padding-bottom:0;letter-spacing:0.01em}.mrd-layout-section__related-view.sc-mrd-layout-section{margin:var(--mrd-space-4) 0}.mrd-layout-section__related-view-title.sc-mrd-layout-section{font-size:var(--mrd-font-size-lg);font-weight:var(--mrd-font-weight-semibold);color:var(--mrd-color-neutral-800);margin:0 0 var(--mrd-space-3) 0}.mrd-layout-section__search.sc-mrd-layout-section{position:relative;margin:var(--mrd-space-2) 0}.mrd-layout-section__search-wrap.sc-mrd-layout-section{position:relative}.mrd-layout-section__search-icon.sc-mrd-layout-section{position:absolute;left:var(--mrd-input-padding-x);top:50%;transform:translateY(-50%);width:1rem;height:1rem;color:var(--mrd-color-neutral-400);pointer-events:none}.mrd-layout-section__search-input.sc-mrd-layout-section{display:block;width:100%;height:var(--mrd-input-height);padding:var(--mrd-input-padding-y) var(--mrd-input-padding-x) var(--mrd-input-padding-y) calc(var(--mrd-input-padding-x) + 1rem + var(--mrd-space-2));font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-base);color:var(--mrd-input-color);background-color:var(--mrd-input-bg);border:var(--mrd-border-width) solid var(--mrd-border-color);border-radius:var(--mrd-border-radius);outline:none;appearance:none;box-sizing:border-box}.mrd-layout-section__search-input.sc-mrd-layout-section:focus{border-color:var(--mrd-border-color-focus);box-shadow:var(--mrd-shadow-focus)}.mrd-layout-section__search-input.sc-mrd-layout-section::placeholder{color:var(--mrd-input-placeholder-color)}.mrd-layout-section__search-results.sc-mrd-layout-section{position:absolute;top:100%;left:0;right:0;background-color:var(--mrd-color-white);border:1px solid var(--mrd-color-neutral-300);border-top:none;border-radius:0 0 var(--mrd-border-radius) var(--mrd-border-radius);box-shadow:var(--mrd-shadow-sm);z-index:100;max-height:300px;overflow-y:auto;list-style:none;margin:0;padding:var(--mrd-space-1) 0}.mrd-layout-section__search-result.sc-mrd-layout-section{margin:0;padding:0}.mrd-layout-section__search-result-btn.sc-mrd-layout-section{display:flex;flex-direction:column;width:100%;padding:var(--mrd-space-2) var(--mrd-space-3);background:none;border:none;text-align:left;cursor:pointer;font-family:var(--mrd-font-family)}.mrd-layout-section__search-result-btn.sc-mrd-layout-section:hover{background-color:var(--mrd-color-primary-light)}.mrd-layout-section__search-result-label.sc-mrd-layout-section{font-size:var(--mrd-font-size-sm);font-weight:var(--mrd-font-weight-medium);color:var(--mrd-color-neutral-800)}.mrd-layout-section__search-result-desc.sc-mrd-layout-section{font-size:var(--mrd-font-size-xs);color:var(--mrd-color-neutral-500);margin-top:var(--mrd-space-1)}.mrd-layout-section__image-thumb-btn.sc-mrd-layout-section{background:none;border:none;padding:0;cursor:pointer;display:inline-block;border-radius:var(--mrd-border-radius);overflow:hidden;line-height:0}.mrd-layout-section__image-thumb-btn.sc-mrd-layout-section:hover .mrd-layout-section__image-thumb.sc-mrd-layout-section{opacity:0.85}.mrd-layout-section__image-thumb.sc-mrd-layout-section{display:block;max-width:160px;max-height:100px;border-radius:var(--mrd-border-radius);object-fit:cover;transition:opacity 0.15s}.mrd-layout-section__modal-backdrop.sc-mrd-layout-section{position:fixed;inset:0;background:rgba(0, 0, 0, 0.6);z-index:300;display:flex;align-items:center;justify-content:center}.mrd-layout-section__modal.sc-mrd-layout-section{position:relative;background:#fff;border-radius:var(--mrd-border-radius);padding:var(--mrd-space-3);max-width:min(90vw, 900px);max-height:90vh;display:flex;align-items:center;justify-content:center;box-shadow:var(--mrd-shadow-lg)}.mrd-layout-section__modal-close.sc-mrd-layout-section{position:absolute;top:var(--mrd-space-2);right:var(--mrd-space-2);background:rgba(0, 0, 0, 0.5);border:none;border-radius:50%;width:28px;height:28px;display:flex;align-items:center;justify-content:center;color:#fff;cursor:pointer;font-size:var(--mrd-font-size-sm);line-height:1;z-index:1}.mrd-layout-section__modal-close.sc-mrd-layout-section:hover{background:rgba(0, 0, 0, 0.8)}.mrd-layout-section__modal-image.sc-mrd-layout-section{display:block;max-width:100%;max-height:calc(90vh - 2rem);border-radius:var(--mrd-border-radius);object-fit:contain}`;
|
|
1827
2771
|
|
|
1828
2772
|
const MrdLayoutSection = class {
|
|
1829
2773
|
constructor(hostRef) {
|
|
@@ -1835,6 +2779,10 @@ const MrdLayoutSection = class {
|
|
|
1835
2779
|
this.mrdLoadImage = index.createEvent(this, "mrdLoadImage");
|
|
1836
2780
|
this.mrdViewAction = index.createEvent(this, "mrdViewAction");
|
|
1837
2781
|
this.mrdLoadViewAggregations = index.createEvent(this, "mrdLoadViewAggregations");
|
|
2782
|
+
this.mrdLoadViewDistinct = index.createEvent(this, "mrdLoadViewDistinct");
|
|
2783
|
+
this.mrdUpdateObject = index.createEvent(this, "mrdUpdateObject");
|
|
2784
|
+
this.mrdViewUpload = index.createEvent(this, "mrdViewUpload");
|
|
2785
|
+
this.mrdCreateObject = index.createEvent(this, "mrdCreateObject");
|
|
1838
2786
|
/** Items from one layout entry in ClientDashboardMetadata.layouts[]. */
|
|
1839
2787
|
this.items = [];
|
|
1840
2788
|
/** Record data object; keys are field names, _links holds relation and related-view links. */
|
|
@@ -1844,6 +2792,9 @@ const MrdLayoutSection = class {
|
|
|
1844
2792
|
/** Legacy: top-level _links from ClientDashboardMetadata. Not needed in new flat format. */
|
|
1845
2793
|
this.links = {};
|
|
1846
2794
|
this.locale = navigator.language;
|
|
2795
|
+
/** Top-level archetypes on the object dashboard. When it contains commons.document,
|
|
2796
|
+
* the record is rendered as a single-document view instead of generic fields. */
|
|
2797
|
+
this.archetypes = [];
|
|
1847
2798
|
this.searchQueryMap = {};
|
|
1848
2799
|
this.searchResultsMap = {};
|
|
1849
2800
|
this.imagePreviewUrl = null;
|
|
@@ -1932,11 +2883,18 @@ const MrdLayoutSection = class {
|
|
|
1932
2883
|
}
|
|
1933
2884
|
}
|
|
1934
2885
|
/**
|
|
1935
|
-
* Inject
|
|
1936
|
-
*
|
|
1937
|
-
*
|
|
2886
|
+
* Inject rows for a VIEW / RELATED_VIEW item.
|
|
2887
|
+
* - Table view: injects the page into the embedded mrd-table (pass totalElements/hasNext).
|
|
2888
|
+
* - Document view: pass `nodeId` to route the rows to that folder node in the embedded
|
|
2889
|
+
* mrd-document-list. Folder loading is just a filtered list load, so it reuses this method.
|
|
1938
2890
|
*/
|
|
1939
|
-
async setViewPage(name, page, rows, totalElements, hasNext) {
|
|
2891
|
+
async setViewPage(name, page, rows, totalElements, hasNext, nodeId) {
|
|
2892
|
+
if (nodeId) {
|
|
2893
|
+
const list = this.el.querySelector(`mrd-document-list[data-doclist="${name}"]`);
|
|
2894
|
+
if (list === null || list === void 0 ? void 0 : list.setDocuments)
|
|
2895
|
+
await list.setDocuments(nodeId, rows);
|
|
2896
|
+
return;
|
|
2897
|
+
}
|
|
1940
2898
|
const table = this.el.querySelector(`mrd-table[data-view="${name}"]`);
|
|
1941
2899
|
if (!table)
|
|
1942
2900
|
return;
|
|
@@ -1952,6 +2910,26 @@ const MrdLayoutSection = class {
|
|
|
1952
2910
|
return;
|
|
1953
2911
|
await table.setAggregations(data);
|
|
1954
2912
|
}
|
|
2913
|
+
/** Inject distinct values into an embedded mrd-document-list for a document view. */
|
|
2914
|
+
async setViewDistinct(name, nodeId, values) {
|
|
2915
|
+
const list = this.el.querySelector(`mrd-document-list[data-doclist="${name}"]`);
|
|
2916
|
+
if (list === null || list === void 0 ? void 0 : list.setDistinct)
|
|
2917
|
+
await list.setDistinct(nodeId, values);
|
|
2918
|
+
}
|
|
2919
|
+
/** Inject the uploaded file reference for a dropped file, so the document view
|
|
2920
|
+
* can request creation of the new document (see mrdViewUpload). */
|
|
2921
|
+
async setViewFileReference(name, uri) {
|
|
2922
|
+
const list = this.el.querySelector(`mrd-document-list[data-doclist="${name}"]`);
|
|
2923
|
+
if (list === null || list === void 0 ? void 0 : list.setFileReference)
|
|
2924
|
+
await list.setFileReference(uri);
|
|
2925
|
+
}
|
|
2926
|
+
/** Inject the created document's href after a file-drop create, so the
|
|
2927
|
+
* optimistic row becomes navigable (see mrdCreateObject). */
|
|
2928
|
+
async setViewCreatedObject(name, href) {
|
|
2929
|
+
const list = this.el.querySelector(`mrd-document-list[data-doclist="${name}"]`);
|
|
2930
|
+
if (list === null || list === void 0 ? void 0 : list.setCreatedHref)
|
|
2931
|
+
await list.setCreatedHref(href);
|
|
2932
|
+
}
|
|
1955
2933
|
/** Provide a resolved URL for an IMAGE field. Shows as thumbnail; clicking opens the lightbox. */
|
|
1956
2934
|
async setImagePreview(fieldName, url) {
|
|
1957
2935
|
this.imagePreviews = Object.assign(Object.assign({}, this.imagePreviews), { [fieldName]: url });
|
|
@@ -2100,7 +3078,7 @@ const MrdLayoutSection = class {
|
|
|
2100
3078
|
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)))))))));
|
|
2101
3079
|
}
|
|
2102
3080
|
renderRelatedView(item) {
|
|
2103
|
-
var _a, _b, _c, _d, _e, _f;
|
|
3081
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
2104
3082
|
const key = this.viewKeyFor(item);
|
|
2105
3083
|
if (!key)
|
|
2106
3084
|
return null;
|
|
@@ -2110,7 +3088,47 @@ const MrdLayoutSection = class {
|
|
|
2110
3088
|
// Extract parentId from data._links.self.href for RELATED_VIEW path construction
|
|
2111
3089
|
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 : '';
|
|
2112
3090
|
const parentId = (_f = selfHref.split('/').filter(Boolean).pop()) !== null && _f !== void 0 ? _f : '';
|
|
2113
|
-
|
|
3091
|
+
// The API publishes `archetypes` on the VIEW/RELATED_VIEW item itself
|
|
3092
|
+
// (sibling of `view`), not inside `view`.
|
|
3093
|
+
const docArchetype = index$1.resolveArchetype((_g = item.archetypes) !== null && _g !== void 0 ? _g : (_h = item.view) === null || _h === void 0 ? void 0 : _h.archetypes, index$1.ARCHETYPE_DOCUMENT);
|
|
3094
|
+
return (index.h("div", { class: "mrd-layout-section__related-view", key: `view-${key}` }, showTitle && item.label && index.h("h3", { class: "mrd-layout-section__related-view-title" }, item.label), docArchetype
|
|
3095
|
+
? this.renderDocumentContainer(item, key, parentId, docArchetype)
|
|
3096
|
+
: this.renderTable(item, key, parentId)));
|
|
3097
|
+
}
|
|
3098
|
+
/** Document collection view: owns the view-switch + collection actions and
|
|
3099
|
+
* swaps between the folder tree and the flat table. Events are re-emitted to
|
|
3100
|
+
* the host with the view key, exactly as the raw list/table events were. */
|
|
3101
|
+
renderDocumentContainer(item, key, parentId, archetype) {
|
|
3102
|
+
return (index.h("mrd-document-container", { item: item, archetype: archetype, parentId: parentId, viewKey: key, locale: this.locale, onMrdLoadDistinct: (e) => {
|
|
3103
|
+
e.stopPropagation();
|
|
3104
|
+
this.mrdLoadViewDistinct.emit(Object.assign({ name: key }, e.detail));
|
|
3105
|
+
}, onMrdLoadPage: (e) => {
|
|
3106
|
+
e.stopPropagation();
|
|
3107
|
+
this.mrdLoadViewPage.emit(Object.assign({ name: key }, e.detail));
|
|
3108
|
+
}, onMrdLoadAggregations: (e) => {
|
|
3109
|
+
var _a;
|
|
3110
|
+
e.stopPropagation();
|
|
3111
|
+
this.mrdLoadViewAggregations.emit(Object.assign({ name: key, dataClass: (_a = item.dataClass) !== null && _a !== void 0 ? _a : key }, e.detail));
|
|
3112
|
+
}, onMrdNavigate: (e) => {
|
|
3113
|
+
e.stopPropagation();
|
|
3114
|
+
this.mrdNavigate.emit(e.detail);
|
|
3115
|
+
}, onMrdAction: (e) => {
|
|
3116
|
+
var _a;
|
|
3117
|
+
e.stopPropagation();
|
|
3118
|
+
this.mrdViewAction.emit(Object.assign({ name: key, dataClass: (_a = item.dataClass) !== null && _a !== void 0 ? _a : key }, e.detail));
|
|
3119
|
+
}, onMrdUpdateObject: (e) => {
|
|
3120
|
+
e.stopPropagation();
|
|
3121
|
+
this.mrdUpdateObject.emit(e.detail);
|
|
3122
|
+
}, onMrdUpload: (e) => {
|
|
3123
|
+
e.stopPropagation();
|
|
3124
|
+
this.mrdViewUpload.emit(Object.assign({ name: key }, e.detail));
|
|
3125
|
+
}, onMrdCreateObject: (e) => {
|
|
3126
|
+
e.stopPropagation();
|
|
3127
|
+
this.mrdCreateObject.emit(Object.assign({ name: key }, e.detail));
|
|
3128
|
+
} }));
|
|
3129
|
+
}
|
|
3130
|
+
renderTable(item, key, parentId) {
|
|
3131
|
+
return (index.h("mrd-table", { "data-view": key, item: item, parentId: parentId, locale: this.locale, onMrdLoadPage: (e) => this.handleViewLoadPage(e, key), onMrdLoadAggregations: (e) => {
|
|
2114
3132
|
var _a;
|
|
2115
3133
|
e.stopPropagation();
|
|
2116
3134
|
this.mrdLoadViewAggregations.emit(Object.assign({ name: key, dataClass: (_a = item.dataClass) !== null && _a !== void 0 ? _a : key }, e.detail));
|
|
@@ -2131,7 +3149,7 @@ const MrdLayoutSection = class {
|
|
|
2131
3149
|
parentPath: e.detail.parentPath,
|
|
2132
3150
|
basicType: e.detail.basicType,
|
|
2133
3151
|
});
|
|
2134
|
-
} }))
|
|
3152
|
+
} }));
|
|
2135
3153
|
}
|
|
2136
3154
|
renderItem(item) {
|
|
2137
3155
|
var _a, _b;
|
|
@@ -2163,8 +3181,23 @@ const MrdLayoutSection = class {
|
|
|
2163
3181
|
return null;
|
|
2164
3182
|
return (index.h("div", { class: "mrd-layout-section__modal-backdrop", onClick: () => { this.imagePreviewUrl = null; } }, index.h("div", { class: "mrd-layout-section__modal", onClick: (e) => e.stopPropagation() }, index.h("button", { class: "mrd-layout-section__modal-close", onClick: () => { this.imagePreviewUrl = null; } }, "\u2715"), index.h("img", { class: "mrd-layout-section__modal-image", src: this.imagePreviewUrl, alt: "" }))));
|
|
2165
3183
|
}
|
|
3184
|
+
/** Single-document view: the record's own type carries commons.document. Renders
|
|
3185
|
+
* a recognisable document instead of generic fields, keeping any related views/
|
|
3186
|
+
* searches below it. */
|
|
3187
|
+
renderDocumentObject(archetype) {
|
|
3188
|
+
const related = this.items.filter(it => it.type === index$1.ClientLayoutItemType.VIEW ||
|
|
3189
|
+
it.type === index$1.ClientLayoutItemType.RELATED_VIEW ||
|
|
3190
|
+
it.type === index$1.ClientLayoutItemType.SEARCH);
|
|
3191
|
+
return [
|
|
3192
|
+
index.h("mrd-document-view", { archetype: archetype, data: this.data, locale: this.locale, onMrdNavigate: (e) => { e.stopPropagation(); this.mrdNavigate.emit(e.detail); }, onMrdDownload: (e) => { e.stopPropagation(); this.mrdDownload.emit(e.detail); } }),
|
|
3193
|
+
...related.map(it => this.renderItem(it)),
|
|
3194
|
+
];
|
|
3195
|
+
}
|
|
2166
3196
|
render() {
|
|
2167
|
-
|
|
3197
|
+
const docArchetype = index$1.resolveArchetype(this.archetypes, index$1.ARCHETYPE_DOCUMENT);
|
|
3198
|
+
return (index.h(index.Host, { key: '6e737354daec0137b6ebe304efcce9990f02739f' }, index.h("div", { key: '31a73a8a78999793f5dacee5f2da41df5f23156e', class: "mrd-layout-section" }, docArchetype
|
|
3199
|
+
? this.renderDocumentObject(docArchetype)
|
|
3200
|
+
: this.items.map(item => this.renderItem(item))), this.renderImageModal()));
|
|
2168
3201
|
}
|
|
2169
3202
|
get el() { return index.getElement(this); }
|
|
2170
3203
|
static get watchers() { return {
|
|
@@ -2304,7 +3337,7 @@ const MrdLongtextField = class {
|
|
|
2304
3337
|
}
|
|
2305
3338
|
render() {
|
|
2306
3339
|
const hasError = !!this.error;
|
|
2307
|
-
return (index.h(index.Host, { key: '
|
|
3340
|
+
return (index.h(index.Host, { key: 'f00f81944748f8f09e22d44befe5e288456b7cc8' }, index.h("div", { key: '7b0ae9cf5b6b684cddb648fe4db6005494322535', class: "mrd-longtext-field" }, this.label && (index.h("label", { key: '3fc6a8710d0e98fe685c45d214a88ae1b0947973', class: `mrd-longtext-field__label${this.required ? ' mrd-longtext-field__label--required' : ''}` }, this.label)), this.disabled ? (index.h("pre", { class: "mrd-longtext-field__content" }, this.value)) : (index.h("textarea", { class: `mrd-longtext-field__input${hasError ? ' mrd-longtext-field__input--error' : ''}`, name: this.name, placeholder: this.placeholder, required: this.required, rows: 10, onInput: this.handleInput, onBlur: this.handleBlur }, this.value)), hasError && index.h("span", { key: 'e96f1dbc6c00a1602f4ce3c97d514a229aeb7cb7', class: "mrd-longtext-field__error" }, this.error))));
|
|
2308
3341
|
}
|
|
2309
3342
|
};
|
|
2310
3343
|
MrdLongtextField.style = mrdLongtextFieldScss();
|
|
@@ -2380,7 +3413,7 @@ const MrdNumberField = class {
|
|
|
2380
3413
|
const hasError = !!this.error;
|
|
2381
3414
|
const suffix = this.dataType === index$1.ClientLayoutItemFieldDataType.PERCENTAGE ? '%' :
|
|
2382
3415
|
this.dataType === index$1.ClientLayoutItemFieldDataType.DECIMAL ? '' : '';
|
|
2383
|
-
return (index.h(index.Host, { key: '
|
|
3416
|
+
return (index.h(index.Host, { key: 'b034a3cc8d841641c0ec167e138904586b044121' }, index.h("div", { key: '7379bfadb8bd0c4e0a945a37013053a4e22477ab', class: "mrd-number-field" }, this.label && (index.h("label", { key: '5518d40b7158e17704633c2b95ac7e3efc0c5568', class: `mrd-number-field__label${this.required ? ' mrd-number-field__label--required' : ''}` }, this.label)), index.h("div", { key: '38ad9f3c945d66c23bd77c743306e916eaefed7f', class: "mrd-number-field__input-wrapper" }, index.h("input", { key: 'ac8b4bc1ea4431cc9306664522ebfda21760ae83', class: `mrd-number-field__input${hasError ? ' mrd-number-field__input--error' : ''}`, type: "text", inputMode: "decimal", name: this.name, value: this.displayValue, placeholder: this.placeholder || (suffix ? `0${suffix}` : '0'), required: this.required, disabled: this.disabled, onInput: this.handleInput, onBlur: this.handleBlur, onFocus: this.handleFocus })), hasError && index.h("span", { key: '09f5a58b769c81acdf4bdd48f9325934c4bb875d', class: "mrd-number-field__error" }, this.error))));
|
|
2384
3417
|
}
|
|
2385
3418
|
};
|
|
2386
3419
|
MrdNumberField.style = mrdNumberFieldScss();
|
|
@@ -2674,9 +3707,9 @@ const MrdSecretField = class {
|
|
|
2674
3707
|
}
|
|
2675
3708
|
render() {
|
|
2676
3709
|
const hasError = !!this.error;
|
|
2677
|
-
return (index.h(index.Host, { key: '
|
|
3710
|
+
return (index.h(index.Host, { key: 'c850ec5bc5967ca0aefca7d7cb65ecae121a9dc1' }, index.h("div", { key: '3249ffbc441422af054a20806dd8dfce954a8ffc', class: "mrd-secret-field" }, this.label && (index.h("label", { key: '0b4a86da9cafad32f153af1bc5487a4e9b941e2f', class: `mrd-secret-field__label${this.required ? ' mrd-secret-field__label--required' : ''}` }, this.label)), this.disabled
|
|
2678
3711
|
? (index.h("span", { class: "mrd-secret-field__masked", "aria-label": this.label }, this.value ? '••••••••' : ''))
|
|
2679
|
-
: (index.h("input", { class: `mrd-secret-field__input${hasError ? ' mrd-secret-field__input--error' : ''}`, type: "password", name: this.name, value: this.value, placeholder: this.placeholder, required: this.required, autocomplete: "new-password", onInput: this.handleInput, onBlur: this.handleBlur })), hasError && index.h("span", { key: '
|
|
3712
|
+
: (index.h("input", { class: `mrd-secret-field__input${hasError ? ' mrd-secret-field__input--error' : ''}`, type: "password", name: this.name, value: this.value, placeholder: this.placeholder, required: this.required, autocomplete: "new-password", onInput: this.handleInput, onBlur: this.handleBlur })), hasError && index.h("span", { key: 'b0d0105f3d43d2e214f070b24e745dbce0e33977', class: "mrd-secret-field__error" }, this.error))));
|
|
2680
3713
|
}
|
|
2681
3714
|
};
|
|
2682
3715
|
MrdSecretField.style = mrdSecretFieldScss();
|
|
@@ -3823,7 +4856,7 @@ const MrdTextField = class {
|
|
|
3823
4856
|
}
|
|
3824
4857
|
render() {
|
|
3825
4858
|
const hasError = !!this.error;
|
|
3826
|
-
return (index.h(index.Host, { key: '
|
|
4859
|
+
return (index.h(index.Host, { key: 'e9252b251faf98ab190e643b97c13fa32d12ef22' }, index.h("div", { key: '37f4259a111c293f2fe12f321f08c00c25e77feb', class: "mrd-text-field" }, this.label && (index.h("label", { key: 'c59e0346fb71a765ea38629b03c06341567ed210', class: `mrd-text-field__label${this.required ? ' mrd-text-field__label--required' : ''}` }, this.label)), index.h("input", { key: 'dc09953a672472348719f29904d900966d945843', class: `mrd-text-field__input${hasError ? ' mrd-text-field__input--error' : ''}`, type: "text", name: this.name, value: this.value, placeholder: this.placeholder, required: this.required, disabled: this.disabled, onInput: this.handleInput, onBlur: this.handleBlur }), hasError && index.h("span", { key: '037653857a372854a16b28ebf8994b23e3e0d696', class: "mrd-text-field__error" }, this.error))));
|
|
3827
4860
|
}
|
|
3828
4861
|
};
|
|
3829
4862
|
MrdTextField.style = mrdTextFieldScss();
|
|
@@ -3897,7 +4930,7 @@ const MrdTextareaField = class {
|
|
|
3897
4930
|
}
|
|
3898
4931
|
}
|
|
3899
4932
|
render() {
|
|
3900
|
-
return (index.h(index.Host, { key: '
|
|
4933
|
+
return (index.h(index.Host, { key: 'fe7824c81e082c3f2c1cf18c11dde20cb1f40f2c' }, index.h("div", { key: 'adf394a7e146d16bc79006873a209b11d88b2e17', class: "mrd-textarea-field" }, this.label && (index.h("label", { key: '1b0dd2b4cf26c55a0af05c67a3178edc0c9d56c4', class: `mrd-textarea-field__label${this.required ? ' mrd-textarea-field__label--required' : ''}` }, this.label)), index.h("div", { key: '7c8fe88b222af0beed08db492aa9f6d890e0dc5b', class: `mrd-textarea-field__container${this.error ? ' mrd-textarea-field__container--error' : ''}` }, index.h("div", { key: '295968283e94812cb04660117c5bdeaf3647469c', class: "mrd-textarea-field__editor" })), this.error && index.h("span", { key: '5b5ab61053ab0792d4c249de04bd1d13b51469bf', class: "mrd-textarea-field__error" }, this.error))));
|
|
3901
4934
|
}
|
|
3902
4935
|
get el() { return index.getElement(this); }
|
|
3903
4936
|
};
|
|
@@ -3934,7 +4967,7 @@ const MrdTimeField = class {
|
|
|
3934
4967
|
}
|
|
3935
4968
|
render() {
|
|
3936
4969
|
const hasError = !!this.error;
|
|
3937
|
-
return (index.h(index.Host, { key: '
|
|
4970
|
+
return (index.h(index.Host, { key: '579219a478e31325b5a676465807c1d936724a2b' }, index.h("div", { key: '51b25f6e083a29989505c0ad79edbcd3b0060736', class: "mrd-time-field" }, this.label && (index.h("label", { key: '67d98bebb8803deea2d2a4a63f36706789ccd8c7', class: `mrd-time-field__label${this.required ? ' mrd-time-field__label--required' : ''}` }, this.label)), index.h("input", { key: '734741e0db1bdd5886fef37bba3b2f8d7200a0ab', class: `mrd-time-field__input${hasError ? ' mrd-time-field__input--error' : ''}`, type: "time", name: this.name, value: this.value, required: this.required, disabled: this.disabled, onChange: this.handleChange, onBlur: this.handleBlur }), hasError && index.h("span", { key: '0dbd168d14966dc56a77c97cd8fd8f9b208a4bf5', class: "mrd-time-field__error" }, this.error))));
|
|
3938
4971
|
}
|
|
3939
4972
|
};
|
|
3940
4973
|
MrdTimeField.style = mrdTimeFieldScss();
|
|
@@ -3943,6 +4976,9 @@ exports.mrd_boolean_field = MrdBooleanField;
|
|
|
3943
4976
|
exports.mrd_currency_field = MrdCurrencyField;
|
|
3944
4977
|
exports.mrd_date_field = MrdDateField;
|
|
3945
4978
|
exports.mrd_datetime_field = MrdDatetimeField;
|
|
4979
|
+
exports.mrd_document_container = MrdDocumentContainer;
|
|
4980
|
+
exports.mrd_document_list = MrdDocumentList;
|
|
4981
|
+
exports.mrd_document_view = MrdDocumentView;
|
|
3946
4982
|
exports.mrd_email_field = MrdEmailField;
|
|
3947
4983
|
exports.mrd_field = MrdField;
|
|
3948
4984
|
exports.mrd_file_field = MrdFileField;
|