@mmlogic/components 0.1.27 → 0.1.29

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.
@@ -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-boolean-field_19.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-layout-section",{"items":[16],"data":[16],"views":[16],"links":[16],"locale":[1],"searchQueryMap":[32],"searchResultsMap":[32],"imagePreviewUrl":[32],"imagePreviews":[32],"activeViewMap":[32],"setSearchResults":[64],"setViewPage":[64],"setViewAggregations":[64],"setImagePreview":[64],"openImagePreview":[64]},null,{"links":[{"linksChanged":0}],"data":[{"dataChanged":0}]}],[2,"mrd-field",{"item":[16],"locale":[1],"value":[16]}],[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],"viewLabel":[1,"view-label"],"alternativeViews":[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],"jsonModal":[32],"aggregations":[32],"init":[64],"setPage":[64],"setAggregations":[64]},null,{"totalElements":[{"totalElementsChanged":0}]}],[2,"mrd-boolean-field",{"name":[1],"label":[1],"value":[4],"required":[4],"disabled":[4],"locale":[1],"checked":[32]}],[2,"mrd-currency-field",{"name":[1],"label":[1],"value":[16],"required":[4],"disabled":[4],"locale":[1],"amountDisplay":[32],"currency":[32],"error":[32]}],[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-longtext-field",{"name":[1],"label":[1],"value":[1],"placeholder":[1],"required":[4],"disabled":[4],"locale":[1],"error":[32]}],[2,"mrd-number-field",{"name":[1],"label":[1],"value":[2],"placeholder":[1],"required":[4],"disabled":[4],"locale":[1],"dataType":[1,"data-type"],"decimalPrecision":[2,"decimal-precision"],"displayValue":[32],"error":[32]}],[2,"mrd-relation-field",{"name":[1],"label":[1],"required":[4],"disabled":[4],"locale":[1],"relatedClass":[1,"related-class"],"mostSignificantClass":[1,"most-significant-class"],"displayType":[1,"display-type"],"editBehavior":[1,"edit-behavior"],"commonRelation":[1,"common-relation"],"multiple":[4],"dropdownValues":[16],"value":[1],"searchQuery":[32],"searchResults":[32],"allRecords":[32],"isLoading":[32],"selectedItems":[32],"showResults":[32],"error":[32],"highlightedIndex":[32],"setAllRecords":[64],"setSearchResults":[64],"setLoading":[64]},null,{"allRecords":[{"allRecordsChanged":0}]}],[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-boolean-field_19.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-layout-section",{"items":[16],"data":[16],"views":[16],"links":[16],"locale":[1],"searchQueryMap":[32],"searchResultsMap":[32],"imagePreviewUrl":[32],"imagePreviews":[32],"activeViewMap":[32],"setSearchResults":[64],"setViewPage":[64],"setViewAggregations":[64],"setImagePreview":[64],"openImagePreview":[64]},null,{"links":[{"linksChanged":0}],"data":[{"dataChanged":0}]}],[2,"mrd-field",{"item":[16],"locale":[1],"value":[16]}],[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],"viewLabel":[1,"view-label"],"alternativeViews":[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],"jsonModal":[32],"aggregations":[32],"init":[64],"setPage":[64],"setAggregations":[64]},null,{"totalElements":[{"totalElementsChanged":0}],"defaultSort":[{"defaultSortChanged":0}]}],[2,"mrd-boolean-field",{"name":[1],"label":[1],"value":[4],"required":[4],"disabled":[4],"locale":[1],"checked":[32]}],[2,"mrd-currency-field",{"name":[1],"label":[1],"value":[16],"required":[4],"disabled":[4],"locale":[1],"amountDisplay":[32],"currency":[32],"error":[32]}],[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-longtext-field",{"name":[1],"label":[1],"value":[1],"placeholder":[1],"required":[4],"disabled":[4],"locale":[1],"error":[32]}],[2,"mrd-number-field",{"name":[1],"label":[1],"value":[2],"placeholder":[1],"required":[4],"disabled":[4],"locale":[1],"dataType":[1,"data-type"],"decimalPrecision":[2,"decimal-precision"],"displayValue":[32],"error":[32]}],[2,"mrd-relation-field",{"name":[1],"label":[1],"required":[4],"disabled":[4],"locale":[1],"relatedClass":[1,"related-class"],"mostSignificantClass":[1,"most-significant-class"],"displayType":[1,"display-type"],"editBehavior":[1,"edit-behavior"],"commonRelation":[1,"common-relation"],"multiple":[4],"dropdownValues":[16],"value":[1],"searchQuery":[32],"searchResults":[32],"allRecords":[32],"isLoading":[32],"selectedItems":[32],"showResults":[32],"error":[32],"highlightedIndex":[32],"setAllRecords":[64],"setSearchResults":[64],"setLoading":[64]},null,{"allRecords":[{"allRecordsChanged":0}]}],[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-boolean-field_19.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-layout-section",{"items":[16],"data":[16],"views":[16],"links":[16],"locale":[1],"searchQueryMap":[32],"searchResultsMap":[32],"imagePreviewUrl":[32],"imagePreviews":[32],"activeViewMap":[32],"setSearchResults":[64],"setViewPage":[64],"setViewAggregations":[64],"setImagePreview":[64],"openImagePreview":[64]},null,{"links":[{"linksChanged":0}],"data":[{"dataChanged":0}]}],[2,"mrd-field",{"item":[16],"locale":[1],"value":[16]}],[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],"viewLabel":[1,"view-label"],"alternativeViews":[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],"jsonModal":[32],"aggregations":[32],"init":[64],"setPage":[64],"setAggregations":[64]},null,{"totalElements":[{"totalElementsChanged":0}]}],[2,"mrd-boolean-field",{"name":[1],"label":[1],"value":[4],"required":[4],"disabled":[4],"locale":[1],"checked":[32]}],[2,"mrd-currency-field",{"name":[1],"label":[1],"value":[16],"required":[4],"disabled":[4],"locale":[1],"amountDisplay":[32],"currency":[32],"error":[32]}],[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-longtext-field",{"name":[1],"label":[1],"value":[1],"placeholder":[1],"required":[4],"disabled":[4],"locale":[1],"error":[32]}],[2,"mrd-number-field",{"name":[1],"label":[1],"value":[2],"placeholder":[1],"required":[4],"disabled":[4],"locale":[1],"dataType":[1,"data-type"],"decimalPrecision":[2,"decimal-precision"],"displayValue":[32],"error":[32]}],[2,"mrd-relation-field",{"name":[1],"label":[1],"required":[4],"disabled":[4],"locale":[1],"relatedClass":[1,"related-class"],"mostSignificantClass":[1,"most-significant-class"],"displayType":[1,"display-type"],"editBehavior":[1,"edit-behavior"],"commonRelation":[1,"common-relation"],"multiple":[4],"dropdownValues":[16],"value":[1],"searchQuery":[32],"searchResults":[32],"allRecords":[32],"isLoading":[32],"selectedItems":[32],"showResults":[32],"error":[32],"highlightedIndex":[32],"setAllRecords":[64],"setSearchResults":[64],"setLoading":[64]},null,{"allRecords":[{"allRecordsChanged":0}]}],[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-boolean-field_19.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-layout-section",{"items":[16],"data":[16],"views":[16],"links":[16],"locale":[1],"searchQueryMap":[32],"searchResultsMap":[32],"imagePreviewUrl":[32],"imagePreviews":[32],"activeViewMap":[32],"setSearchResults":[64],"setViewPage":[64],"setViewAggregations":[64],"setImagePreview":[64],"openImagePreview":[64]},null,{"links":[{"linksChanged":0}],"data":[{"dataChanged":0}]}],[2,"mrd-field",{"item":[16],"locale":[1],"value":[16]}],[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],"viewLabel":[1,"view-label"],"alternativeViews":[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],"jsonModal":[32],"aggregations":[32],"init":[64],"setPage":[64],"setAggregations":[64]},null,{"totalElements":[{"totalElementsChanged":0}],"defaultSort":[{"defaultSortChanged":0}]}],[2,"mrd-boolean-field",{"name":[1],"label":[1],"value":[4],"required":[4],"disabled":[4],"locale":[1],"checked":[32]}],[2,"mrd-currency-field",{"name":[1],"label":[1],"value":[16],"required":[4],"disabled":[4],"locale":[1],"amountDisplay":[32],"currency":[32],"error":[32]}],[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-longtext-field",{"name":[1],"label":[1],"value":[1],"placeholder":[1],"required":[4],"disabled":[4],"locale":[1],"error":[32]}],[2,"mrd-number-field",{"name":[1],"label":[1],"value":[2],"placeholder":[1],"required":[4],"disabled":[4],"locale":[1],"dataType":[1,"data-type"],"decimalPrecision":[2,"decimal-precision"],"displayValue":[32],"error":[32]}],[2,"mrd-relation-field",{"name":[1],"label":[1],"required":[4],"disabled":[4],"locale":[1],"relatedClass":[1,"related-class"],"mostSignificantClass":[1,"most-significant-class"],"displayType":[1,"display-type"],"editBehavior":[1,"edit-behavior"],"commonRelation":[1,"common-relation"],"multiple":[4],"dropdownValues":[16],"value":[1],"searchQuery":[32],"searchResults":[32],"allRecords":[32],"isLoading":[32],"selectedItems":[32],"showResults":[32],"error":[32],"highlightedIndex":[32],"setAllRecords":[64],"setSearchResults":[64],"setLoading":[64]},null,{"allRecords":[{"allRecordsChanged":0}]}],[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;
@@ -1394,10 +1394,13 @@ const MrdLayoutSection = class {
1394
1394
  this.imagePreviews = {};
1395
1395
  this.activeViewMap = {};
1396
1396
  this.viewLinksMap = {};
1397
+ this.activeFiltersMap = {};
1397
1398
  this.searchTimers = {};
1398
1399
  this.handleViewLoadPage = (e, name) => {
1400
+ var _a;
1399
1401
  e.stopPropagation();
1400
- this.mrdLoadViewPage.emit({ name, page: e.detail.page, sort: e.detail.sort });
1402
+ const filters = (_a = this.activeFiltersMap[name]) !== null && _a !== void 0 ? _a : [];
1403
+ this.mrdLoadViewPage.emit({ name, page: e.detail.page, sort: e.detail.sort, filters });
1401
1404
  };
1402
1405
  this.handleSearchInput = (dataClass, query) => {
1403
1406
  this.searchQueryMap = Object.assign(Object.assign({}, this.searchQueryMap), { [dataClass]: query });
@@ -1429,8 +1432,23 @@ const MrdLayoutSection = class {
1429
1432
  this.emitLoadViews();
1430
1433
  }
1431
1434
  }
1435
+ resolveViewFilters(viewConfig) {
1436
+ var _a;
1437
+ return ((_a = viewConfig.filter) !== null && _a !== void 0 ? _a : []).map(f => {
1438
+ var _a, _b, _c, _d;
1439
+ const base = { field: f.name, dataType: 'TEXT' };
1440
+ switch (f.operator) {
1441
+ case 'FROM': return Object.assign(Object.assign({}, base), { from: (_a = f.value) !== null && _a !== void 0 ? _a : null });
1442
+ case 'TO': return Object.assign(Object.assign({}, base), { to: (_b = f.value) !== null && _b !== void 0 ? _b : null });
1443
+ case 'STARTS_WITH': return Object.assign(Object.assign({}, base), { operator: 'startsWith', value: (_c = f.value) !== null && _c !== void 0 ? _c : null });
1444
+ case 'NOT_EMPTY': return Object.assign(Object.assign({}, base), { operator: 'isNotEmpty' });
1445
+ case 'EMPTY': return Object.assign(Object.assign({}, base), { operator: 'isEmpty' });
1446
+ default: return Object.assign(Object.assign({}, base), { operator: 'equals', value: (_d = f.value) !== null && _d !== void 0 ? _d : null });
1447
+ }
1448
+ });
1449
+ }
1432
1450
  emitLoadViews() {
1433
- var _a, _b, _c, _d, _e, _f;
1451
+ var _a, _b, _c, _d, _e, _f, _g, _h;
1434
1452
  const dataLinks = ((_b = (_a = this.data) === null || _a === void 0 ? void 0 : _a._links) !== null && _b !== void 0 ? _b : {});
1435
1453
  for (const item of this.flattenItems(this.items)) {
1436
1454
  if (item.type === index$1.ClientLayoutItemType.RELATED_VIEW && item.relatedView) {
@@ -1439,17 +1457,17 @@ const MrdLayoutSection = class {
1439
1457
  if (!viewConfig)
1440
1458
  continue;
1441
1459
  const href = (_c = dataLinks[rv.relatedClass]) === null || _c === void 0 ? void 0 : _c.href;
1442
- this.mrdLoadView.emit({ name: rv.name, href, viewConfig });
1460
+ this.mrdLoadView.emit({ name: rv.name, href, viewConfig, sort: (_d = viewConfig.defaultSort) !== null && _d !== void 0 ? _d : '', filters: this.resolveViewFilters(viewConfig) });
1443
1461
  }
1444
1462
  else if (item.type === index$1.ClientLayoutItemType.VIEW) {
1445
- const viewName = (_e = (_d = item.view) === null || _d === void 0 ? void 0 : _d.name) !== null && _e !== void 0 ? _e : item.name;
1463
+ const viewName = (_f = (_e = item.view) === null || _e === void 0 ? void 0 : _e.name) !== null && _f !== void 0 ? _f : item.name;
1446
1464
  if (!viewName)
1447
1465
  continue;
1448
1466
  const viewConfig = this.views[viewName];
1449
1467
  if (!viewConfig)
1450
1468
  continue;
1451
- const href = (_f = this.links[viewName]) === null || _f === void 0 ? void 0 : _f.href;
1452
- this.mrdLoadView.emit({ name: viewName, href, viewConfig });
1469
+ const href = (_g = this.links[viewName]) === null || _g === void 0 ? void 0 : _g.href;
1470
+ this.mrdLoadView.emit({ name: viewName, href, viewConfig, sort: (_h = viewConfig.defaultSort) !== null && _h !== void 0 ? _h : '', filters: this.resolveViewFilters(viewConfig) });
1453
1471
  }
1454
1472
  }
1455
1473
  }
@@ -1633,7 +1651,7 @@ const MrdLayoutSection = class {
1633
1651
  return (index.h("div", { class: "mrd-layout-section__search", key: `search-${dataClass}` }, 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)))))))));
1634
1652
  }
1635
1653
  renderRelatedView(item) {
1636
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
1654
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
1637
1655
  const isRelated = item.type === index$1.ClientLayoutItemType.RELATED_VIEW;
1638
1656
  // Support both nested (item.view / item.relatedView) and flat API format (item.name)
1639
1657
  const name = isRelated
@@ -1647,11 +1665,15 @@ const MrdLayoutSection = class {
1647
1665
  const showTitle = isRelated
1648
1666
  ? (_d = item.relatedView) === null || _d === void 0 ? void 0 : _d.showTitle
1649
1667
  : ((_g = (_f = (_e = item.view) === null || _e === void 0 ? void 0 : _e.showTitle) !== null && _f !== void 0 ? _f : item.showTitle) !== null && _g !== void 0 ? _g : false);
1650
- const altViews = item.alternativeViews;
1651
1668
  const activeName = (_h = this.activeViewMap[name]) !== null && _h !== void 0 ? _h : name;
1652
1669
  const activeViewConfig = (_j = this.views[activeName]) !== null && _j !== void 0 ? _j : viewConfig;
1653
- const viewLabel = (_m = (_l = (_k = item.label) !== null && _k !== void 0 ? _k : activeViewConfig.pluralLabel) !== null && _l !== void 0 ? _l : activeViewConfig.singularLabel) !== null && _m !== void 0 ? _m : '';
1654
- const rawActions = (_o = item.actions) !== null && _o !== void 0 ? _o : ['NEW', 'EXPORT'];
1670
+ // Build the full view list (original + alternatives) so the switcher can always go back.
1671
+ const originalLabel = (_m = (_l = (_k = viewConfig.pluralLabel) !== null && _k !== void 0 ? _k : viewConfig.singularLabel) !== null && _l !== void 0 ? _l : item.label) !== null && _m !== void 0 ? _m : name;
1672
+ const allViews = [{ name, label: originalLabel }, ...((_o = item.alternativeViews) !== null && _o !== void 0 ? _o : [])];
1673
+ const activeEntry = allViews.find(v => v.name === activeName);
1674
+ const viewLabel = (_r = (_q = (_p = activeEntry === null || activeEntry === void 0 ? void 0 : activeEntry.label) !== null && _p !== void 0 ? _p : activeViewConfig.pluralLabel) !== null && _q !== void 0 ? _q : activeViewConfig.singularLabel) !== null && _r !== void 0 ? _r : '';
1675
+ const altViews = allViews.filter(v => v.name !== activeName);
1676
+ const rawActions = (_s = item.actions) !== null && _s !== void 0 ? _s : ['NEW', 'EXPORT'];
1655
1677
  const tableActions = rawActions.reduce((acc, a) => {
1656
1678
  if (a === 'NEW')
1657
1679
  acc.push({ action: 'create', label: t('table_new_record', this.locale), icon: 'assets/sprites.svg#icon-plus', variant: 'primary' });
@@ -1659,27 +1681,32 @@ const MrdLayoutSection = class {
1659
1681
  acc.push({ action: 'export', label: t('table_export_excel', this.locale), icon: 'assets/sprites.svg#icon-file-excel' });
1660
1682
  return acc;
1661
1683
  }, []);
1662
- return (index.h("div", { class: "mrd-layout-section__related-view", key: `view-${name}` }, showTitle && item.label && index.h("h3", { class: "mrd-layout-section__related-view-title" }, item.label), index.h("mrd-table", { "data-view": name, columns: activeViewConfig.values, locale: this.locale, defaultSort: (_p = activeViewConfig.defaultSort) !== null && _p !== void 0 ? _p : '', viewLabel: viewLabel, alternativeViews: altViews, actions: tableActions, onMrdLoadPage: (e) => this.handleViewLoadPage(e, name), onMrdSwitchView: (e) => {
1663
- var _a, _b, _c, _d, _e, _f;
1684
+ return (index.h("div", { class: "mrd-layout-section__related-view", key: `view-${name}` }, showTitle && item.label && index.h("h3", { class: "mrd-layout-section__related-view-title" }, item.label), index.h("mrd-table", { "data-view": name, columns: activeViewConfig.values, locale: this.locale, defaultSort: (_t = activeViewConfig.defaultSort) !== null && _t !== void 0 ? _t : '', viewLabel: viewLabel, alternativeViews: altViews, actions: tableActions, onMrdLoadPage: (e) => this.handleViewLoadPage(e, name), onMrdSwitchView: (e) => {
1685
+ var _a, _b, _c, _d, _e, _f, _g;
1664
1686
  e.stopPropagation();
1665
1687
  const newViewName = e.detail.name;
1666
1688
  const newViewConfig = this.views[newViewName];
1667
1689
  if (!newViewConfig)
1668
1690
  return;
1669
1691
  this.activeViewMap = Object.assign(Object.assign({}, this.activeViewMap), { [name]: newViewName });
1692
+ this.activeFiltersMap = Object.assign(Object.assign({}, this.activeFiltersMap), { [name]: [] });
1670
1693
  const dataLinks = ((_b = (_a = this.data) === null || _a === void 0 ? void 0 : _a._links) !== null && _b !== void 0 ? _b : {});
1671
1694
  const href = isRelated
1672
1695
  ? (_c = dataLinks[item.relatedView.relatedClass]) === null || _c === void 0 ? void 0 : _c.href
1673
1696
  : ((_e = (_d = this.links[newViewName]) === null || _d === void 0 ? void 0 : _d.href) !== null && _e !== void 0 ? _e : (_f = this.links[name]) === null || _f === void 0 ? void 0 : _f.href);
1674
- this.mrdLoadView.emit({ name, href, viewConfig: newViewConfig });
1697
+ this.mrdLoadView.emit({ name, href, viewConfig: newViewConfig, sort: (_g = newViewConfig.defaultSort) !== null && _g !== void 0 ? _g : '', filters: this.resolveViewFilters(newViewConfig) });
1698
+ }, onMrdFilter: (e) => {
1699
+ e.stopPropagation();
1700
+ this.activeFiltersMap = Object.assign(Object.assign({}, this.activeFiltersMap), { [name]: e.detail.filters });
1675
1701
  }, onMrdLoadAggregations: (e) => {
1676
- var _a, _b, _c, _d, _e, _f, _g;
1702
+ var _a, _b, _c, _d, _e, _f, _g, _h;
1677
1703
  e.stopPropagation();
1678
1704
  const dataLinks = ((_b = (_a = this.data) === null || _a === void 0 ? void 0 : _a._links) !== null && _b !== void 0 ? _b : {});
1679
1705
  const href = isRelated
1680
1706
  ? (_c = dataLinks[item.relatedView.relatedClass]) === null || _c === void 0 ? void 0 : _c.href
1681
1707
  : ((_f = (_e = this.links[(_d = this.activeViewMap[name]) !== null && _d !== void 0 ? _d : name]) === null || _e === void 0 ? void 0 : _e.href) !== null && _f !== void 0 ? _f : (_g = this.links[name]) === null || _g === void 0 ? void 0 : _g.href);
1682
- this.mrdLoadViewAggregations.emit(Object.assign({ name, href }, e.detail));
1708
+ const filters = (_h = this.activeFiltersMap[name]) !== null && _h !== void 0 ? _h : [];
1709
+ this.mrdLoadViewAggregations.emit(Object.assign({ name, href, filters }, e.detail));
1683
1710
  }, onMrdAction: (e) => {
1684
1711
  var _a, _b, _c;
1685
1712
  e.stopPropagation();
@@ -1719,7 +1746,7 @@ const MrdLayoutSection = class {
1719
1746
  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: "" }))));
1720
1747
  }
1721
1748
  render() {
1722
- return (index.h(index.Host, { key: '61e2e24dfc38480f95a76ae5b433fcdf31c7c2ab' }, index.h("div", { key: 'bbe3fa8d350cb8175ae3884ba879463d172fd65b', class: "mrd-layout-section" }, this.items.map(item => this.renderItem(item))), this.renderImageModal()));
1749
+ return (index.h(index.Host, { key: 'bf92b312d32b17bac4cb43691175951ebdecca47' }, index.h("div", { key: '4c6ce4650395d15d15777ba5abecf3b8ea98f11d', class: "mrd-layout-section" }, this.items.map(item => this.renderItem(item))), this.renderImageModal()));
1723
1750
  }
1724
1751
  get el() { return index.getElement(this); }
1725
1752
  static get watchers() { return {
@@ -2265,6 +2292,27 @@ const MrdTable = class {
2265
2292
  totalElementsChanged(newVal) {
2266
2293
  this.renderEnd = Math.min(this.renderEnd, Math.max(0, newVal - 1));
2267
2294
  }
2295
+ /** Apply defaultSort when the prop changes (e.g. after a view switch). */
2296
+ defaultSortChanged(newVal) {
2297
+ this.applyDefaultSort(newVal);
2298
+ }
2299
+ // ── Lifecycle ──────────────────────────────────────────────────────────────
2300
+ componentWillLoad() {
2301
+ this.applyDefaultSort(this.defaultSort);
2302
+ }
2303
+ // ── Helpers ────────────────────────────────────────────────────────────────
2304
+ applyDefaultSort(defaultSort) {
2305
+ var _a;
2306
+ if (defaultSort) {
2307
+ const parts = defaultSort.split(',');
2308
+ this.sortField = parts[0].trim();
2309
+ this.sortDir = ((_a = parts[1]) === null || _a === void 0 ? void 0 : _a.trim()) === 'desc' ? 'desc' : 'asc';
2310
+ }
2311
+ else {
2312
+ this.sortField = '';
2313
+ this.sortDir = 'asc';
2314
+ }
2315
+ }
2268
2316
  // ── Public API ─────────────────────────────────────────────────────────────
2269
2317
  /**
2270
2318
  * Initialise (or reset) the virtual scroll.
@@ -2272,7 +2320,6 @@ const MrdTable = class {
2272
2320
  * but before calling setPage(0, rows).
2273
2321
  */
2274
2322
  async init() {
2275
- var _a;
2276
2323
  if (this.debounceTimer !== null) {
2277
2324
  clearTimeout(this.debounceTimer);
2278
2325
  this.debounceTimer = null;
@@ -2281,15 +2328,6 @@ const MrdTable = class {
2281
2328
  this.loadedPages = new Map();
2282
2329
  this.requestedPages = new Set();
2283
2330
  this.colWidths = [];
2284
- if (this.defaultSort) {
2285
- const parts = this.defaultSort.split(',');
2286
- this.sortField = parts[0].trim();
2287
- this.sortDir = ((_a = parts[1]) === null || _a === void 0 ? void 0 : _a.trim()) === 'desc' ? 'desc' : 'asc';
2288
- }
2289
- else {
2290
- this.sortField = '';
2291
- this.sortDir = 'asc';
2292
- }
2293
2331
  this.scrollTop = 0;
2294
2332
  this.renderStart = 0;
2295
2333
  // No BUFFER on init — only request what fits the visible area (page 0).
@@ -2984,6 +3022,9 @@ const MrdTable = class {
2984
3022
  static get watchers() { return {
2985
3023
  "totalElements": [{
2986
3024
  "totalElementsChanged": 0
3025
+ }],
3026
+ "defaultSort": [{
3027
+ "defaultSortChanged": 0
2987
3028
  }]
2988
3029
  }; }
2989
3030
  };
@@ -19,10 +19,13 @@ export class MrdLayoutSection {
19
19
  this.imagePreviews = {};
20
20
  this.activeViewMap = {};
21
21
  this.viewLinksMap = {};
22
+ this.activeFiltersMap = {};
22
23
  this.searchTimers = {};
23
24
  this.handleViewLoadPage = (e, name) => {
25
+ var _a;
24
26
  e.stopPropagation();
25
- this.mrdLoadViewPage.emit({ name, page: e.detail.page, sort: e.detail.sort });
27
+ const filters = (_a = this.activeFiltersMap[name]) !== null && _a !== void 0 ? _a : [];
28
+ this.mrdLoadViewPage.emit({ name, page: e.detail.page, sort: e.detail.sort, filters });
26
29
  };
27
30
  this.handleSearchInput = (dataClass, query) => {
28
31
  this.searchQueryMap = Object.assign(Object.assign({}, this.searchQueryMap), { [dataClass]: query });
@@ -54,8 +57,23 @@ export class MrdLayoutSection {
54
57
  this.emitLoadViews();
55
58
  }
56
59
  }
60
+ resolveViewFilters(viewConfig) {
61
+ var _a;
62
+ return ((_a = viewConfig.filter) !== null && _a !== void 0 ? _a : []).map(f => {
63
+ var _a, _b, _c, _d;
64
+ const base = { field: f.name, dataType: 'TEXT' };
65
+ switch (f.operator) {
66
+ case 'FROM': return Object.assign(Object.assign({}, base), { from: (_a = f.value) !== null && _a !== void 0 ? _a : null });
67
+ case 'TO': return Object.assign(Object.assign({}, base), { to: (_b = f.value) !== null && _b !== void 0 ? _b : null });
68
+ case 'STARTS_WITH': return Object.assign(Object.assign({}, base), { operator: 'startsWith', value: (_c = f.value) !== null && _c !== void 0 ? _c : null });
69
+ case 'NOT_EMPTY': return Object.assign(Object.assign({}, base), { operator: 'isNotEmpty' });
70
+ case 'EMPTY': return Object.assign(Object.assign({}, base), { operator: 'isEmpty' });
71
+ default: return Object.assign(Object.assign({}, base), { operator: 'equals', value: (_d = f.value) !== null && _d !== void 0 ? _d : null });
72
+ }
73
+ });
74
+ }
57
75
  emitLoadViews() {
58
- var _a, _b, _c, _d, _e, _f;
76
+ var _a, _b, _c, _d, _e, _f, _g, _h;
59
77
  const dataLinks = ((_b = (_a = this.data) === null || _a === void 0 ? void 0 : _a._links) !== null && _b !== void 0 ? _b : {});
60
78
  for (const item of this.flattenItems(this.items)) {
61
79
  if (item.type === ClientLayoutItemType.RELATED_VIEW && item.relatedView) {
@@ -64,17 +82,17 @@ export class MrdLayoutSection {
64
82
  if (!viewConfig)
65
83
  continue;
66
84
  const href = (_c = dataLinks[rv.relatedClass]) === null || _c === void 0 ? void 0 : _c.href;
67
- this.mrdLoadView.emit({ name: rv.name, href, viewConfig });
85
+ this.mrdLoadView.emit({ name: rv.name, href, viewConfig, sort: (_d = viewConfig.defaultSort) !== null && _d !== void 0 ? _d : '', filters: this.resolveViewFilters(viewConfig) });
68
86
  }
69
87
  else if (item.type === ClientLayoutItemType.VIEW) {
70
- const viewName = (_e = (_d = item.view) === null || _d === void 0 ? void 0 : _d.name) !== null && _e !== void 0 ? _e : item.name;
88
+ const viewName = (_f = (_e = item.view) === null || _e === void 0 ? void 0 : _e.name) !== null && _f !== void 0 ? _f : item.name;
71
89
  if (!viewName)
72
90
  continue;
73
91
  const viewConfig = this.views[viewName];
74
92
  if (!viewConfig)
75
93
  continue;
76
- const href = (_f = this.links[viewName]) === null || _f === void 0 ? void 0 : _f.href;
77
- this.mrdLoadView.emit({ name: viewName, href, viewConfig });
94
+ const href = (_g = this.links[viewName]) === null || _g === void 0 ? void 0 : _g.href;
95
+ this.mrdLoadView.emit({ name: viewName, href, viewConfig, sort: (_h = viewConfig.defaultSort) !== null && _h !== void 0 ? _h : '', filters: this.resolveViewFilters(viewConfig) });
78
96
  }
79
97
  }
80
98
  }
@@ -258,7 +276,7 @@ export class MrdLayoutSection {
258
276
  return (h("div", { class: "mrd-layout-section__search", key: `search-${dataClass}` }, 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 && (h("ul", { class: "mrd-layout-section__search-results" }, results.map(r => (h("li", { key: r.id, class: "mrd-layout-section__search-result" }, h("button", { class: "mrd-layout-section__search-result-btn", onClick: () => this.mrdNavigate.emit({ href: r.id, label: r.label }) }, h("span", { class: "mrd-layout-section__search-result-label" }, r.label), r.description && h("span", { class: "mrd-layout-section__search-result-desc" }, r.description)))))))));
259
277
  }
260
278
  renderRelatedView(item) {
261
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
279
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
262
280
  const isRelated = item.type === ClientLayoutItemType.RELATED_VIEW;
263
281
  // Support both nested (item.view / item.relatedView) and flat API format (item.name)
264
282
  const name = isRelated
@@ -272,11 +290,15 @@ export class MrdLayoutSection {
272
290
  const showTitle = isRelated
273
291
  ? (_d = item.relatedView) === null || _d === void 0 ? void 0 : _d.showTitle
274
292
  : ((_g = (_f = (_e = item.view) === null || _e === void 0 ? void 0 : _e.showTitle) !== null && _f !== void 0 ? _f : item.showTitle) !== null && _g !== void 0 ? _g : false);
275
- const altViews = item.alternativeViews;
276
293
  const activeName = (_h = this.activeViewMap[name]) !== null && _h !== void 0 ? _h : name;
277
294
  const activeViewConfig = (_j = this.views[activeName]) !== null && _j !== void 0 ? _j : viewConfig;
278
- const viewLabel = (_m = (_l = (_k = item.label) !== null && _k !== void 0 ? _k : activeViewConfig.pluralLabel) !== null && _l !== void 0 ? _l : activeViewConfig.singularLabel) !== null && _m !== void 0 ? _m : '';
279
- const rawActions = (_o = item.actions) !== null && _o !== void 0 ? _o : ['NEW', 'EXPORT'];
295
+ // Build the full view list (original + alternatives) so the switcher can always go back.
296
+ const originalLabel = (_m = (_l = (_k = viewConfig.pluralLabel) !== null && _k !== void 0 ? _k : viewConfig.singularLabel) !== null && _l !== void 0 ? _l : item.label) !== null && _m !== void 0 ? _m : name;
297
+ const allViews = [{ name, label: originalLabel }, ...((_o = item.alternativeViews) !== null && _o !== void 0 ? _o : [])];
298
+ const activeEntry = allViews.find(v => v.name === activeName);
299
+ const viewLabel = (_r = (_q = (_p = activeEntry === null || activeEntry === void 0 ? void 0 : activeEntry.label) !== null && _p !== void 0 ? _p : activeViewConfig.pluralLabel) !== null && _q !== void 0 ? _q : activeViewConfig.singularLabel) !== null && _r !== void 0 ? _r : '';
300
+ const altViews = allViews.filter(v => v.name !== activeName);
301
+ const rawActions = (_s = item.actions) !== null && _s !== void 0 ? _s : ['NEW', 'EXPORT'];
280
302
  const tableActions = rawActions.reduce((acc, a) => {
281
303
  if (a === 'NEW')
282
304
  acc.push({ action: 'create', label: t('table_new_record', this.locale), icon: 'assets/sprites.svg#icon-plus', variant: 'primary' });
@@ -284,27 +306,32 @@ export class MrdLayoutSection {
284
306
  acc.push({ action: 'export', label: t('table_export_excel', this.locale), icon: 'assets/sprites.svg#icon-file-excel' });
285
307
  return acc;
286
308
  }, []);
287
- return (h("div", { class: "mrd-layout-section__related-view", key: `view-${name}` }, showTitle && item.label && h("h3", { class: "mrd-layout-section__related-view-title" }, item.label), h("mrd-table", { "data-view": name, columns: activeViewConfig.values, locale: this.locale, defaultSort: (_p = activeViewConfig.defaultSort) !== null && _p !== void 0 ? _p : '', viewLabel: viewLabel, alternativeViews: altViews, actions: tableActions, onMrdLoadPage: (e) => this.handleViewLoadPage(e, name), onMrdSwitchView: (e) => {
288
- var _a, _b, _c, _d, _e, _f;
309
+ return (h("div", { class: "mrd-layout-section__related-view", key: `view-${name}` }, showTitle && item.label && h("h3", { class: "mrd-layout-section__related-view-title" }, item.label), h("mrd-table", { "data-view": name, columns: activeViewConfig.values, locale: this.locale, defaultSort: (_t = activeViewConfig.defaultSort) !== null && _t !== void 0 ? _t : '', viewLabel: viewLabel, alternativeViews: altViews, actions: tableActions, onMrdLoadPage: (e) => this.handleViewLoadPage(e, name), onMrdSwitchView: (e) => {
310
+ var _a, _b, _c, _d, _e, _f, _g;
289
311
  e.stopPropagation();
290
312
  const newViewName = e.detail.name;
291
313
  const newViewConfig = this.views[newViewName];
292
314
  if (!newViewConfig)
293
315
  return;
294
316
  this.activeViewMap = Object.assign(Object.assign({}, this.activeViewMap), { [name]: newViewName });
317
+ this.activeFiltersMap = Object.assign(Object.assign({}, this.activeFiltersMap), { [name]: [] });
295
318
  const dataLinks = ((_b = (_a = this.data) === null || _a === void 0 ? void 0 : _a._links) !== null && _b !== void 0 ? _b : {});
296
319
  const href = isRelated
297
320
  ? (_c = dataLinks[item.relatedView.relatedClass]) === null || _c === void 0 ? void 0 : _c.href
298
321
  : ((_e = (_d = this.links[newViewName]) === null || _d === void 0 ? void 0 : _d.href) !== null && _e !== void 0 ? _e : (_f = this.links[name]) === null || _f === void 0 ? void 0 : _f.href);
299
- this.mrdLoadView.emit({ name, href, viewConfig: newViewConfig });
322
+ this.mrdLoadView.emit({ name, href, viewConfig: newViewConfig, sort: (_g = newViewConfig.defaultSort) !== null && _g !== void 0 ? _g : '', filters: this.resolveViewFilters(newViewConfig) });
323
+ }, onMrdFilter: (e) => {
324
+ e.stopPropagation();
325
+ this.activeFiltersMap = Object.assign(Object.assign({}, this.activeFiltersMap), { [name]: e.detail.filters });
300
326
  }, onMrdLoadAggregations: (e) => {
301
- var _a, _b, _c, _d, _e, _f, _g;
327
+ var _a, _b, _c, _d, _e, _f, _g, _h;
302
328
  e.stopPropagation();
303
329
  const dataLinks = ((_b = (_a = this.data) === null || _a === void 0 ? void 0 : _a._links) !== null && _b !== void 0 ? _b : {});
304
330
  const href = isRelated
305
331
  ? (_c = dataLinks[item.relatedView.relatedClass]) === null || _c === void 0 ? void 0 : _c.href
306
332
  : ((_f = (_e = this.links[(_d = this.activeViewMap[name]) !== null && _d !== void 0 ? _d : name]) === null || _e === void 0 ? void 0 : _e.href) !== null && _f !== void 0 ? _f : (_g = this.links[name]) === null || _g === void 0 ? void 0 : _g.href);
307
- this.mrdLoadViewAggregations.emit(Object.assign({ name, href }, e.detail));
333
+ const filters = (_h = this.activeFiltersMap[name]) !== null && _h !== void 0 ? _h : [];
334
+ this.mrdLoadViewAggregations.emit(Object.assign({ name, href, filters }, e.detail));
308
335
  }, onMrdAction: (e) => {
309
336
  var _a, _b, _c;
310
337
  e.stopPropagation();
@@ -344,7 +371,7 @@ export class MrdLayoutSection {
344
371
  return (h("div", { class: "mrd-layout-section__modal-backdrop", onClick: () => { this.imagePreviewUrl = null; } }, h("div", { class: "mrd-layout-section__modal", onClick: (e) => e.stopPropagation() }, h("button", { class: "mrd-layout-section__modal-close", onClick: () => { this.imagePreviewUrl = null; } }, "\u2715"), h("img", { class: "mrd-layout-section__modal-image", src: this.imagePreviewUrl, alt: "" }))));
345
372
  }
346
373
  render() {
347
- return (h(Host, { key: '61e2e24dfc38480f95a76ae5b433fcdf31c7c2ab' }, h("div", { key: 'bbe3fa8d350cb8175ae3884ba879463d172fd65b', class: "mrd-layout-section" }, this.items.map(item => this.renderItem(item))), this.renderImageModal()));
374
+ return (h(Host, { key: 'bf92b312d32b17bac4cb43691175951ebdecca47' }, h("div", { key: '4c6ce4650395d15d15777ba5abecf3b8ea98f11d', class: "mrd-layout-section" }, this.items.map(item => this.renderItem(item))), this.renderImageModal()));
348
375
  }
349
376
  static get is() { return "mrd-layout-section"; }
350
377
  static get encapsulation() { return "scoped"; }
@@ -555,14 +582,20 @@ export class MrdLayoutSection {
555
582
  "text": "Fired once on load for each RELATED_VIEW and VIEW item; host fetches page 0 and calls setViewPage()."
556
583
  },
557
584
  "complexType": {
558
- "original": "{ name: string; href?: string; viewConfig: ClientViewMetadata }",
559
- "resolved": "{ name: string; href?: string | undefined; viewConfig: ClientViewMetadata; }",
585
+ "original": "{ name: string; href?: string; viewConfig: ClientViewMetadata; sort: string; filters: ColumnFilter[] }",
586
+ "resolved": "{ name: string; href?: string | undefined; viewConfig: ClientViewMetadata; sort: string; filters: ColumnFilter[]; }",
560
587
  "references": {
561
588
  "ClientViewMetadata": {
562
589
  "location": "import",
563
590
  "path": "../../types/client-layout",
564
591
  "id": "src/types/client-layout.ts::ClientViewMetadata",
565
592
  "referenceLocation": "ClientViewMetadata"
593
+ },
594
+ "ColumnFilter": {
595
+ "location": "import",
596
+ "path": "../../utils/cell-renderer",
597
+ "id": "src/utils/cell-renderer.ts::ColumnFilter",
598
+ "referenceLocation": "ColumnFilter"
566
599
  }
567
600
  }
568
601
  }
@@ -577,9 +610,16 @@ export class MrdLayoutSection {
577
610
  "text": "Re-emitted from an embedded mrd-table's mrdLoadPage; host fetches the next page and calls setViewPage()."
578
611
  },
579
612
  "complexType": {
580
- "original": "{ name: string; page: number; sort: string }",
581
- "resolved": "{ name: string; page: number; sort: string; }",
582
- "references": {}
613
+ "original": "{ name: string; page: number; sort: string; filters: ColumnFilter[] }",
614
+ "resolved": "{ name: string; page: number; sort: string; filters: ColumnFilter[]; }",
615
+ "references": {
616
+ "ColumnFilter": {
617
+ "location": "import",
618
+ "path": "../../utils/cell-renderer",
619
+ "id": "src/utils/cell-renderer.ts::ColumnFilter",
620
+ "referenceLocation": "ColumnFilter"
621
+ }
622
+ }
583
623
  }
584
624
  }, {
585
625
  "method": "mrdLoadImage",
@@ -622,9 +662,16 @@ export class MrdLayoutSection {
622
662
  "text": "Re-emitted from an embedded mrd-table's mrdLoadAggregations; host calls setViewAggregations() with the result."
623
663
  },
624
664
  "complexType": {
625
- "original": "{ name: string; href?: string; sum?: string[]; avg?: string[]; count?: string[] }",
626
- "resolved": "{ name: string; href?: string | undefined; sum?: string[] | undefined; avg?: string[] | undefined; count?: string[] | undefined; }",
627
- "references": {}
665
+ "original": "{ name: string; href?: string; filters: ColumnFilter[]; sum?: string[]; avg?: string[]; count?: string[] }",
666
+ "resolved": "{ name: string; href?: string | undefined; filters: ColumnFilter[]; sum?: string[] | undefined; avg?: string[] | undefined; count?: string[] | undefined; }",
667
+ "references": {
668
+ "ColumnFilter": {
669
+ "location": "import",
670
+ "path": "../../utils/cell-renderer",
671
+ "id": "src/utils/cell-renderer.ts::ColumnFilter",
672
+ "referenceLocation": "ColumnFilter"
673
+ }
674
+ }
628
675
  }
629
676
  }];
630
677
  }
@@ -86,6 +86,27 @@ export class MrdTable {
86
86
  totalElementsChanged(newVal) {
87
87
  this.renderEnd = Math.min(this.renderEnd, Math.max(0, newVal - 1));
88
88
  }
89
+ /** Apply defaultSort when the prop changes (e.g. after a view switch). */
90
+ defaultSortChanged(newVal) {
91
+ this.applyDefaultSort(newVal);
92
+ }
93
+ // ── Lifecycle ──────────────────────────────────────────────────────────────
94
+ componentWillLoad() {
95
+ this.applyDefaultSort(this.defaultSort);
96
+ }
97
+ // ── Helpers ────────────────────────────────────────────────────────────────
98
+ applyDefaultSort(defaultSort) {
99
+ var _a;
100
+ if (defaultSort) {
101
+ const parts = defaultSort.split(',');
102
+ this.sortField = parts[0].trim();
103
+ this.sortDir = ((_a = parts[1]) === null || _a === void 0 ? void 0 : _a.trim()) === 'desc' ? 'desc' : 'asc';
104
+ }
105
+ else {
106
+ this.sortField = '';
107
+ this.sortDir = 'asc';
108
+ }
109
+ }
89
110
  // ── Public API ─────────────────────────────────────────────────────────────
90
111
  /**
91
112
  * Initialise (or reset) the virtual scroll.
@@ -93,7 +114,6 @@ export class MrdTable {
93
114
  * but before calling setPage(0, rows).
94
115
  */
95
116
  async init() {
96
- var _a;
97
117
  if (this.debounceTimer !== null) {
98
118
  clearTimeout(this.debounceTimer);
99
119
  this.debounceTimer = null;
@@ -102,15 +122,6 @@ export class MrdTable {
102
122
  this.loadedPages = new Map();
103
123
  this.requestedPages = new Set();
104
124
  this.colWidths = [];
105
- if (this.defaultSort) {
106
- const parts = this.defaultSort.split(',');
107
- this.sortField = parts[0].trim();
108
- this.sortDir = ((_a = parts[1]) === null || _a === void 0 ? void 0 : _a.trim()) === 'desc' ? 'desc' : 'asc';
109
- }
110
- else {
111
- this.sortField = '';
112
- this.sortDir = 'asc';
113
- }
114
125
  this.scrollTop = 0;
115
126
  this.renderStart = 0;
116
127
  // No BUFFER on init — only request what fits the visible area (page 0).
@@ -1281,6 +1292,9 @@ export class MrdTable {
1281
1292
  return [{
1282
1293
  "propName": "totalElements",
1283
1294
  "methodName": "totalElementsChanged"
1295
+ }, {
1296
+ "propName": "defaultSort",
1297
+ "methodName": "defaultSortChanged"
1284
1298
  }];
1285
1299
  }
1286
1300
  }