@mmlogic/components 0.1.15 → 0.1.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{format-C-M0H0qJ.js → format-IFzg0q-6.js} +12 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/mosterdcomponents.cjs.js +1 -1
- package/dist/cjs/mrd-boolean-field_16.cjs.entry.js +91 -26
- package/dist/cjs/mrd-table.cjs.entry.js +134 -15
- package/dist/collection/components/mrd-datetime-field/mrd-datetime-field.js +41 -7
- package/dist/collection/components/mrd-field/mrd-field.js +2 -2
- package/dist/collection/components/mrd-form/mrd-form.js +53 -20
- package/dist/collection/components/mrd-relation-field/mrd-relation-field.js +3 -3
- package/dist/collection/components/mrd-table/mrd-table.js +134 -14
- package/dist/collection/components/mrd-table/mrd-table.scss +88 -27
- package/dist/collection/dev/app.js +8 -6
- package/dist/collection/utils/i18n.js +12 -0
- package/dist/components/i18n.js +1 -1
- package/dist/components/mrd-datetime-field2.js +1 -1
- package/dist/components/mrd-form.js +1 -1
- package/dist/components/mrd-relation-field2.js +1 -1
- package/dist/components/mrd-table.js +1 -1
- package/dist/esm/{format-DM1S-0hy.js → format-Cc9kQ1j-.js} +12 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/mosterdcomponents.js +1 -1
- package/dist/esm/mrd-boolean-field_16.entry.js +91 -26
- package/dist/esm/mrd-table.entry.js +134 -15
- package/dist/mosterdcomponents/mosterdcomponents.esm.js +1 -1
- package/dist/mosterdcomponents/p-829b9b6f.entry.js +1 -0
- package/dist/mosterdcomponents/p-Cc9kQ1j-.js +1 -0
- package/dist/mosterdcomponents/p-a3d8feb8.entry.js +1 -0
- package/dist/types/components/mrd-datetime-field/mrd-datetime-field.d.ts +5 -0
- package/dist/types/components/mrd-field/mrd-field.d.ts +1 -0
- package/dist/types/components/mrd-form/mrd-form.d.ts +9 -4
- package/dist/types/components/mrd-relation-field/mrd-relation-field.d.ts +1 -0
- package/dist/types/components/mrd-table/mrd-table.d.ts +11 -0
- package/dist/types/components.d.ts +6 -6
- package/package.json +1 -1
- package/dist/mosterdcomponents/p-013df6e4.entry.js +0 -1
- package/dist/mosterdcomponents/p-DM1S-0hy.js +0 -1
- package/dist/mosterdcomponents/p-bc7148e2.entry.js +0 -1
|
@@ -55,6 +55,9 @@ const translations = {
|
|
|
55
55
|
filter_select_none: 'Geen',
|
|
56
56
|
filter_search_value: 'Zoekwaarde...',
|
|
57
57
|
filter_no_support: 'Geen filtering beschikbaar voor dit veldtype.',
|
|
58
|
+
// mrd-table textblock
|
|
59
|
+
textblock_show_more: 'Meer tonen',
|
|
60
|
+
close: 'Sluiten',
|
|
58
61
|
},
|
|
59
62
|
en: {
|
|
60
63
|
required: 'This field is required',
|
|
@@ -110,6 +113,9 @@ const translations = {
|
|
|
110
113
|
filter_select_none: 'None',
|
|
111
114
|
filter_search_value: 'Search value...',
|
|
112
115
|
filter_no_support: 'Filtering is not available for this field type.',
|
|
116
|
+
// mrd-table textblock
|
|
117
|
+
textblock_show_more: 'Show more',
|
|
118
|
+
close: 'Close',
|
|
113
119
|
},
|
|
114
120
|
ar: {
|
|
115
121
|
required: 'هذا الحقل مطلوب',
|
|
@@ -165,6 +171,9 @@ const translations = {
|
|
|
165
171
|
filter_select_none: 'لا شيء',
|
|
166
172
|
filter_search_value: 'قيمة البحث...',
|
|
167
173
|
filter_no_support: 'التصفية غير متاحة لهذا النوع من الحقول.',
|
|
174
|
+
// mrd-table textblock
|
|
175
|
+
textblock_show_more: 'عرض المزيد',
|
|
176
|
+
close: 'إغلاق',
|
|
168
177
|
},
|
|
169
178
|
fr: {
|
|
170
179
|
required: 'Ce champ est obligatoire',
|
|
@@ -220,6 +229,9 @@ const translations = {
|
|
|
220
229
|
filter_select_none: 'Aucun',
|
|
221
230
|
filter_search_value: 'Valeur de recherche...',
|
|
222
231
|
filter_no_support: "Le filtrage n'est pas disponible pour ce type de champ.",
|
|
232
|
+
// mrd-table textblock
|
|
233
|
+
textblock_show_more: 'Voir plus',
|
|
234
|
+
close: 'Fermer',
|
|
223
235
|
},
|
|
224
236
|
};
|
|
225
237
|
function t(key, locale) {
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -6,7 +6,7 @@ var appGlobals = require('./app-globals-V2Kpy_OQ.js');
|
|
|
6
6
|
const defineCustomElements = async (win, options) => {
|
|
7
7
|
if (typeof window === 'undefined') return undefined;
|
|
8
8
|
await appGlobals.globalScripts();
|
|
9
|
-
return index.bootstrapLazy([["mrd-table.cjs",[[2,"mrd-table",{"columns":[16],"rows":[16],"locale":[1],"totalElements":[2,"total-elements"],"pageSize":[2,"page-size"],"rowHeight":[2,"row-height"],"tableHeight":[2,"table-height"],"defaultSort":[1,"default-sort"],"actions":[16],"loadedPages":[32],"requestedPages":[32],"renderStart":[32],"renderEnd":[32],"colWidths":[32],"sortField":[32],"sortDir":[32],"filterMode":[32],"activeFilters":[32],"openFilterCol":[32],"pendingFilter":[32],"popupPos":[32],"scrollTop":[32],"init":[64],"setPage":[64]},null,{"totalElements":[{"totalElementsChanged":0}]}]]],["mrd-boolean-field_16.cjs",[[2,"mrd-form",{"layout":[16],"locale":[1],"values":[16],"referenceHref":[1,"reference-href"],"referenceClass":[1,"reference-class"],"showCancel":[4,"show-cancel"],"formValues":[32],"errors":[32],"submitted":[32],"setFieldValue":[64]},null,{"values":[{"valuesChanged":0}]}],[2,"mrd-field",{"item":[16],"locale":[1],"value":[16]}],[2,"mrd-boolean-field",{"name":[1],"label":[1],"value":[4],"required":[4],"disabled":[4],"locale":[1],"checked":[32]}],[2,"mrd-currency-field",{"name":[1],"label":[1],"value":[16],"required":[4],"disabled":[4],"locale":[1],"amountDisplay":[32],"currency":[32],"error":[32]}],[2,"mrd-date-field",{"name":[1],"label":[1],"value":[1],"required":[4],"disabled":[4],"locale":[1],"error":[32]}],[2,"mrd-datetime-field",{"name":[1],"label":[1],"value":[1],"required":[4],"disabled":[4],"locale":[1],"error":[32]}],[2,"mrd-email-field",{"name":[1],"label":[1],"value":[1],"placeholder":[1],"required":[4],"disabled":[4],"locale":[1],"error":[32]}],[2,"mrd-file-field",{"name":[1],"label":[1],"value":[16],"required":[4],"disabled":[4],"locale":[1],"accept":[1],"maxSize":[2,"max-size"],"fileName":[32],"isDragging":[32],"uploading":[32],"error":[32]},null,{"value":[{"valueChanged":0}]}],[2,"mrd-hyperlink-field",{"name":[1],"label":[1],"value":[1],"placeholder":[1],"required":[4],"disabled":[4],"locale":[1],"error":[32]}],[2,"mrd-image-field",{"name":[1],"label":[1],"value":[16],"required":[4],"disabled":[4],"locale":[1],"accept":[1],"maxSize":[2,"max-size"],"previewUrl":[32],"fileName":[32],"isDragging":[32],"uploading":[32],"error":[32]},null,{"value":[{"valueChanged":0}]}],[2,"mrd-list-field",{"name":[1],"label":[1],"value":[1],"required":[4],"disabled":[4],"multiple":[4],"locale":[1],"listItems":[16],"error":[32],"selected":[32]}],[2,"mrd-number-field",{"name":[1],"label":[1],"value":[2],"placeholder":[1],"required":[4],"disabled":[4],"locale":[1],"dataType":[1,"data-type"],"decimalPrecision":[2,"decimal-precision"],"displayValue":[32],"error":[32]}],[2,"mrd-relation-field",{"name":[1],"label":[1],"required":[4],"disabled":[4],"locale":[1],"relatedClass":[1,"related-class"],"mostSignificantClass":[1,"most-significant-class"],"displayType":[1,"display-type"],"editBehavior":[1,"edit-behavior"],"commonRelation":[1,"common-relation"],"multiple":[4],"dropdownValues":[16],"value":[1],"searchQuery":[32],"searchResults":[32],"allRecords":[32],"isLoading":[32],"selectedItems":[32],"showResults":[32],"error":[32],"highlightedIndex":[32],"setAllRecords":[64],"setSearchResults":[64],"setLoading":[64]}],[2,"mrd-text-field",{"name":[1],"label":[1],"value":[1],"placeholder":[1],"required":[4],"disabled":[4],"locale":[1],"error":[32]}],[2,"mrd-textarea-field",{"name":[1],"label":[1],"value":[1],"placeholder":[1],"required":[4],"disabled":[4],"locale":[1],"error":[32],"editorReady":[32]}],[2,"mrd-time-field",{"name":[1],"label":[1],"value":[1],"required":[4],"disabled":[4],"locale":[1],"error":[32]}]]]], options);
|
|
9
|
+
return index.bootstrapLazy([["mrd-table.cjs",[[2,"mrd-table",{"columns":[16],"rows":[16],"locale":[1],"totalElements":[2,"total-elements"],"pageSize":[2,"page-size"],"rowHeight":[2,"row-height"],"tableHeight":[2,"table-height"],"defaultSort":[1,"default-sort"],"actions":[16],"loadedPages":[32],"requestedPages":[32],"renderStart":[32],"renderEnd":[32],"colWidths":[32],"sortField":[32],"sortDir":[32],"filterMode":[32],"activeFilters":[32],"openFilterCol":[32],"pendingFilter":[32],"popupPos":[32],"scrollTop":[32],"textblockModal":[32],"init":[64],"setPage":[64]},null,{"totalElements":[{"totalElementsChanged":0}]}]]],["mrd-boolean-field_16.cjs",[[2,"mrd-form",{"layout":[16],"locale":[1],"values":[16],"referenceHref":[1,"reference-href"],"referenceClass":[1,"reference-class"],"showCancel":[4,"show-cancel"],"formValues":[32],"errors":[32],"submitted":[32],"setFieldValue":[64]},null,{"values":[{"valuesChanged":0}]}],[2,"mrd-field",{"item":[16],"locale":[1],"value":[16]}],[2,"mrd-boolean-field",{"name":[1],"label":[1],"value":[4],"required":[4],"disabled":[4],"locale":[1],"checked":[32]}],[2,"mrd-currency-field",{"name":[1],"label":[1],"value":[16],"required":[4],"disabled":[4],"locale":[1],"amountDisplay":[32],"currency":[32],"error":[32]}],[2,"mrd-date-field",{"name":[1],"label":[1],"value":[1],"required":[4],"disabled":[4],"locale":[1],"error":[32]}],[2,"mrd-datetime-field",{"name":[1],"label":[1],"value":[1],"required":[4],"disabled":[4],"locale":[1],"error":[32],"localValue":[32]},null,{"value":[{"valueChanged":0}]}],[2,"mrd-email-field",{"name":[1],"label":[1],"value":[1],"placeholder":[1],"required":[4],"disabled":[4],"locale":[1],"error":[32]}],[2,"mrd-file-field",{"name":[1],"label":[1],"value":[16],"required":[4],"disabled":[4],"locale":[1],"accept":[1],"maxSize":[2,"max-size"],"fileName":[32],"isDragging":[32],"uploading":[32],"error":[32]},null,{"value":[{"valueChanged":0}]}],[2,"mrd-hyperlink-field",{"name":[1],"label":[1],"value":[1],"placeholder":[1],"required":[4],"disabled":[4],"locale":[1],"error":[32]}],[2,"mrd-image-field",{"name":[1],"label":[1],"value":[16],"required":[4],"disabled":[4],"locale":[1],"accept":[1],"maxSize":[2,"max-size"],"previewUrl":[32],"fileName":[32],"isDragging":[32],"uploading":[32],"error":[32]},null,{"value":[{"valueChanged":0}]}],[2,"mrd-list-field",{"name":[1],"label":[1],"value":[1],"required":[4],"disabled":[4],"multiple":[4],"locale":[1],"listItems":[16],"error":[32],"selected":[32]}],[2,"mrd-number-field",{"name":[1],"label":[1],"value":[2],"placeholder":[1],"required":[4],"disabled":[4],"locale":[1],"dataType":[1,"data-type"],"decimalPrecision":[2,"decimal-precision"],"displayValue":[32],"error":[32]}],[2,"mrd-relation-field",{"name":[1],"label":[1],"required":[4],"disabled":[4],"locale":[1],"relatedClass":[1,"related-class"],"mostSignificantClass":[1,"most-significant-class"],"displayType":[1,"display-type"],"editBehavior":[1,"edit-behavior"],"commonRelation":[1,"common-relation"],"multiple":[4],"dropdownValues":[16],"value":[1],"searchQuery":[32],"searchResults":[32],"allRecords":[32],"isLoading":[32],"selectedItems":[32],"showResults":[32],"error":[32],"highlightedIndex":[32],"setAllRecords":[64],"setSearchResults":[64],"setLoading":[64]}],[2,"mrd-text-field",{"name":[1],"label":[1],"value":[1],"placeholder":[1],"required":[4],"disabled":[4],"locale":[1],"error":[32]}],[2,"mrd-textarea-field",{"name":[1],"label":[1],"value":[1],"placeholder":[1],"required":[4],"disabled":[4],"locale":[1],"error":[32],"editorReady":[32]}],[2,"mrd-time-field",{"name":[1],"label":[1],"value":[1],"required":[4],"disabled":[4],"locale":[1],"error":[32]}]]]], options);
|
|
10
10
|
};
|
|
11
11
|
|
|
12
12
|
exports.setNonce = index.setNonce;
|
|
@@ -19,7 +19,7 @@ var patchBrowser = () => {
|
|
|
19
19
|
|
|
20
20
|
patchBrowser().then(async (options) => {
|
|
21
21
|
await appGlobals.globalScripts();
|
|
22
|
-
return index.bootstrapLazy([["mrd-table.cjs",[[2,"mrd-table",{"columns":[16],"rows":[16],"locale":[1],"totalElements":[2,"total-elements"],"pageSize":[2,"page-size"],"rowHeight":[2,"row-height"],"tableHeight":[2,"table-height"],"defaultSort":[1,"default-sort"],"actions":[16],"loadedPages":[32],"requestedPages":[32],"renderStart":[32],"renderEnd":[32],"colWidths":[32],"sortField":[32],"sortDir":[32],"filterMode":[32],"activeFilters":[32],"openFilterCol":[32],"pendingFilter":[32],"popupPos":[32],"scrollTop":[32],"init":[64],"setPage":[64]},null,{"totalElements":[{"totalElementsChanged":0}]}]]],["mrd-boolean-field_16.cjs",[[2,"mrd-form",{"layout":[16],"locale":[1],"values":[16],"referenceHref":[1,"reference-href"],"referenceClass":[1,"reference-class"],"showCancel":[4,"show-cancel"],"formValues":[32],"errors":[32],"submitted":[32],"setFieldValue":[64]},null,{"values":[{"valuesChanged":0}]}],[2,"mrd-field",{"item":[16],"locale":[1],"value":[16]}],[2,"mrd-boolean-field",{"name":[1],"label":[1],"value":[4],"required":[4],"disabled":[4],"locale":[1],"checked":[32]}],[2,"mrd-currency-field",{"name":[1],"label":[1],"value":[16],"required":[4],"disabled":[4],"locale":[1],"amountDisplay":[32],"currency":[32],"error":[32]}],[2,"mrd-date-field",{"name":[1],"label":[1],"value":[1],"required":[4],"disabled":[4],"locale":[1],"error":[32]}],[2,"mrd-datetime-field",{"name":[1],"label":[1],"value":[1],"required":[4],"disabled":[4],"locale":[1],"error":[32]}],[2,"mrd-email-field",{"name":[1],"label":[1],"value":[1],"placeholder":[1],"required":[4],"disabled":[4],"locale":[1],"error":[32]}],[2,"mrd-file-field",{"name":[1],"label":[1],"value":[16],"required":[4],"disabled":[4],"locale":[1],"accept":[1],"maxSize":[2,"max-size"],"fileName":[32],"isDragging":[32],"uploading":[32],"error":[32]},null,{"value":[{"valueChanged":0}]}],[2,"mrd-hyperlink-field",{"name":[1],"label":[1],"value":[1],"placeholder":[1],"required":[4],"disabled":[4],"locale":[1],"error":[32]}],[2,"mrd-image-field",{"name":[1],"label":[1],"value":[16],"required":[4],"disabled":[4],"locale":[1],"accept":[1],"maxSize":[2,"max-size"],"previewUrl":[32],"fileName":[32],"isDragging":[32],"uploading":[32],"error":[32]},null,{"value":[{"valueChanged":0}]}],[2,"mrd-list-field",{"name":[1],"label":[1],"value":[1],"required":[4],"disabled":[4],"multiple":[4],"locale":[1],"listItems":[16],"error":[32],"selected":[32]}],[2,"mrd-number-field",{"name":[1],"label":[1],"value":[2],"placeholder":[1],"required":[4],"disabled":[4],"locale":[1],"dataType":[1,"data-type"],"decimalPrecision":[2,"decimal-precision"],"displayValue":[32],"error":[32]}],[2,"mrd-relation-field",{"name":[1],"label":[1],"required":[4],"disabled":[4],"locale":[1],"relatedClass":[1,"related-class"],"mostSignificantClass":[1,"most-significant-class"],"displayType":[1,"display-type"],"editBehavior":[1,"edit-behavior"],"commonRelation":[1,"common-relation"],"multiple":[4],"dropdownValues":[16],"value":[1],"searchQuery":[32],"searchResults":[32],"allRecords":[32],"isLoading":[32],"selectedItems":[32],"showResults":[32],"error":[32],"highlightedIndex":[32],"setAllRecords":[64],"setSearchResults":[64],"setLoading":[64]}],[2,"mrd-text-field",{"name":[1],"label":[1],"value":[1],"placeholder":[1],"required":[4],"disabled":[4],"locale":[1],"error":[32]}],[2,"mrd-textarea-field",{"name":[1],"label":[1],"value":[1],"placeholder":[1],"required":[4],"disabled":[4],"locale":[1],"error":[32],"editorReady":[32]}],[2,"mrd-time-field",{"name":[1],"label":[1],"value":[1],"required":[4],"disabled":[4],"locale":[1],"error":[32]}]]]], options);
|
|
22
|
+
return index.bootstrapLazy([["mrd-table.cjs",[[2,"mrd-table",{"columns":[16],"rows":[16],"locale":[1],"totalElements":[2,"total-elements"],"pageSize":[2,"page-size"],"rowHeight":[2,"row-height"],"tableHeight":[2,"table-height"],"defaultSort":[1,"default-sort"],"actions":[16],"loadedPages":[32],"requestedPages":[32],"renderStart":[32],"renderEnd":[32],"colWidths":[32],"sortField":[32],"sortDir":[32],"filterMode":[32],"activeFilters":[32],"openFilterCol":[32],"pendingFilter":[32],"popupPos":[32],"scrollTop":[32],"textblockModal":[32],"init":[64],"setPage":[64]},null,{"totalElements":[{"totalElementsChanged":0}]}]]],["mrd-boolean-field_16.cjs",[[2,"mrd-form",{"layout":[16],"locale":[1],"values":[16],"referenceHref":[1,"reference-href"],"referenceClass":[1,"reference-class"],"showCancel":[4,"show-cancel"],"formValues":[32],"errors":[32],"submitted":[32],"setFieldValue":[64]},null,{"values":[{"valuesChanged":0}]}],[2,"mrd-field",{"item":[16],"locale":[1],"value":[16]}],[2,"mrd-boolean-field",{"name":[1],"label":[1],"value":[4],"required":[4],"disabled":[4],"locale":[1],"checked":[32]}],[2,"mrd-currency-field",{"name":[1],"label":[1],"value":[16],"required":[4],"disabled":[4],"locale":[1],"amountDisplay":[32],"currency":[32],"error":[32]}],[2,"mrd-date-field",{"name":[1],"label":[1],"value":[1],"required":[4],"disabled":[4],"locale":[1],"error":[32]}],[2,"mrd-datetime-field",{"name":[1],"label":[1],"value":[1],"required":[4],"disabled":[4],"locale":[1],"error":[32],"localValue":[32]},null,{"value":[{"valueChanged":0}]}],[2,"mrd-email-field",{"name":[1],"label":[1],"value":[1],"placeholder":[1],"required":[4],"disabled":[4],"locale":[1],"error":[32]}],[2,"mrd-file-field",{"name":[1],"label":[1],"value":[16],"required":[4],"disabled":[4],"locale":[1],"accept":[1],"maxSize":[2,"max-size"],"fileName":[32],"isDragging":[32],"uploading":[32],"error":[32]},null,{"value":[{"valueChanged":0}]}],[2,"mrd-hyperlink-field",{"name":[1],"label":[1],"value":[1],"placeholder":[1],"required":[4],"disabled":[4],"locale":[1],"error":[32]}],[2,"mrd-image-field",{"name":[1],"label":[1],"value":[16],"required":[4],"disabled":[4],"locale":[1],"accept":[1],"maxSize":[2,"max-size"],"previewUrl":[32],"fileName":[32],"isDragging":[32],"uploading":[32],"error":[32]},null,{"value":[{"valueChanged":0}]}],[2,"mrd-list-field",{"name":[1],"label":[1],"value":[1],"required":[4],"disabled":[4],"multiple":[4],"locale":[1],"listItems":[16],"error":[32],"selected":[32]}],[2,"mrd-number-field",{"name":[1],"label":[1],"value":[2],"placeholder":[1],"required":[4],"disabled":[4],"locale":[1],"dataType":[1,"data-type"],"decimalPrecision":[2,"decimal-precision"],"displayValue":[32],"error":[32]}],[2,"mrd-relation-field",{"name":[1],"label":[1],"required":[4],"disabled":[4],"locale":[1],"relatedClass":[1,"related-class"],"mostSignificantClass":[1,"most-significant-class"],"displayType":[1,"display-type"],"editBehavior":[1,"edit-behavior"],"commonRelation":[1,"common-relation"],"multiple":[4],"dropdownValues":[16],"value":[1],"searchQuery":[32],"searchResults":[32],"allRecords":[32],"isLoading":[32],"selectedItems":[32],"showResults":[32],"error":[32],"highlightedIndex":[32],"setAllRecords":[64],"setSearchResults":[64],"setLoading":[64]}],[2,"mrd-text-field",{"name":[1],"label":[1],"value":[1],"placeholder":[1],"required":[4],"disabled":[4],"locale":[1],"error":[32]}],[2,"mrd-textarea-field",{"name":[1],"label":[1],"value":[1],"placeholder":[1],"required":[4],"disabled":[4],"locale":[1],"error":[32],"editorReady":[32]}],[2,"mrd-time-field",{"name":[1],"label":[1],"value":[1],"required":[4],"disabled":[4],"locale":[1],"error":[32]}]]]], options);
|
|
23
23
|
});
|
|
24
24
|
|
|
25
25
|
exports.setNonce = index.setNonce;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var index = require('./index-BPj2cBXs.js');
|
|
4
|
-
var format = require('./format-
|
|
4
|
+
var format = require('./format-IFzg0q-6.js');
|
|
5
5
|
var index$1 = require('./index.cjs.js');
|
|
6
6
|
|
|
7
7
|
const mrdBooleanFieldScss = () => `.sc-mrd-boolean-field-h{display:block}.mrd-boolean-field.sc-mrd-boolean-field{display:flex;align-items:center;width:100%}.mrd-boolean-field__toggle-label.sc-mrd-boolean-field{display:flex;align-items:center;gap:var(--mrd-space-3);cursor:pointer;user-select:none}.mrd-boolean-field__checkbox.sc-mrd-boolean-field{position:absolute;opacity:0;width:0;height:0;pointer-events:none}.mrd-boolean-field__checkbox.sc-mrd-boolean-field:checked+.mrd-boolean-field__toggle.sc-mrd-boolean-field{background-color:var(--mrd-color-primary)}.mrd-boolean-field__checkbox.sc-mrd-boolean-field:checked+.mrd-boolean-field__toggle.sc-mrd-boolean-field::after{transform:translateX(20px)}.mrd-boolean-field__checkbox.sc-mrd-boolean-field:focus+.mrd-boolean-field__toggle.sc-mrd-boolean-field{box-shadow:var(--mrd-shadow-focus)}.mrd-boolean-field__checkbox.sc-mrd-boolean-field:disabled+.mrd-boolean-field__toggle.sc-mrd-boolean-field{opacity:0.5;cursor:not-allowed}.mrd-boolean-field__toggle.sc-mrd-boolean-field{position:relative;display:inline-block;width:44px;height:24px;background-color:var(--mrd-color-neutral-300);border-radius:var(--mrd-border-radius-full);transition:background-color var(--mrd-transition);flex-shrink:0}.mrd-boolean-field__toggle.sc-mrd-boolean-field::after{content:'';position:absolute;top:2px;left:2px;width:20px;height:20px;background-color:var(--mrd-color-white);border-radius:50%;transition:transform var(--mrd-transition);box-shadow:var(--mrd-shadow-sm)}.mrd-boolean-field__text.sc-mrd-boolean-field{font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-base);color:var(--mrd-color-neutral-800)}.mrd-boolean-field__text--required.sc-mrd-boolean-field::after{content:' *';color:var(--mrd-color-danger)}`;
|
|
@@ -187,25 +187,57 @@ const MrdDatetimeField = class {
|
|
|
187
187
|
this.disabled = false;
|
|
188
188
|
this.locale = navigator.language;
|
|
189
189
|
this.error = '';
|
|
190
|
+
this.localValue = '';
|
|
190
191
|
this.handleChange = (e) => {
|
|
191
|
-
const
|
|
192
|
-
|
|
192
|
+
const localVal = e.target.value;
|
|
193
|
+
this.localValue = localVal;
|
|
194
|
+
if (this.required && !validateRequired(localVal)) {
|
|
193
195
|
this.error = format.t('required', this.locale);
|
|
194
196
|
}
|
|
195
197
|
else {
|
|
196
198
|
this.error = '';
|
|
197
199
|
}
|
|
198
|
-
this.mrdChange.emit({ name: this.name, value:
|
|
200
|
+
this.mrdChange.emit({ name: this.name, value: this.localToUtc(localVal) });
|
|
199
201
|
};
|
|
200
202
|
this.handleBlur = (e) => {
|
|
201
|
-
const
|
|
202
|
-
this.mrdBlur.emit({ name: this.name, value:
|
|
203
|
+
const localVal = e.target.value;
|
|
204
|
+
this.mrdBlur.emit({ name: this.name, value: this.localToUtc(localVal) });
|
|
203
205
|
};
|
|
204
206
|
}
|
|
207
|
+
componentWillLoad() {
|
|
208
|
+
this.localValue = this.utcToLocal(this.value);
|
|
209
|
+
}
|
|
210
|
+
valueChanged(newVal) {
|
|
211
|
+
this.localValue = this.utcToLocal(newVal);
|
|
212
|
+
}
|
|
213
|
+
// UTC ISO string → "YYYY-MM-DDTHH:mm" in local timezone (for datetime-local input)
|
|
214
|
+
utcToLocal(utcStr) {
|
|
215
|
+
if (!utcStr)
|
|
216
|
+
return '';
|
|
217
|
+
const d = new Date(utcStr);
|
|
218
|
+
if (isNaN(d.getTime()))
|
|
219
|
+
return '';
|
|
220
|
+
const pad = (n) => String(n).padStart(2, '0');
|
|
221
|
+
return `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}T${pad(d.getHours())}:${pad(d.getMinutes())}`;
|
|
222
|
+
}
|
|
223
|
+
// "YYYY-MM-DDTHH:mm" local time → UTC ISO string (for API)
|
|
224
|
+
localToUtc(localStr) {
|
|
225
|
+
if (!localStr)
|
|
226
|
+
return '';
|
|
227
|
+
const d = new Date(localStr);
|
|
228
|
+
if (isNaN(d.getTime()))
|
|
229
|
+
return '';
|
|
230
|
+
return d.toISOString().replace(/\.\d{3}Z$/, 'Z');
|
|
231
|
+
}
|
|
205
232
|
render() {
|
|
206
233
|
const hasError = !!this.error;
|
|
207
|
-
return (index.h(index.Host, { key: '
|
|
234
|
+
return (index.h(index.Host, { key: '6052b08238484bee345ae4bb9b3025c7f2474c35' }, index.h("div", { key: 'f9073be4496e35a7d40405ae4e6a27a5c1607626', class: "mrd-datetime-field" }, this.label && (index.h("label", { key: '5933c3b2dfcae9bfad378441210ada6b625657a2', class: `mrd-datetime-field__label${this.required ? ' mrd-datetime-field__label--required' : ''}` }, this.label)), index.h("input", { key: '7a947b104c38960d2326a4877e4ca52db9fd9d84', 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: 'cea3dba7e14e18a3a08394ef3027b661f1808969', class: "mrd-datetime-field__error" }, this.error))));
|
|
208
235
|
}
|
|
236
|
+
static get watchers() { return {
|
|
237
|
+
"value": [{
|
|
238
|
+
"valueChanged": 0
|
|
239
|
+
}]
|
|
240
|
+
}; }
|
|
209
241
|
};
|
|
210
242
|
MrdDatetimeField.style = mrdDatetimeFieldScss();
|
|
211
243
|
|
|
@@ -471,6 +503,7 @@ const MrdForm = class {
|
|
|
471
503
|
this.formValues = {};
|
|
472
504
|
this.errors = {};
|
|
473
505
|
this.submitted = false;
|
|
506
|
+
this.initialValues = {};
|
|
474
507
|
this.handleFieldChange = (e) => {
|
|
475
508
|
const { name, value } = e.detail;
|
|
476
509
|
const prevHref = this.getHref(this.formValues[name]);
|
|
@@ -521,8 +554,9 @@ const MrdForm = class {
|
|
|
521
554
|
};
|
|
522
555
|
}
|
|
523
556
|
componentWillLoad() {
|
|
524
|
-
var _a;
|
|
525
|
-
this.
|
|
557
|
+
var _a, _b;
|
|
558
|
+
this.initialValues = Object.assign({}, ((_a = this.values) !== null && _a !== void 0 ? _a : {}));
|
|
559
|
+
this.formValues = Object.assign({}, ((_b = this.values) !== null && _b !== void 0 ? _b : {}));
|
|
526
560
|
}
|
|
527
561
|
componentDidLoad() {
|
|
528
562
|
// Apply reference pre-fill and emit mrdFetchAll for dependent DROPDOWN fields.
|
|
@@ -535,6 +569,7 @@ const MrdForm = class {
|
|
|
535
569
|
/** Sync formValues when the values prop is set from outside after mount
|
|
536
570
|
* (e.g. when pre-filling an existing record in edit mode). */
|
|
537
571
|
valuesChanged(newValues) {
|
|
572
|
+
this.initialValues = Object.assign({}, (newValues !== null && newValues !== void 0 ? newValues : {}));
|
|
538
573
|
this.formValues = Object.assign({}, (newValues !== null && newValues !== void 0 ? newValues : {}));
|
|
539
574
|
this.applyReferenceValue();
|
|
540
575
|
this.errors = {};
|
|
@@ -662,10 +697,42 @@ const MrdForm = class {
|
|
|
662
697
|
this.errors = newErrors;
|
|
663
698
|
return Object.keys(newErrors).length === 0;
|
|
664
699
|
}
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
700
|
+
normalizeFieldValue(value) {
|
|
701
|
+
return (value === '' || value == null) ? null : value;
|
|
702
|
+
}
|
|
703
|
+
normalizeRelationValue(value) {
|
|
704
|
+
if (value == null || value === '')
|
|
705
|
+
return null;
|
|
706
|
+
if (typeof value === 'string')
|
|
707
|
+
return value || null;
|
|
708
|
+
if (Array.isArray(value)) {
|
|
709
|
+
return value.map(v => typeof v === 'object' && v !== null && 'id' in v ? v.id : String(v));
|
|
710
|
+
}
|
|
711
|
+
if (typeof value === 'object' && 'id' in value) {
|
|
712
|
+
return value.id || null;
|
|
713
|
+
}
|
|
714
|
+
return null;
|
|
715
|
+
}
|
|
716
|
+
deepEqual(a, b) {
|
|
717
|
+
if (a === b)
|
|
718
|
+
return true;
|
|
719
|
+
if (a == null && b == null)
|
|
720
|
+
return true;
|
|
721
|
+
if (a == null || b == null)
|
|
722
|
+
return false;
|
|
723
|
+
if (Array.isArray(a) && Array.isArray(b)) {
|
|
724
|
+
if (a.length !== b.length)
|
|
725
|
+
return false;
|
|
726
|
+
const sa = [...a].sort();
|
|
727
|
+
const sb = [...b].sort();
|
|
728
|
+
return JSON.stringify(sa) === JSON.stringify(sb);
|
|
729
|
+
}
|
|
730
|
+
return JSON.stringify(a) === JSON.stringify(b);
|
|
731
|
+
}
|
|
732
|
+
/** Build a submit payload containing only fields that changed relative to
|
|
733
|
+
* initialValues. For a new record (POST) initialValues is empty, so every
|
|
734
|
+
* non-null field is included. For edit (PATCH) only modified fields are sent,
|
|
735
|
+
* including fields explicitly cleared to null.
|
|
669
736
|
*/
|
|
670
737
|
buildSubmitPayload() {
|
|
671
738
|
var _a, _b;
|
|
@@ -675,23 +742,21 @@ const MrdForm = class {
|
|
|
675
742
|
if (item.type === index$1.ClientLayoutItemType.FIELD && item.field) {
|
|
676
743
|
const name = item.field.name;
|
|
677
744
|
const value = this.formValues[name];
|
|
678
|
-
// Skip file/image fields that are still uploading (value is a File object)
|
|
679
745
|
if (value instanceof File)
|
|
680
746
|
continue;
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
747
|
+
const current = this.normalizeFieldValue(value);
|
|
748
|
+
const initial = this.normalizeFieldValue(this.initialValues[name]);
|
|
749
|
+
if (this.deepEqual(current, initial))
|
|
750
|
+
continue;
|
|
751
|
+
payload[name] = current;
|
|
684
752
|
}
|
|
685
753
|
else if (item.type === index$1.ClientLayoutItemType.RELATION && item.relation) {
|
|
686
754
|
const name = item.relation.name;
|
|
687
|
-
const
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
else if (value !== '' && value !== undefined) {
|
|
693
|
-
payload[name] = value !== null && value !== void 0 ? value : null;
|
|
694
|
-
}
|
|
755
|
+
const current = this.normalizeRelationValue(this.formValues[name]);
|
|
756
|
+
const initial = this.normalizeRelationValue(this.initialValues[name]);
|
|
757
|
+
if (this.deepEqual(current, initial))
|
|
758
|
+
continue;
|
|
759
|
+
payload[name] = current;
|
|
695
760
|
}
|
|
696
761
|
}
|
|
697
762
|
return payload;
|
|
@@ -1128,7 +1193,7 @@ const MrdRelationField = class {
|
|
|
1128
1193
|
this.isLoading = true;
|
|
1129
1194
|
this.showResults = true;
|
|
1130
1195
|
this.searchDebounce = setTimeout(() => {
|
|
1131
|
-
this.mrdSearch.emit({ query, relatedClass: this.mostSignificantClass });
|
|
1196
|
+
this.mrdSearch.emit({ name: this.name, query, relatedClass: this.mostSignificantClass });
|
|
1132
1197
|
}, 300);
|
|
1133
1198
|
}
|
|
1134
1199
|
else {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var index$1 = require('./index-BPj2cBXs.js');
|
|
4
|
-
var format = require('./format-
|
|
4
|
+
var format = require('./format-IFzg0q-6.js');
|
|
5
5
|
var index = require('./index.cjs.js');
|
|
6
6
|
|
|
7
7
|
class CellRenderer {
|
|
@@ -68,7 +68,7 @@ class CellRenderer {
|
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
-
const mrdTableScss = () => `.sc-mrd-table-h{display:block;width:100%}.mrd-table__scroll.sc-mrd-table{overflow-y:auto;overflow-x:auto;border:1px solid var(--mrd-border-color);border-radius:var(--mrd-border-radius);overflow-anchor:none}.mrd-table.sc-mrd-table{overflow-x:auto}.mrd-table__table.sc-mrd-table{width:auto;min-width:100%;border-collapse:collapse;font-size:var(--mrd-font-size-sm);color:var(--mrd-color-neutral-900)}.mrd-table__scroll.sc-mrd-table .mrd-table__table.sc-mrd-table{min-width:max-content}.mrd-table__header.sc-mrd-table{position:sticky;top:0;z-index:1;background:var(--mrd-color-white);text-align:left;padding:var(--mrd-space-2) var(--mrd-space-4);border-bottom:2px solid var(--mrd-border-color);color:var(--mrd-color-neutral-600);font-weight:var(--mrd-font-weight-medium);white-space:nowrap;font-size:var(--mrd-font-size-xs);text-transform:uppercase;letter-spacing:0.04em}.mrd-table__header--sortable.sc-mrd-table{cursor:pointer;user-select:none}.mrd-table__header--sortable.sc-mrd-table:hover{background:var(--mrd-color-neutral-50);color:var(--mrd-color-neutral-800)}.mrd-table__header--sorted-asc.sc-mrd-table,.mrd-table__header--sorted-desc.sc-mrd-table{color:var(--mrd-color-primary);border-bottom-color:var(--mrd-color-primary)}.mrd-table__header-label.sc-mrd-table{margin-right:var(--mrd-space-1)}.mrd-table__sort-icon.sc-mrd-table{font-size:0.65rem;opacity:0.4;vertical-align:middle}.mrd-table__header--sorted-asc.sc-mrd-table .mrd-table__sort-icon.sc-mrd-table,.mrd-table__header--sorted-desc.sc-mrd-table .mrd-table__sort-icon.sc-mrd-table{opacity:1;color:var(--mrd-color-primary)}.mrd-table__row.sc-mrd-table{border-bottom:1px solid var(--mrd-border-color)}.mrd-table__row.sc-mrd-table:hover{background:var(--mrd-color-neutral-200) !important}.mrd-table__row--clickable.sc-mrd-table{cursor:pointer}.mrd-table__spacer.sc-mrd-table{border:none}.mrd-table__spacer.sc-mrd-table td.sc-mrd-table{padding:0;border:none}.mrd-table__cell.sc-mrd-table{padding:var(--mrd-space-2) var(--mrd-space-4);vertical-align:top;white-space:nowrap}.mrd-table__cell--numeric.sc-mrd-table{text-align:right;font-variant-numeric:tabular-nums}.mrd-table__row--loading.sc-mrd-table{background:transparent}.mrd-table__cell--placeholder.sc-mrd-table{padding:var(--mrd-space-2) var(--mrd-space-4);border-bottom:1px solid var(--mrd-border-color)}.mrd-table__placeholder-bar.sc-mrd-table{display:block;height:0.75rem;width:55%;border-radius:var(--mrd-border-radius-sm);background:linear-gradient( 90deg, var(--mrd-color-neutral-200) 25%, var(--mrd-color-neutral-100) 50%, var(--mrd-color-neutral-200) 75% );background-size:200% 100%;animation:mrd-shimmer 1.4s ease infinite}@keyframes mrd-shimmer{0%{background-position:200% 0}100%{background-position:-200% 0}}.mrd-table__toolbar.sc-mrd-table{display:flex;align-items:center;justify-content:space-between;padding-bottom:var(--mrd-space-2)}.mrd-table__toolbar-left.sc-mrd-table,.mrd-table__toolbar-right.sc-mrd-table{display:flex;gap:var(--mrd-space-2);align-items:center}.mrd-table__action.sc-mrd-table{position:relative;display:inline-flex;align-items:center;justify-content:center;width:2rem;height:2rem;padding:0;background:transparent;border:1px solid transparent;border-radius:var(--mrd-border-radius);cursor:pointer;color:var(--mrd-color-neutral-400);transition:background-color 0.15s, border-color 0.15s, color 0.15s}.mrd-table__action.sc-mrd-table:hover{background-color:var(--mrd-color-neutral-100);border-color:var(--mrd-color-neutral-300);color:var(--mrd-color-neutral-700)}.mrd-table__action.sc-mrd-table:disabled{opacity:0.4;cursor:not-allowed}.mrd-table__action--primary.sc-mrd-table{color:var(--mrd-color-neutral-500)}.mrd-table__action--primary.sc-mrd-table:hover{background:var(--mrd-color-primary);border-color:var(--mrd-color-primary);color:var(--mrd-color-white)}.mrd-table__action--danger.sc-mrd-table{color:var(--mrd-color-error)}.mrd-table__action--danger.sc-mrd-table:hover{background-color:var(--mrd-color-error-light, #fef2f2);border-color:var(--mrd-color-error)}.mrd-table__action-icon.sc-mrd-table{width:1.25rem;height:1.25rem;pointer-events:none;fill:currentColor}.mrd-table__action-tooltip.sc-mrd-table{display:none;position:absolute;bottom:calc(100% + 6px);right:0;padding:var(--mrd-space-1) var(--mrd-space-2);font-size:var(--mrd-font-size-xs);white-space:nowrap;background:var(--mrd-color-tooltip, #fffce1);color:var(--mrd-color-neutral-900);border:1px solid var(--mrd-border-color);border-radius:var(--mrd-border-radius-sm, var(--mrd-border-radius));pointer-events:none;z-index:10}.mrd-table__action.sc-mrd-table:hover .mrd-table__action-tooltip.sc-mrd-table{display:block}.mrd-table__filter-toggle--active.sc-mrd-table{background:var(--mrd-color-primary);border-color:var(--mrd-color-primary);color:var(--mrd-color-white)}.mrd-table__filter-toggle--active.sc-mrd-table:hover{background:var(--mrd-color-primary-dark, var(--mrd-color-primary));border-color:var(--mrd-color-primary-dark, var(--mrd-color-primary));color:var(--mrd-color-white)}.mrd-table__filter-badge.sc-mrd-table{position:absolute;top:-6px;right:-6px;min-width:1.25rem;height:1.25rem;padding:0 3px;background:var(--mrd-color-error, #e53e3e);color:var(--mrd-color-white);border-radius:9999px;font-size:0.65rem;font-weight:var(--mrd-font-weight-medium);line-height:1.25rem;text-align:center;pointer-events:none}.mrd-table__header--filtered.sc-mrd-table{color:var(--mrd-color-primary);border-bottom-color:var(--mrd-color-primary)}.mrd-table__header-filter-btn.sc-mrd-table{display:inline-flex;align-items:center;justify-content:center;margin-left:var(--mrd-space-1);padding:0 3px;background:transparent;border:none;border-radius:3px;cursor:pointer;color:var(--mrd-color-neutral-500);font-size:0.8rem;line-height:1;vertical-align:middle}.mrd-table__header-filter-btn.sc-mrd-table:hover{background:var(--mrd-color-neutral-200);color:var(--mrd-color-neutral-800)}.mrd-table__header-filter-btn--active.sc-mrd-table{color:var(--mrd-color-primary)}.mrd-table__filter-popup.sc-mrd-table{position:fixed;width:280px;background:var(--mrd-color-white);border:1px solid var(--mrd-border-color);border-radius:var(--mrd-border-radius);box-shadow:var(--mrd-shadow-md, 0 4px 12px rgba(0,0,0,.12));z-index:var(--mrd-z-dropdown, 200);font-size:var(--mrd-font-size-sm)}.mrd-table__filter-popup-header.sc-mrd-table{display:flex;align-items:center;justify-content:space-between;padding:var(--mrd-space-2) var(--mrd-space-3);border-bottom:1px solid var(--mrd-border-color)}.mrd-table__filter-popup-title.sc-mrd-table{font-weight:var(--mrd-font-weight-medium);color:var(--mrd-color-neutral-800);font-size:var(--mrd-font-size-sm)}.mrd-table__filter-close.sc-mrd-table{background:transparent;border:none;cursor:pointer;color:var(--mrd-color-neutral-500);font-size:0.9rem;padding:2px 4px;border-radius:3px;line-height:1}.mrd-table__filter-close.sc-mrd-table:hover{background:var(--mrd-color-neutral-100);color:var(--mrd-color-neutral-800)}.mrd-table__filter-section.sc-mrd-table{padding:var(--mrd-space-2) var(--mrd-space-3)}.mrd-table__filter-section-label.sc-mrd-table{font-size:var(--mrd-font-size-xs);font-weight:var(--mrd-font-weight-medium);text-transform:uppercase;letter-spacing:0.04em;color:var(--mrd-color-neutral-500);margin-bottom:var(--mrd-space-2)}.mrd-table__filter-sort-buttons.sc-mrd-table{display:flex;gap:var(--mrd-space-2)}.mrd-table__filter-sort-btn.sc-mrd-table{flex:1;padding:var(--mrd-space-1) var(--mrd-space-2);background:transparent;border:1px solid var(--mrd-border-color);border-radius:var(--mrd-border-radius);cursor:pointer;font-size:var(--mrd-font-size-xs);color:var(--mrd-color-neutral-700)}.mrd-table__filter-sort-btn.sc-mrd-table:hover{background:var(--mrd-color-neutral-100)}.mrd-table__filter-sort-btn--active.sc-mrd-table{background:var(--mrd-color-primary);border-color:var(--mrd-color-primary);color:var(--mrd-color-white)}.mrd-table__filter-divider.sc-mrd-table{height:1px;background:var(--mrd-border-color);margin:0}.mrd-table__filter-editor.sc-mrd-table{display:flex;flex-direction:column;gap:var(--mrd-space-2)}.mrd-table__filter-select.sc-mrd-table,.mrd-table__filter-input.sc-mrd-table{width:100%;padding:var(--mrd-space-1) var(--mrd-space-2);border:1px solid var(--mrd-border-color);border-radius:var(--mrd-border-radius);font-size:var(--mrd-font-size-sm);color:var(--mrd-color-neutral-900);background:var(--mrd-color-white);box-sizing:border-box}.mrd-table__filter-select.sc-mrd-table:focus,.mrd-table__filter-input.sc-mrd-table:focus{outline:none;border-color:var(--mrd-color-primary);box-shadow:0 0 0 2px rgba(0,0,0,.06)}.mrd-table__filter-range.sc-mrd-table{display:flex;align-items:center;gap:var(--mrd-space-1)}.mrd-table__filter-range.sc-mrd-table .mrd-table__filter-input.sc-mrd-table{flex:1;min-width:0}.mrd-table__filter-range-sep.sc-mrd-table{color:var(--mrd-color-neutral-400);flex-shrink:0}.mrd-table__filter-radio-group.sc-mrd-table{display:flex;flex-direction:column;gap:var(--mrd-space-1)}.mrd-table__filter-radio-group--inline.sc-mrd-table{flex-direction:row;gap:var(--mrd-space-3)}.mrd-table__filter-radio-label.sc-mrd-table{display:flex;align-items:center;gap:var(--mrd-space-1);cursor:pointer;font-size:var(--mrd-font-size-sm);color:var(--mrd-color-neutral-800)}.mrd-table__filter-list.sc-mrd-table{display:flex;flex-direction:column;gap:var(--mrd-space-1);max-height:180px;overflow-y:auto}.mrd-table__filter-list-controls.sc-mrd-table{display:flex;gap:var(--mrd-space-2);margin-bottom:var(--mrd-space-1)}.mrd-table__filter-list-btn.sc-mrd-table{font-size:var(--mrd-font-size-xs);color:var(--mrd-color-primary);background:transparent;border:none;cursor:pointer;padding:0;text-decoration:underline}.mrd-table__filter-checkbox-label.sc-mrd-table{display:flex;align-items:center;gap:var(--mrd-space-1);cursor:pointer;font-size:var(--mrd-font-size-sm);color:var(--mrd-color-neutral-800)}.mrd-table__filter-no-support.sc-mrd-table{font-size:var(--mrd-font-size-sm);color:var(--mrd-color-neutral-500);margin:0;font-style:italic}.mrd-table__filter-popup-footer.sc-mrd-table{display:flex;justify-content:flex-end;gap:var(--mrd-space-2);padding:var(--mrd-space-2) var(--mrd-space-3);border-top:1px solid var(--mrd-border-color)}.mrd-table__filter-btn.sc-mrd-table{padding:var(--mrd-space-1) var(--mrd-space-3);border-radius:var(--mrd-border-radius);border:1px solid var(--mrd-border-color);font-size:var(--mrd-font-size-sm);cursor:pointer}.mrd-table__filter-btn--clear.sc-mrd-table{background:transparent;color:var(--mrd-color-neutral-600)}.mrd-table__filter-btn--clear.sc-mrd-table:hover{background:var(--mrd-color-neutral-100)}.mrd-table__filter-btn--apply.sc-mrd-table{background:var(--mrd-color-primary);border-color:var(--mrd-color-primary);color:var(--mrd-color-white)}.mrd-table__filter-btn--apply.sc-mrd-table:hover{background:var(--mrd-color-primary-dark, var(--mrd-color-primary));border-color:var(--mrd-color-primary-dark, var(--mrd-color-primary))}.mrd-table__footer.sc-mrd-table{padding:var(--mrd-space-1) var(--mrd-space-2);font-size:var(--mrd-font-size-xs);color:var(--mrd-color-neutral-500);text-align:right}.mrd-table__empty.sc-mrd-table{padding:var(--mrd-space-4) var(--mrd-space-3);color:var(--mrd-color-neutral-500);font-size:var(--mrd-font-size-sm);text-align:center;margin:0}.mrd-table__file-btn.sc-mrd-table{display:inline-flex;align-items:center;gap:var(--mrd-space-1);background:none;border:none;padding:0;cursor:pointer;color:var(--mrd-color-primary);font-size:var(--mrd-font-size-sm);font-family:inherit;max-width:100%;overflow:hidden}.mrd-table__file-btn.sc-mrd-table:hover{text-decoration:underline;color:var(--mrd-color-primary-dark)}.mrd-table__file-icon.sc-mrd-table{flex-shrink:0;width:1rem;height:1rem}`;
|
|
71
|
+
const mrdTableScss = () => `.sc-mrd-table-h{display:block;width:100%}.mrd-table__scroll.sc-mrd-table{overflow-y:auto;overflow-x:auto;border:1px solid var(--mrd-border-color);border-radius:var(--mrd-border-radius);overflow-anchor:none}.mrd-table.sc-mrd-table{overflow-x:auto}.mrd-table__table.sc-mrd-table{width:auto;min-width:100%;border-collapse:collapse;font-size:var(--mrd-font-size-sm);color:var(--mrd-color-neutral-900)}.mrd-table__scroll.sc-mrd-table .mrd-table__table.sc-mrd-table{min-width:max-content}.mrd-table__header.sc-mrd-table{position:sticky;top:0;z-index:1;background:var(--mrd-color-white);text-align:left;padding:var(--mrd-space-2) var(--mrd-space-4);border-bottom:2px solid var(--mrd-border-color);color:var(--mrd-color-neutral-600);font-weight:var(--mrd-font-weight-medium);white-space:nowrap;font-size:var(--mrd-font-size-xs);text-transform:uppercase;letter-spacing:0.04em}.mrd-table__header--sortable.sc-mrd-table{cursor:pointer;user-select:none}.mrd-table__header--sortable.sc-mrd-table:hover{background:var(--mrd-color-neutral-50);color:var(--mrd-color-neutral-800)}.mrd-table__header--sorted-asc.sc-mrd-table,.mrd-table__header--sorted-desc.sc-mrd-table{color:var(--mrd-color-primary);border-bottom-color:var(--mrd-color-primary)}.mrd-table__header-label.sc-mrd-table{margin-right:var(--mrd-space-1)}.mrd-table__sort-icon.sc-mrd-table{font-size:0.85rem;opacity:0.4;vertical-align:middle}.mrd-table__header--sorted-asc.sc-mrd-table .mrd-table__sort-icon.sc-mrd-table,.mrd-table__header--sorted-desc.sc-mrd-table .mrd-table__sort-icon.sc-mrd-table{opacity:1;color:var(--mrd-color-primary)}.mrd-table__filter-icon.sc-mrd-table{display:inline-flex;align-items:center;vertical-align:middle;margin-left:var(--mrd-space-1);color:var(--mrd-color-primary)}.mrd-table__row.sc-mrd-table{border-bottom:1px solid var(--mrd-border-color)}.mrd-table__row.sc-mrd-table:hover{background:var(--mrd-color-neutral-200) !important}.mrd-table__row--clickable.sc-mrd-table{cursor:pointer}.mrd-table__spacer.sc-mrd-table{border:none}.mrd-table__spacer.sc-mrd-table td.sc-mrd-table{padding:0;border:none}.mrd-table__cell.sc-mrd-table{padding:var(--mrd-space-2) var(--mrd-space-4);vertical-align:top;white-space:nowrap}.mrd-table__cell--numeric.sc-mrd-table{text-align:right;font-variant-numeric:tabular-nums}.mrd-table__row--loading.sc-mrd-table{background:transparent}.mrd-table__cell--placeholder.sc-mrd-table{padding:var(--mrd-space-2) var(--mrd-space-4);border-bottom:1px solid var(--mrd-border-color)}.mrd-table__placeholder-bar.sc-mrd-table{display:block;height:0.75rem;width:55%;border-radius:var(--mrd-border-radius-sm);background:linear-gradient( 90deg, var(--mrd-color-neutral-200) 25%, var(--mrd-color-neutral-100) 50%, var(--mrd-color-neutral-200) 75% );background-size:200% 100%;animation:mrd-shimmer 1.4s ease infinite}@keyframes mrd-shimmer{0%{background-position:200% 0}100%{background-position:-200% 0}}.mrd-table__toolbar.sc-mrd-table{display:flex;align-items:center;justify-content:space-between;padding-bottom:var(--mrd-space-2)}.mrd-table__toolbar-left.sc-mrd-table,.mrd-table__toolbar-right.sc-mrd-table{display:flex;gap:var(--mrd-space-2);align-items:center}.mrd-table__action.sc-mrd-table{position:relative;display:inline-flex;align-items:center;justify-content:center;width:2rem;height:2rem;padding:0;background:transparent;border:1px solid transparent;border-radius:var(--mrd-border-radius);cursor:pointer;color:var(--mrd-color-neutral-400);transition:background-color 0.15s, border-color 0.15s, color 0.15s}.mrd-table__action.sc-mrd-table:hover{background-color:var(--mrd-color-neutral-100);border-color:var(--mrd-color-neutral-300);color:var(--mrd-color-neutral-700)}.mrd-table__action.sc-mrd-table:disabled{opacity:0.4;cursor:not-allowed}.mrd-table__action--primary.sc-mrd-table{color:var(--mrd-color-neutral-500)}.mrd-table__action--primary.sc-mrd-table:hover{background:var(--mrd-color-primary);border-color:var(--mrd-color-primary);color:var(--mrd-color-white)}.mrd-table__action--danger.sc-mrd-table{color:var(--mrd-color-error)}.mrd-table__action--danger.sc-mrd-table:hover{background-color:var(--mrd-color-error-light, #fef2f2);border-color:var(--mrd-color-error)}.mrd-table__action-icon.sc-mrd-table{width:1.25rem;height:1.25rem;pointer-events:none;fill:currentColor}.mrd-table__action-tooltip.sc-mrd-table{display:none;position:absolute;bottom:calc(100% + 6px);right:0;padding:var(--mrd-space-1) var(--mrd-space-2);font-size:var(--mrd-font-size-xs);white-space:nowrap;background:var(--mrd-color-tooltip, #fffce1);color:var(--mrd-color-neutral-900);border:1px solid var(--mrd-border-color);border-radius:var(--mrd-border-radius-sm, var(--mrd-border-radius));pointer-events:none;z-index:10}.mrd-table__action.sc-mrd-table:hover .mrd-table__action-tooltip.sc-mrd-table{display:block}.mrd-table__filter-toggle--active.sc-mrd-table{background:var(--mrd-color-primary);border-color:var(--mrd-color-primary);color:var(--mrd-color-white)}.mrd-table__filter-toggle--active.sc-mrd-table:hover{background:var(--mrd-color-primary-dark, var(--mrd-color-primary));border-color:var(--mrd-color-primary-dark, var(--mrd-color-primary));color:var(--mrd-color-white)}.mrd-table__filter-badge.sc-mrd-table{position:absolute;top:-6px;right:-6px;min-width:1.25rem;height:1.25rem;padding:0 3px;background:var(--mrd-color-error, #e53e3e);color:var(--mrd-color-white);border-radius:9999px;font-size:0.65rem;font-weight:var(--mrd-font-weight-medium);line-height:1.25rem;text-align:center;pointer-events:none}.mrd-table__header--filtered.sc-mrd-table{color:var(--mrd-color-primary);border-bottom-color:var(--mrd-color-primary)}.mrd-table__filter-popup.sc-mrd-table{position:fixed;width:280px;background:var(--mrd-color-white);border:1px solid var(--mrd-border-color);border-radius:var(--mrd-border-radius);box-shadow:var(--mrd-shadow-md, 0 4px 12px rgba(0,0,0,.12));z-index:var(--mrd-z-dropdown, 200);font-size:var(--mrd-font-size-sm)}.mrd-table__filter-popup-header.sc-mrd-table{display:flex;align-items:center;justify-content:space-between;padding:var(--mrd-space-2) var(--mrd-space-3);border-bottom:1px solid var(--mrd-border-color)}.mrd-table__filter-popup-title.sc-mrd-table{font-weight:var(--mrd-font-weight-medium);color:var(--mrd-color-neutral-800);font-size:var(--mrd-font-size-sm)}.mrd-table__filter-close.sc-mrd-table{background:transparent;border:none;cursor:pointer;color:var(--mrd-color-neutral-500);font-size:0.9rem;padding:2px 4px;border-radius:3px;line-height:1}.mrd-table__filter-close.sc-mrd-table:hover{background:var(--mrd-color-neutral-100);color:var(--mrd-color-neutral-800)}.mrd-table__filter-section.sc-mrd-table{padding:var(--mrd-space-2) var(--mrd-space-3)}.mrd-table__filter-section-label.sc-mrd-table{font-size:var(--mrd-font-size-xs);font-weight:var(--mrd-font-weight-medium);text-transform:uppercase;letter-spacing:0.04em;color:var(--mrd-color-neutral-500);margin-bottom:var(--mrd-space-2)}.mrd-table__filter-sort-buttons.sc-mrd-table{display:flex;gap:var(--mrd-space-2)}.mrd-table__filter-sort-btn.sc-mrd-table{flex:1;padding:var(--mrd-space-1) var(--mrd-space-2);background:transparent;border:1px solid var(--mrd-border-color);border-radius:var(--mrd-border-radius);cursor:pointer;font-size:var(--mrd-font-size-xs);color:var(--mrd-color-neutral-700)}.mrd-table__filter-sort-btn.sc-mrd-table:hover{background:var(--mrd-color-neutral-100)}.mrd-table__filter-sort-btn--active.sc-mrd-table{background:var(--mrd-color-primary);border-color:var(--mrd-color-primary);color:var(--mrd-color-white)}.mrd-table__filter-divider.sc-mrd-table{height:1px;background:var(--mrd-border-color);margin:0}.mrd-table__filter-editor.sc-mrd-table{display:flex;flex-direction:column;gap:var(--mrd-space-2)}.mrd-table__filter-select.sc-mrd-table,.mrd-table__filter-input.sc-mrd-table{width:100%;padding:var(--mrd-space-1) var(--mrd-space-2);border:1px solid var(--mrd-border-color);border-radius:var(--mrd-border-radius);font-size:var(--mrd-font-size-sm);color:var(--mrd-color-neutral-900);background:var(--mrd-color-white);box-sizing:border-box}.mrd-table__filter-select.sc-mrd-table:focus,.mrd-table__filter-input.sc-mrd-table:focus{outline:none;border-color:var(--mrd-color-primary);box-shadow:0 0 0 2px rgba(0,0,0,.06)}.mrd-table__filter-range.sc-mrd-table{display:flex;align-items:center;gap:var(--mrd-space-1)}.mrd-table__filter-range.sc-mrd-table .mrd-table__filter-input.sc-mrd-table{flex:1;min-width:0}.mrd-table__filter-range-sep.sc-mrd-table{color:var(--mrd-color-neutral-400);flex-shrink:0}.mrd-table__filter-range--stacked.sc-mrd-table{flex-direction:column;align-items:stretch;gap:var(--mrd-space-2)}.mrd-table__filter-range-label.sc-mrd-table{font-size:var(--mrd-font-size-xs);color:var(--mrd-color-neutral-500);margin-bottom:2px}.mrd-table__filter-radio-group.sc-mrd-table{display:flex;flex-direction:column;gap:var(--mrd-space-1)}.mrd-table__filter-radio-group--inline.sc-mrd-table{flex-direction:row;gap:var(--mrd-space-3)}.mrd-table__filter-radio-label.sc-mrd-table{display:flex;align-items:center;gap:var(--mrd-space-1);cursor:pointer;font-size:var(--mrd-font-size-sm);color:var(--mrd-color-neutral-800)}.mrd-table__filter-list.sc-mrd-table{display:flex;flex-direction:column;gap:var(--mrd-space-1);max-height:180px;overflow-y:auto}.mrd-table__filter-list-controls.sc-mrd-table{display:flex;gap:var(--mrd-space-2);margin-bottom:var(--mrd-space-1)}.mrd-table__filter-list-btn.sc-mrd-table{font-size:var(--mrd-font-size-xs);color:var(--mrd-color-primary);background:transparent;border:none;cursor:pointer;padding:0;text-decoration:underline}.mrd-table__filter-checkbox-label.sc-mrd-table{display:flex;align-items:center;gap:var(--mrd-space-1);cursor:pointer;font-size:var(--mrd-font-size-sm);color:var(--mrd-color-neutral-800)}.mrd-table__filter-no-support.sc-mrd-table{font-size:var(--mrd-font-size-sm);color:var(--mrd-color-neutral-500);margin:0;font-style:italic}.mrd-table__filter-popup-footer.sc-mrd-table{display:flex;justify-content:flex-end;gap:var(--mrd-space-2);padding:var(--mrd-space-2) var(--mrd-space-3);border-top:1px solid var(--mrd-border-color)}.mrd-table__filter-btn.sc-mrd-table{padding:var(--mrd-space-1) var(--mrd-space-3);border-radius:var(--mrd-border-radius);border:1px solid var(--mrd-border-color);font-size:var(--mrd-font-size-sm);cursor:pointer}.mrd-table__filter-btn--clear.sc-mrd-table{background:transparent;color:var(--mrd-color-neutral-600)}.mrd-table__filter-btn--clear.sc-mrd-table:hover{background:var(--mrd-color-neutral-100)}.mrd-table__filter-btn--apply.sc-mrd-table{background:var(--mrd-color-primary);border-color:var(--mrd-color-primary);color:var(--mrd-color-white)}.mrd-table__filter-btn--apply.sc-mrd-table:hover{background:var(--mrd-color-primary-dark, var(--mrd-color-primary));border-color:var(--mrd-color-primary-dark, var(--mrd-color-primary))}.mrd-table__footer.sc-mrd-table{padding:var(--mrd-space-1) var(--mrd-space-2);font-size:var(--mrd-font-size-xs);color:var(--mrd-color-neutral-500);text-align:right}.mrd-table__empty.sc-mrd-table{padding:var(--mrd-space-4) var(--mrd-space-3);color:var(--mrd-color-neutral-500);font-size:var(--mrd-font-size-sm);text-align:center;margin:0}.mrd-table__file-btn.sc-mrd-table{display:inline-flex;align-items:center;gap:var(--mrd-space-1);background:none;border:none;padding:0;cursor:pointer;color:var(--mrd-color-primary);font-size:var(--mrd-font-size-sm);font-family:inherit;max-width:100%;overflow:hidden}.mrd-table__file-btn.sc-mrd-table:hover{text-decoration:underline;color:var(--mrd-color-primary-dark)}.mrd-table__file-icon.sc-mrd-table{flex-shrink:0;width:1rem;height:1rem}.mrd-table__textblock-btn.sc-mrd-table{display:inline;background:none;border:none;padding:0 0 0 var(--mrd-space-1);cursor:pointer;color:var(--mrd-color-primary);font-size:var(--mrd-font-size-sm);font-family:inherit;line-height:inherit;vertical-align:middle}.mrd-table__textblock-btn.sc-mrd-table:hover{color:var(--mrd-color-primary-dark)}.mrd-table__modal-backdrop.sc-mrd-table{position:fixed;inset:0;background:rgba(0, 0, 0, 0.4);z-index:var(--mrd-z-modal, 300);display:flex;align-items:center;justify-content:center}.mrd-table__modal.sc-mrd-table{background:#fff;border-radius:var(--mrd-radius-md, 0.5rem);padding:var(--mrd-space-6);max-width:min(600px, 90vw);max-height:70vh;overflow-y:auto;position:relative;box-shadow:var(--mrd-shadow-lg)}.mrd-table__modal-close.sc-mrd-table{position:absolute;top:var(--mrd-space-3);right:var(--mrd-space-3);background:none;border:none;cursor:pointer;font-size:1.25rem;line-height:1;color:var(--mrd-color-text-muted, #6b7280);padding:0}.mrd-table__modal-close.sc-mrd-table:hover{color:var(--mrd-color-text, #111827)}.mrd-table__modal-text.sc-mrd-table{margin:0;padding-right:var(--mrd-space-6);white-space:pre-wrap;word-break:break-word;font-size:var(--mrd-font-size-sm);line-height:1.6}`;
|
|
72
72
|
|
|
73
73
|
const BUFFER = 10;
|
|
74
74
|
/** Wacht deze tijd (ms) na het laatste scroll-event voordat pagina's worden
|
|
@@ -92,6 +92,7 @@ const MrdTable = class {
|
|
|
92
92
|
this.pendingPages = new Set();
|
|
93
93
|
this.debounceTimer = null;
|
|
94
94
|
this.outsideClickHandler = null;
|
|
95
|
+
this.keydownHandler = null;
|
|
95
96
|
// ── Props ──────────────────────────────────────────────────────────────────
|
|
96
97
|
this.columns = [];
|
|
97
98
|
/** Direct rows (non-paginated mode, used when totalElements === 0). */
|
|
@@ -130,6 +131,8 @@ const MrdTable = class {
|
|
|
130
131
|
this.popupPos = { top: 0, left: 0 };
|
|
131
132
|
/** Current scroll offset of the scroll container — drives pagination footer. */
|
|
132
133
|
this.scrollTop = 0;
|
|
134
|
+
/** Full text shown in the TEXTBLOCK expand modal (null = closed). */
|
|
135
|
+
this.textblockModal = null;
|
|
133
136
|
this.handleScroll = (e) => {
|
|
134
137
|
const scroller = e.currentTarget;
|
|
135
138
|
const scrollTop = scroller.scrollTop;
|
|
@@ -206,6 +209,10 @@ const MrdTable = class {
|
|
|
206
209
|
document.removeEventListener('click', this.outsideClickHandler);
|
|
207
210
|
this.outsideClickHandler = null;
|
|
208
211
|
}
|
|
212
|
+
if (this.keydownHandler) {
|
|
213
|
+
document.removeEventListener('keydown', this.keydownHandler);
|
|
214
|
+
this.keydownHandler = null;
|
|
215
|
+
}
|
|
209
216
|
}
|
|
210
217
|
componentDidRender() {
|
|
211
218
|
if (this.colWidths.length === 0 && this.loadedPages.size > 0 && this.totalElements > 0) {
|
|
@@ -350,7 +357,26 @@ const MrdTable = class {
|
|
|
350
357
|
const defaultOperator = (TEXT_TYPES.has(dataType) || dataType === 'RELATION')
|
|
351
358
|
? 'startsWith'
|
|
352
359
|
: undefined;
|
|
353
|
-
|
|
360
|
+
// For DATETIME, stored values are UTC ISO strings; convert back to local
|
|
361
|
+
// "YYYY-MM-DD" dates so the date inputs show what the user originally entered.
|
|
362
|
+
// If from and to cover the same local day it was an exact-date filter — restore
|
|
363
|
+
// to exact mode so the user sees the single-date input again.
|
|
364
|
+
if (dataType === 'DATETIME' && existing) {
|
|
365
|
+
const display = Object.assign({}, existing);
|
|
366
|
+
if (typeof display.from === 'string' && display.from)
|
|
367
|
+
display.from = this.utcISOToLocalDate(display.from);
|
|
368
|
+
if (typeof display.to === 'string' && display.to)
|
|
369
|
+
display.to = this.utcISOToLocalDateExclusiveEnd(display.to);
|
|
370
|
+
if (display.from && display.to && display.from === display.to) {
|
|
371
|
+
this.pendingFilter = Object.assign(Object.assign({}, display), { value: display.from, from: undefined, to: undefined });
|
|
372
|
+
}
|
|
373
|
+
else {
|
|
374
|
+
this.pendingFilter = display;
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
else {
|
|
378
|
+
this.pendingFilter = existing ? Object.assign({}, existing) : { field: name, dataType, operator: defaultOperator };
|
|
379
|
+
}
|
|
354
380
|
this.openFilterCol = name;
|
|
355
381
|
// Close on outside click — re-register to replace any stale handler
|
|
356
382
|
if (this.outsideClickHandler)
|
|
@@ -370,6 +396,23 @@ const MrdTable = class {
|
|
|
370
396
|
this.outsideClickHandler = null;
|
|
371
397
|
}
|
|
372
398
|
}
|
|
399
|
+
openTextblockModal(text) {
|
|
400
|
+
this.textblockModal = text;
|
|
401
|
+
if (this.keydownHandler)
|
|
402
|
+
document.removeEventListener('keydown', this.keydownHandler);
|
|
403
|
+
this.keydownHandler = (ev) => {
|
|
404
|
+
if (ev.key === 'Escape')
|
|
405
|
+
this.closeTextblockModal();
|
|
406
|
+
};
|
|
407
|
+
document.addEventListener('keydown', this.keydownHandler);
|
|
408
|
+
}
|
|
409
|
+
closeTextblockModal() {
|
|
410
|
+
this.textblockModal = null;
|
|
411
|
+
if (this.keydownHandler) {
|
|
412
|
+
document.removeEventListener('keydown', this.keydownHandler);
|
|
413
|
+
this.keydownHandler = null;
|
|
414
|
+
}
|
|
415
|
+
}
|
|
373
416
|
setPending(key, val) {
|
|
374
417
|
this.pendingFilter = Object.assign(Object.assign({}, this.pendingFilter), { [key]: val });
|
|
375
418
|
}
|
|
@@ -393,18 +436,70 @@ const MrdTable = class {
|
|
|
393
436
|
return true;
|
|
394
437
|
return false;
|
|
395
438
|
}
|
|
439
|
+
// Convert a local "YYYY-MM-DD" date string to the UTC ISO string at the
|
|
440
|
+
// start of that local day (midnight). new Date(y, m, d) uses local time.
|
|
441
|
+
dateLocalToUTCStart(dateStr) {
|
|
442
|
+
if (!dateStr)
|
|
443
|
+
return dateStr;
|
|
444
|
+
const [year, month, day] = dateStr.split('-').map(Number);
|
|
445
|
+
return new Date(year, month - 1, day).toISOString().replace(/\.\d{3}Z$/, 'Z');
|
|
446
|
+
}
|
|
447
|
+
// Start of the day AFTER the given local date (exclusive range end).
|
|
448
|
+
dateLocalToUTCEndExclusive(dateStr) {
|
|
449
|
+
if (!dateStr)
|
|
450
|
+
return dateStr;
|
|
451
|
+
const [year, month, day] = dateStr.split('-').map(Number);
|
|
452
|
+
return new Date(year, month - 1, day + 1).toISOString().replace(/\.\d{3}Z$/, 'Z');
|
|
453
|
+
}
|
|
454
|
+
// Convert a stored UTC ISO string back to the local "YYYY-MM-DD" date.
|
|
455
|
+
utcISOToLocalDate(utcStr) {
|
|
456
|
+
if (!utcStr)
|
|
457
|
+
return utcStr;
|
|
458
|
+
const d = new Date(utcStr);
|
|
459
|
+
if (isNaN(d.getTime()))
|
|
460
|
+
return utcStr;
|
|
461
|
+
return `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, '0')}-${String(d.getDate()).padStart(2, '0')}`;
|
|
462
|
+
}
|
|
463
|
+
// The stored "to" value is the exclusive end (midnight of the next day).
|
|
464
|
+
// Subtract one day to recover the local date the user entered.
|
|
465
|
+
utcISOToLocalDateExclusiveEnd(utcStr) {
|
|
466
|
+
if (!utcStr)
|
|
467
|
+
return utcStr;
|
|
468
|
+
const d = new Date(utcStr);
|
|
469
|
+
if (isNaN(d.getTime()))
|
|
470
|
+
return utcStr;
|
|
471
|
+
d.setDate(d.getDate() - 1);
|
|
472
|
+
return `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, '0')}-${String(d.getDate()).padStart(2, '0')}`;
|
|
473
|
+
}
|
|
396
474
|
applyFilter() {
|
|
397
475
|
const f = this.pendingFilter;
|
|
398
476
|
if (!(f === null || f === void 0 ? void 0 : f.field)) {
|
|
399
477
|
this.closeFilterPopup();
|
|
400
478
|
return;
|
|
401
479
|
}
|
|
480
|
+
// For DATETIME fields the user enters local dates; convert to UTC ISO strings.
|
|
481
|
+
// Exact date → range covering the full local day (from = midnight, to = next midnight).
|
|
482
|
+
// "to" is always the exclusive end (midnight of the next local day).
|
|
483
|
+
let normalized = Object.assign({}, f);
|
|
484
|
+
if (f.dataType === 'DATETIME') {
|
|
485
|
+
if (typeof normalized.value === 'string' && normalized.value) {
|
|
486
|
+
normalized.from = this.dateLocalToUTCStart(normalized.value);
|
|
487
|
+
normalized.to = this.dateLocalToUTCEndExclusive(normalized.value);
|
|
488
|
+
normalized.value = undefined;
|
|
489
|
+
}
|
|
490
|
+
else {
|
|
491
|
+
if (typeof normalized.from === 'string' && normalized.from)
|
|
492
|
+
normalized.from = this.dateLocalToUTCStart(normalized.from);
|
|
493
|
+
if (typeof normalized.to === 'string' && normalized.to)
|
|
494
|
+
normalized.to = this.dateLocalToUTCEndExclusive(normalized.to);
|
|
495
|
+
}
|
|
496
|
+
}
|
|
402
497
|
const next = new Map(this.activeFilters);
|
|
403
|
-
if (this.filterHasValue(
|
|
404
|
-
next.set(
|
|
498
|
+
if (this.filterHasValue(normalized)) {
|
|
499
|
+
next.set(normalized.field, normalized);
|
|
405
500
|
}
|
|
406
501
|
else {
|
|
407
|
-
next.delete(
|
|
502
|
+
next.delete(normalized.field);
|
|
408
503
|
}
|
|
409
504
|
this.activeFilters = next;
|
|
410
505
|
this.closeFilterPopup();
|
|
@@ -449,7 +544,7 @@ const MrdTable = class {
|
|
|
449
544
|
}
|
|
450
545
|
// ── Render: filter popup ───────────────────────────────────────────────────
|
|
451
546
|
renderFilterEditor(col) {
|
|
452
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
547
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
453
548
|
const pf = (_a = this.pendingFilter) !== null && _a !== void 0 ? _a : {};
|
|
454
549
|
const dataType = this.colDataType(col);
|
|
455
550
|
if (NO_FILTER_TYPES.has(dataType)) {
|
|
@@ -481,12 +576,14 @@ const MrdTable = class {
|
|
|
481
576
|
const rangeMode = pf.from !== undefined || pf.to !== undefined;
|
|
482
577
|
return (index$1.h("div", { class: "mrd-table__filter-editor" }, index$1.h("div", { class: "mrd-table__filter-radio-group mrd-table__filter-radio-group--inline" }, index$1.h("label", { class: "mrd-table__filter-radio-label" }, index$1.h("input", { type: "radio", name: `nm-${this.openFilterCol}`, checked: !rangeMode, onChange: () => { this.pendingFilter = Object.assign(Object.assign({}, pf), { from: undefined, to: undefined }); } }), format.t('filter_exact', this.locale)), index$1.h("label", { class: "mrd-table__filter-radio-label" }, index$1.h("input", { type: "radio", name: `nm-${this.openFilterCol}`, checked: rangeMode, onChange: () => { this.pendingFilter = Object.assign(Object.assign({}, pf), { value: undefined, from: null, to: null }); } }), format.t('filter_range', this.locale))), !rangeMode ? (index$1.h("input", { type: "number", class: "mrd-table__filter-input", value: pf.value != null ? String(pf.value) : '', onInput: (e) => this.setPending('value', e.target.value) })) : (index$1.h("div", { class: "mrd-table__filter-range" }, index$1.h("input", { type: "number", class: "mrd-table__filter-input", placeholder: format.t('filter_from', this.locale), value: pf.from != null ? String(pf.from) : '', onInput: (e) => this.setPending('from', e.target.value) }), index$1.h("span", { class: "mrd-table__filter-range-sep" }, "\u2013"), index$1.h("input", { type: "number", class: "mrd-table__filter-input", placeholder: format.t('filter_to', this.locale), value: pf.to != null ? String(pf.to) : '', onInput: (e) => this.setPending('to', e.target.value) })))));
|
|
483
578
|
}
|
|
579
|
+
if (dataType === 'DATETIME') {
|
|
580
|
+
const rangeMode = pf.from !== undefined || pf.to !== undefined;
|
|
581
|
+
return (index$1.h("div", { class: "mrd-table__filter-editor" }, index$1.h("div", { class: "mrd-table__filter-radio-group mrd-table__filter-radio-group--inline" }, index$1.h("label", { class: "mrd-table__filter-radio-label" }, index$1.h("input", { type: "radio", name: `dt-${this.openFilterCol}`, checked: !rangeMode, onChange: () => { this.pendingFilter = Object.assign(Object.assign({}, pf), { from: undefined, to: undefined }); } }), format.t('filter_exact', this.locale)), index$1.h("label", { class: "mrd-table__filter-radio-label" }, index$1.h("input", { type: "radio", name: `dt-${this.openFilterCol}`, checked: rangeMode, onChange: () => { this.pendingFilter = Object.assign(Object.assign({}, pf), { value: undefined, from: null, to: null }); } }), format.t('filter_range', this.locale))), !rangeMode ? (index$1.h("input", { type: "date", class: "mrd-table__filter-input", value: String((_g = pf.value) !== null && _g !== void 0 ? _g : ''), onInput: (e) => this.setPending('value', e.target.value) })) : (index$1.h("div", { class: "mrd-table__filter-range mrd-table__filter-range--stacked" }, index$1.h("label", { class: "mrd-table__filter-range-label" }, format.t('filter_from', this.locale)), index$1.h("input", { type: "date", class: "mrd-table__filter-input", value: pf.from != null ? String(pf.from) : '', onInput: (e) => this.setPending('from', e.target.value) }), index$1.h("label", { class: "mrd-table__filter-range-label" }, format.t('filter_to', this.locale)), index$1.h("input", { type: "date", class: "mrd-table__filter-input", value: pf.to != null ? String(pf.to) : '', onInput: (e) => this.setPending('to', e.target.value) })))));
|
|
582
|
+
}
|
|
484
583
|
if (DATE_TYPES.has(dataType)) {
|
|
485
|
-
const inputType = dataType === 'DATE' ? 'date'
|
|
486
|
-
: dataType === 'DATETIME' ? 'datetime-local'
|
|
487
|
-
: 'time';
|
|
584
|
+
const inputType = dataType === 'DATE' ? 'date' : 'time';
|
|
488
585
|
const rangeMode = pf.from !== undefined || pf.to !== undefined;
|
|
489
|
-
return (index$1.h("div", { class: "mrd-table__filter-editor" }, index$1.h("div", { class: "mrd-table__filter-radio-group mrd-table__filter-radio-group--inline" }, index$1.h("label", { class: "mrd-table__filter-radio-label" }, index$1.h("input", { type: "radio", name: `dt-${this.openFilterCol}`, checked: !rangeMode, onChange: () => { this.pendingFilter = Object.assign(Object.assign({}, pf), { from: undefined, to: undefined }); } }), format.t('filter_exact', this.locale)), index$1.h("label", { class: "mrd-table__filter-radio-label" }, index$1.h("input", { type: "radio", name: `dt-${this.openFilterCol}`, checked: rangeMode, onChange: () => { this.pendingFilter = Object.assign(Object.assign({}, pf), { value: undefined, from: null, to: null }); } }), format.t('filter_range', this.locale))), !rangeMode ? (index$1.h("input", { type: inputType, class: "mrd-table__filter-input", value: String((
|
|
586
|
+
return (index$1.h("div", { class: "mrd-table__filter-editor" }, index$1.h("div", { class: "mrd-table__filter-radio-group mrd-table__filter-radio-group--inline" }, index$1.h("label", { class: "mrd-table__filter-radio-label" }, index$1.h("input", { type: "radio", name: `dt-${this.openFilterCol}`, checked: !rangeMode, onChange: () => { this.pendingFilter = Object.assign(Object.assign({}, pf), { from: undefined, to: undefined }); } }), format.t('filter_exact', this.locale)), index$1.h("label", { class: "mrd-table__filter-radio-label" }, index$1.h("input", { type: "radio", name: `dt-${this.openFilterCol}`, checked: rangeMode, onChange: () => { this.pendingFilter = Object.assign(Object.assign({}, pf), { value: undefined, from: null, to: null }); } }), format.t('filter_range', this.locale))), !rangeMode ? (index$1.h("input", { type: inputType, class: "mrd-table__filter-input", value: String((_h = pf.value) !== null && _h !== void 0 ? _h : ''), onInput: (e) => this.setPending('value', e.target.value) })) : (index$1.h("div", { class: "mrd-table__filter-range" }, index$1.h("input", { type: inputType, class: "mrd-table__filter-input", placeholder: format.t('filter_from', this.locale), value: pf.from != null ? String(pf.from) : '', onInput: (e) => this.setPending('from', e.target.value) }), index$1.h("input", { type: inputType, class: "mrd-table__filter-input", placeholder: format.t('filter_to', this.locale), value: pf.to != null ? String(pf.to) : '', onInput: (e) => this.setPending('to', e.target.value) })))));
|
|
490
587
|
}
|
|
491
588
|
return null;
|
|
492
589
|
}
|
|
@@ -539,6 +636,15 @@ const MrdTable = class {
|
|
|
539
636
|
this.mrdDownload.emit({ href, fileName });
|
|
540
637
|
} }, index$1.h("svg", { class: "mrd-table__file-icon", viewBox: "0 0 24 24", "aria-hidden": "true" }, index$1.h("path", { fill: "currentColor", d: "M14 2H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V8l-6-6zm-1 7V3.5L18.5 9H13zm-3 8l-3-3 1.41-1.41L10 14.17l4.59-4.58L16 11l-6 6z" })), format.t('download', this.locale))) : ''));
|
|
541
638
|
}
|
|
639
|
+
const TEXTBLOCK_MAX = 200;
|
|
640
|
+
if (dataType === 'TEXTBLOCK') {
|
|
641
|
+
const full = CellRenderer.render(col, row, this.locale);
|
|
642
|
+
if (full.length <= TEXTBLOCK_MAX) {
|
|
643
|
+
return index$1.h("td", { class: "mrd-table__cell" }, full);
|
|
644
|
+
}
|
|
645
|
+
const preview = full.slice(0, TEXTBLOCK_MAX) + '…';
|
|
646
|
+
return (index$1.h("td", { class: "mrd-table__cell" }, preview, index$1.h("button", { class: "mrd-table__textblock-btn", onClick: (e) => { e.stopPropagation(); this.openTextblockModal(full); }, "aria-label": format.t('textblock_show_more', this.locale) }, "\u22EF")));
|
|
647
|
+
}
|
|
542
648
|
const value = CellRenderer.render(col, row, this.locale);
|
|
543
649
|
return (index$1.h("td", { class: `mrd-table__cell${isNumeric ? ' mrd-table__cell--numeric' : ''}` }, value));
|
|
544
650
|
}
|
|
@@ -553,8 +659,13 @@ const MrdTable = class {
|
|
|
553
659
|
var _a, _b, _c, _d;
|
|
554
660
|
const name = this.colName(col);
|
|
555
661
|
const isFiltered = this.activeFilters.has(name);
|
|
556
|
-
|
|
557
|
-
|
|
662
|
+
const cls = [
|
|
663
|
+
'mrd-table__header',
|
|
664
|
+
isFiltered ? 'mrd-table__header--filtered' : '',
|
|
665
|
+
this.filterMode ? 'mrd-table__header--sortable' : '',
|
|
666
|
+
].filter(Boolean).join(' ');
|
|
667
|
+
return (index$1.h("th", { class: cls, onClick: this.filterMode ? (e) => this.handleFilterOpen(col, e) : undefined }, index$1.h("span", { class: "mrd-table__header-label" }, (_d = (_b = (_a = col.field) === null || _a === void 0 ? void 0 : _a.label) !== null && _b !== void 0 ? _b : (_c = col.relation) === null || _c === void 0 ? void 0 : _c.label) !== null && _d !== void 0 ? _d : ''), isFiltered && this.renderFilterIcon()));
|
|
668
|
+
}))), index$1.h("tbody", null, (_b = this.rows) === null || _b === void 0 ? void 0 : _b.map((row, i) => (index$1.h("tr", { class: "mrd-table__row mrd-table__row--clickable", style: { background: i % 2 === 0 ? '' : 'var(--mrd-color-neutral-100)' }, onClick: () => this.mrdRowClick.emit(row) }, this.columns.map(col => this.renderCell(col, row))))))), (!this.rows || this.rows.length === 0) && (index$1.h("p", { class: "mrd-table__empty" }, format.t('no_results', this.locale)))), this.renderFooter((_c = this.rows) === null || _c === void 0 ? void 0 : _c.length), this.renderFilterPopup(), this.renderTextblockModal()));
|
|
558
669
|
}
|
|
559
670
|
// ── Paginated / virtual-scroll mode ────────────────────────────────────
|
|
560
671
|
// Derive the authoritative row count from loaded pages:
|
|
@@ -596,8 +707,16 @@ const MrdTable = class {
|
|
|
596
707
|
isActive ? `mrd-table__header--sorted-${this.sortDir}` : '',
|
|
597
708
|
isFiltered ? 'mrd-table__header--filtered' : '',
|
|
598
709
|
].filter(Boolean).join(' ');
|
|
599
|
-
return (index$1.h("th", { class: cls, style: this.colWidths[idx] ? { width: `${this.colWidths[idx]}px` } : undefined, onClick: () => this.handleSortClick(col) }, index$1.h("span", { class: "mrd-table__header-label" }, (_d = (_b = (_a = col.field) === null || _a === void 0 ? void 0 : _a.label) !== null && _b !== void 0 ? _b : (_c = col.relation) === null || _c === void 0 ? void 0 : _c.label) !== null && _d !== void 0 ? _d : ''), index$1.h("span", { class: "mrd-table__sort-icon", "aria-hidden": "true" },
|
|
600
|
-
}))), index$1.h("tbody", null, topSpacerHeight > 0 && (index$1.h("tr", { class: "mrd-table__spacer", style: { height: `${topSpacerHeight}px` } }, index$1.h("td", { colSpan: colCount }))), renderedRows, bottomSpacerHeight > 0 && (index$1.h("tr", { class: "mrd-table__spacer", style: { height: `${bottomSpacerHeight}px` } }, index$1.h("td", { colSpan: colCount })))))), effectiveTotal === 0 && this.loadedPages.has(0) && (index$1.h("p", { class: "mrd-table__empty" }, format.t('no_results', this.locale))), effectiveTotal > 0 && this.renderFooter(undefined, effectiveTotal), this.renderFilterPopup()));
|
|
710
|
+
return (index$1.h("th", { class: cls, style: this.colWidths[idx] ? { width: `${this.colWidths[idx]}px` } : undefined, onClick: (e) => this.filterMode ? this.handleFilterOpen(col, e) : this.handleSortClick(col) }, index$1.h("span", { class: "mrd-table__header-label" }, (_d = (_b = (_a = col.field) === null || _a === void 0 ? void 0 : _a.label) !== null && _b !== void 0 ? _b : (_c = col.relation) === null || _c === void 0 ? void 0 : _c.label) !== null && _d !== void 0 ? _d : ''), isActive && (index$1.h("span", { class: "mrd-table__sort-icon", "aria-hidden": "true" }, this.sortDir === 'asc' ? '▲' : '▼')), !isActive && !this.filterMode && (index$1.h("span", { class: "mrd-table__sort-icon", "aria-hidden": "true" }, "\u21C5")), isFiltered && this.renderFilterIcon()));
|
|
711
|
+
}))), index$1.h("tbody", null, topSpacerHeight > 0 && (index$1.h("tr", { class: "mrd-table__spacer", style: { height: `${topSpacerHeight}px` } }, index$1.h("td", { colSpan: colCount }))), renderedRows, bottomSpacerHeight > 0 && (index$1.h("tr", { class: "mrd-table__spacer", style: { height: `${bottomSpacerHeight}px` } }, index$1.h("td", { colSpan: colCount })))))), effectiveTotal === 0 && this.loadedPages.has(0) && (index$1.h("p", { class: "mrd-table__empty" }, format.t('no_results', this.locale))), effectiveTotal > 0 && this.renderFooter(undefined, effectiveTotal), this.renderFilterPopup(), this.renderTextblockModal()));
|
|
712
|
+
}
|
|
713
|
+
renderFilterIcon() {
|
|
714
|
+
return (index$1.h("span", { class: "mrd-table__filter-icon", "aria-hidden": "true" }, index$1.h("svg", { viewBox: "0 0 24 24", width: "14", height: "14", fill: "currentColor" }, index$1.h("path", { d: "M10 18h4v-2h-4v2zM3 6v2h18V6H3zm3 7h12v-2H6v2z" }))));
|
|
715
|
+
}
|
|
716
|
+
renderTextblockModal() {
|
|
717
|
+
if (this.textblockModal === null)
|
|
718
|
+
return null;
|
|
719
|
+
return (index$1.h("div", { class: "mrd-table__modal-backdrop", onClick: () => this.closeTextblockModal(), role: "dialog", "aria-modal": "true" }, index$1.h("div", { class: "mrd-table__modal", onClick: (e) => e.stopPropagation() }, index$1.h("button", { class: "mrd-table__modal-close", onClick: () => this.closeTextblockModal(), "aria-label": format.t('close', this.locale) }, "\u2715"), index$1.h("p", { class: "mrd-table__modal-text" }, this.textblockModal))));
|
|
601
720
|
}
|
|
602
721
|
get el() { return index$1.getElement(this); }
|
|
603
722
|
static get watchers() { return {
|