@meshmakers/shared-ui 3.4.650 → 3.4.660

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meshmakers/shared-ui",
3
- "version": "3.4.650",
3
+ "version": "3.4.660",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^22.0.0",
6
6
  "@angular/core": "^22.0.0",
@@ -9,11 +9,11 @@ import { Observable } from 'rxjs';
9
9
  import { DialogContentBase, DialogRef, WindowRef } from '@progress/kendo-angular-dialog';
10
10
  import * as _meshmakers_shared_ui from '@meshmakers/shared-ui';
11
11
  import { State } from '@progress/kendo-data-query/dist/npm/state';
12
- import { PagerSettings, SelectableSettings, SelectionEvent, PageChangeEvent, CellClickEvent, DataBindingDirective } from '@progress/kendo-angular-grid';
12
+ import { PagerSettings, SelectableSettings, SelectionEvent, PageChangeEvent, CellClickEvent, DataBindingDirective, DataStateChangeEvent } from '@progress/kendo-angular-grid';
13
13
  import { SVGIcon as SVGIcon$1 } from '@progress/kendo-svg-icons/dist/svg-icon.interface';
14
14
  import { MenuItem, ContextMenuComponent, ContextMenuSelectEvent, ContextMenuPopupEvent } from '@progress/kendo-angular-menu';
15
15
  import { AutoCompleteComponent } from '@progress/kendo-angular-dropdowns';
16
- import { CompositeFilterDescriptor } from '@progress/kendo-data-query';
16
+ import { CompositeFilterDescriptor, SortDescriptor, State as State$1 } from '@progress/kendo-data-query';
17
17
  import { CanDeactivate } from '@angular/router';
18
18
 
19
19
  /**
@@ -205,6 +205,8 @@ interface ListViewMessages {
205
205
  exportToPdf: string;
206
206
  /** Tooltip for "Refresh Data" button. Default: "Refresh Data" */
207
207
  refreshData: string;
208
+ /** Tooltip for the "Reset Filters" button. Default: "Reset Filters" */
209
+ resetFilters: string;
208
210
  /** Title for the actions command column. Default: "Actions" */
209
211
  actionsColumnTitle: string;
210
212
  /** PDF footer page template. Default: "Page {pageNum} of {totalPages}" */
@@ -307,6 +309,25 @@ declare class ListViewComponent extends CommandBaseService implements OnDestroy,
307
309
  sortable: boolean;
308
310
  rowFilterEnabled: boolean;
309
311
  searchTextBoxEnabled: boolean;
312
+ /**
313
+ * Persist the user's sort/row-filter/page across visits (localStorage) so they
314
+ * are not re-applied every time. On by default. Set `false` to opt a list out
315
+ * (e.g. a transient/embedded list where a remembered filter would confuse).
316
+ */
317
+ persistListState: boolean;
318
+ /**
319
+ * Storage key for {@link persistListState}. Defaults to the current route path
320
+ * (without query string), which is stable per list page. Set an explicit key
321
+ * when two lists share a route, or to keep the stored state stable across a
322
+ * route rename.
323
+ */
324
+ listStateKey?: string;
325
+ private readonly routerRef;
326
+ /**
327
+ * Resolves the effective storage key for this list, or `null` when
328
+ * persistence is disabled. Used by {@link MmListViewDataBindingDirective}.
329
+ */
330
+ resolveListStateKey(): string | null;
310
331
  /** The page size the grid actually uses: the measured fit-to-height value in `autoPageSize` mode, `pageSize` otherwise. */
311
332
  protected effectivePageSize(): number;
312
333
  private _cachedAutoPageable?;
@@ -420,13 +441,29 @@ declare class ListViewComponent extends CommandBaseService implements OnDestroy,
420
441
  protected onRangeFilterChange(value: number | null, column: TableColumn, operator: 'gte' | 'lte'): void;
421
442
  protected onShowRowFilter(): void;
422
443
  protected onRefresh(): void;
444
+ /**
445
+ * Resets all filtering back to the default view: clears the row filter,
446
+ * column sort, free-text search and page offset, drops the persisted state,
447
+ * and emits {@link onResetFilters} so the host can also reset its own
448
+ * quick-view/bar filters.
449
+ */
450
+ protected onReset(): void;
423
451
  onExecuteFilter: EventEmitter<string | null>;
424
452
  onRefreshData: EventEmitter<void>;
453
+ /** Emitted when the toolbar "Reset Filters" button is clicked (host resets its bar filters). */
454
+ resetFilters: EventEmitter<void>;
425
455
  protected onFilter(value: string | null): Promise<void>;
456
+ /**
457
+ * Restores the search box's displayed text without re-triggering a fetch
458
+ * (used by {@link MmListViewDataBindingDirective} when replaying a persisted
459
+ * list state — the directive already carries the value into the initial fetch).
460
+ */
461
+ restoreSearchValue(value: string | null): void;
426
462
  protected readonly filterIcon: SVGIcon$1;
427
463
  protected readonly pdfSVG: SVGIcon$1;
428
464
  protected readonly excelSVG: SVGIcon$1;
429
465
  protected readonly refreshIcon: SVGIcon$1;
466
+ protected readonly resetFilterIcon: SVGIcon$1;
430
467
  protected onRowSelect(event: SelectionEvent): void;
431
468
  protected onPageChange(_event: PageChangeEvent): void;
432
469
  protected onContextMenuSelect(_event: ContextMenuSelectEvent): Promise<void>;
@@ -443,7 +480,7 @@ declare class ListViewComponent extends CommandBaseService implements OnDestroy,
443
480
  protected getPdfPageText(pageNum: number, totalPages: number): string;
444
481
  protected readonly moreVerticalIcon: SVGIcon$1;
445
482
  static ɵfac: i0.ɵɵFactoryDeclaration<ListViewComponent, never>;
446
- static ɵcmp: i0.ɵɵComponentDeclaration<ListViewComponent, "mm-list-view", never, { "pageSize": { "alias": "pageSize"; "required": false; }; "skip": { "alias": "skip"; "required": false; }; "autoPageSize": { "alias": "autoPageSize"; "required": false; }; "rowIsClickable": { "alias": "rowIsClickable"; "required": false; }; "showRowCheckBoxes": { "alias": "showRowCheckBoxes"; "required": false; }; "showRowSelectAllCheckBox": { "alias": "showRowSelectAllCheckBox"; "required": false; }; "contextMenuType": { "alias": "contextMenuType"; "required": false; }; "leftToolbarActions": { "alias": "leftToolbarActions"; "required": false; }; "rightToolbarActions": { "alias": "rightToolbarActions"; "required": false; }; "actionCommandItems": { "alias": "actionCommandItems"; "required": false; }; "contextMenuCommandItems": { "alias": "contextMenuCommandItems"; "required": false; }; "excelExportFileName": { "alias": "excelExportFileName"; "required": false; }; "pdfExportFileName": { "alias": "pdfExportFileName"; "required": false; }; "pageable": { "alias": "pageable"; "required": false; }; "sortable": { "alias": "sortable"; "required": false; }; "rowFilterEnabled": { "alias": "rowFilterEnabled"; "required": false; }; "searchTextBoxEnabled": { "alias": "searchTextBoxEnabled"; "required": false; }; "resizable": { "alias": "resizable"; "required": false; }; "actionsColumnWidth": { "alias": "actionsColumnWidth"; "required": false; }; "hideCheckboxesBelow": { "alias": "hideCheckboxesBelow"; "required": false; }; "rowClass": { "alias": "rowClass"; "required": false; }; "messages": { "alias": "messages"; "required": false; }; "selectable": { "alias": "selectable"; "required": false; }; "columns": { "alias": "columns"; "required": false; }; }, { "rowClicked": "rowClicked"; }, never, never, true, never>;
483
+ static ɵcmp: i0.ɵɵComponentDeclaration<ListViewComponent, "mm-list-view", never, { "pageSize": { "alias": "pageSize"; "required": false; }; "skip": { "alias": "skip"; "required": false; }; "autoPageSize": { "alias": "autoPageSize"; "required": false; }; "rowIsClickable": { "alias": "rowIsClickable"; "required": false; }; "showRowCheckBoxes": { "alias": "showRowCheckBoxes"; "required": false; }; "showRowSelectAllCheckBox": { "alias": "showRowSelectAllCheckBox"; "required": false; }; "contextMenuType": { "alias": "contextMenuType"; "required": false; }; "leftToolbarActions": { "alias": "leftToolbarActions"; "required": false; }; "rightToolbarActions": { "alias": "rightToolbarActions"; "required": false; }; "actionCommandItems": { "alias": "actionCommandItems"; "required": false; }; "contextMenuCommandItems": { "alias": "contextMenuCommandItems"; "required": false; }; "excelExportFileName": { "alias": "excelExportFileName"; "required": false; }; "pdfExportFileName": { "alias": "pdfExportFileName"; "required": false; }; "pageable": { "alias": "pageable"; "required": false; }; "sortable": { "alias": "sortable"; "required": false; }; "rowFilterEnabled": { "alias": "rowFilterEnabled"; "required": false; }; "searchTextBoxEnabled": { "alias": "searchTextBoxEnabled"; "required": false; }; "persistListState": { "alias": "persistListState"; "required": false; }; "listStateKey": { "alias": "listStateKey"; "required": false; }; "resizable": { "alias": "resizable"; "required": false; }; "actionsColumnWidth": { "alias": "actionsColumnWidth"; "required": false; }; "hideCheckboxesBelow": { "alias": "hideCheckboxesBelow"; "required": false; }; "rowClass": { "alias": "rowClass"; "required": false; }; "messages": { "alias": "messages"; "required": false; }; "selectable": { "alias": "selectable"; "required": false; }; "columns": { "alias": "columns"; "required": false; }; }, { "rowClicked": "rowClicked"; "resetFilters": "resetFilters"; }, never, never, true, never>;
447
484
  }
448
485
 
449
486
  declare class UploadFileDialogComponent extends DialogContentBase {
@@ -1042,6 +1079,7 @@ declare abstract class HierarchyDataSourceBase<TQueryDto> extends HierarchyDataS
1042
1079
 
1043
1080
  declare class MmListViewDataBindingDirective extends DataBindingDirective implements OnInit, OnDestroy {
1044
1081
  private readonly dataSource;
1082
+ private readonly listStateService;
1045
1083
  /** Observable indicating if the data source is currently loading data */
1046
1084
  get isLoading$(): Observable<boolean>;
1047
1085
  /** Current loading state */
@@ -1069,6 +1107,30 @@ declare class MmListViewDataBindingDirective extends DataBindingDirective implem
1069
1107
  * new page grid so the pager stays on a valid page, then the data is refetched.
1070
1108
  */
1071
1109
  applyPageSize(take: number): void;
1110
+ /**
1111
+ * Kendo emits this for header-sort clicks, the built-in filter row and the
1112
+ * pager. Persist the resulting state so those interactions survive a revisit.
1113
+ */
1114
+ onStateChange(state: DataStateChangeEvent): void;
1115
+ /** Effective per-list storage key, or null when persistence is disabled/unavailable. */
1116
+ private stateKey;
1117
+ /**
1118
+ * Restores the persisted sort/filter/page into the grid state via the
1119
+ * inherited setters (which sync both the Kendo grid and the query state).
1120
+ * `take`/`pageSize` is intentionally not restored — it is the caller's
1121
+ * initial pageSize or the autoPageSize measurement.
1122
+ */
1123
+ private restoreState;
1124
+ /**
1125
+ * Clears all filtering for this list back to the default view: row filter,
1126
+ * column sort, free-text search and page offset, and drops the persisted
1127
+ * entry (incl. any app-owned bar filters) so nothing is restored next visit.
1128
+ * The app-side bar filters are reset by the host via
1129
+ * {@link ListViewComponent.onResetFilters}.
1130
+ */
1131
+ resetState(): void;
1132
+ /** Writes the current sort/filter/skip + free-text search for this list to storage (best-effort). */
1133
+ private persistState;
1072
1134
  rebind(): void;
1073
1135
  static ɵfac: i0.ɵɵFactoryDeclaration<MmListViewDataBindingDirective, never>;
1074
1136
  static ɵdir: i0.ɵɵDirectiveDeclaration<MmListViewDataBindingDirective, "[mmListViewDataBinding]", never, {}, {}, never, never, true, never>;
@@ -1191,6 +1253,63 @@ declare class MessageListenerService implements OnDestroy {
1191
1253
  static ɵprov: i0.ɵɵInjectableDeclaration<MessageListenerService>;
1192
1254
  }
1193
1255
 
1256
+ /**
1257
+ * The slice of a Kendo grid {@link State} that is worth persisting for a list
1258
+ * view: the user's sort, row filter and current page offset. `take`/`pageSize`
1259
+ * is deliberately excluded — in `autoPageSize` mode it is re-derived from the
1260
+ * viewport on every load, so persisting it is pointless (and restoring it would
1261
+ * fight the measurement).
1262
+ */
1263
+ interface PersistedListState {
1264
+ sort?: SortDescriptor[];
1265
+ filter?: CompositeFilterDescriptor;
1266
+ skip?: number;
1267
+ /** Free-text "search all columns" value — lives outside the Kendo state. */
1268
+ textSearch?: string | null;
1269
+ /**
1270
+ * App-owned extra state stored under the same list key — e.g. the coarse
1271
+ * "quick view" / bar filters (category, view, date range) that live in app
1272
+ * signals rather than the Kendo grid state. Opaque to this service; the host
1273
+ * app defines the shape. Written via {@link ListStateService.saveExtra} and
1274
+ * preserved by the directive's own {@link ListStateService.save}.
1275
+ */
1276
+ extra?: unknown;
1277
+ }
1278
+ /**
1279
+ * Persists list-view sort/filter/paging per list so users do not have to
1280
+ * re-apply them on every visit. Central to shared-ui so every app gets the
1281
+ * behaviour for free (see {@link ListViewComponent.listStateKey}).
1282
+ *
1283
+ * Storage is a single namespaced blob in localStorage (survives reloads and
1284
+ * browser restarts), keyed by list — mirroring {@link WindowStateService}'s
1285
+ * `mm-window-states` map pattern. Every access is guarded: a corrupt or
1286
+ * unavailable store must never break a list, it just falls back to no state.
1287
+ */
1288
+ declare class ListStateService {
1289
+ private readonly storageKey;
1290
+ /** Returns the persisted state for `key`, with date filter values re-hydrated to `Date`. */
1291
+ load(key: string): PersistedListState | null;
1292
+ /**
1293
+ * Stores the sort/filter/skip slice of `state` for `key` plus the free-text
1294
+ * search (which lives outside the Kendo state). `take` is intentionally dropped.
1295
+ */
1296
+ save(key: string, state: State$1, textSearch?: string | null): void;
1297
+ /**
1298
+ * Stores app-owned extra state (e.g. quick-view/bar filters) under `key`,
1299
+ * merging into the same entry as the grid state without clobbering it.
1300
+ */
1301
+ saveExtra(key: string, extra: unknown): void;
1302
+ /** Returns the app-owned extra state stored under `key`, or null. */
1303
+ loadExtra<T>(key: string): T | null;
1304
+ /** Drops the stored state for `key`. */
1305
+ clear(key: string): void;
1306
+ private reviveFilterDates;
1307
+ private loadAll;
1308
+ private saveAll;
1309
+ static ɵfac: i0.ɵɵFactoryDeclaration<ListStateService, never>;
1310
+ static ɵprov: i0.ɵɵInjectableDeclaration<ListStateService>;
1311
+ }
1312
+
1194
1313
  interface MessageDetailsDialogMessages {
1195
1314
  copyToClipboard: string;
1196
1315
  close: string;
@@ -2333,5 +2452,5 @@ declare class WindowStateService {
2333
2452
 
2334
2453
  declare function provideMmSharedUi(): EnvironmentProviders;
2335
2454
 
2336
- export { BaseFormComponent, BaseTreeDetailComponent, ButtonTypes, BytesToSizePipe, CRON_PRESETS, ConfirmationService, ConfirmationWindowComponent, ConfirmationWindowResult, CopyableTextComponent, CronBuilderComponent, CronHumanizerService, CronParserService, DEFAULT_CONFIRMATION_WINDOW_MESSAGES, DEFAULT_CRON_BUILDER_CONFIG, DEFAULT_ENTITY_SELECT_DIALOG_MESSAGES, DEFAULT_ENTITY_SELECT_INPUT_MESSAGES, DEFAULT_INPUT_DIALOG_MESSAGES, DEFAULT_LIST_VIEW_MESSAGES, DEFAULT_MESSAGE_DETAILS_DIALOG_MESSAGES, DEFAULT_NOTIFICATION_DISPLAY_MESSAGES, DEFAULT_PROGRESS_WINDOW_MESSAGES, DEFAULT_RESPONSIVE_COLSPAN, DEFAULT_SAVE_AS_DIALOG_MESSAGES, DEFAULT_TIME_RANGE_LABELS, DataSourceBase, DataSourceTyped, DialogType, EntitySelectDialogComponent, EntitySelectDialogService, EntitySelectInputComponent, FetchResultBase, FetchResultTyped, FileUploadResult, FileUploadService, FormTitleExtraDirective, HAS_UNSAVED_CHANGES, HOUR_INTERVALS, HierarchyDataSource, HierarchyDataSourceBase, ImportStrategyDialogComponent, ImportStrategyDialogResult, ImportStrategyDialogService, ImportStrategyDto, InputDialogComponent, InputService, ListViewComponent, MINUTE_INTERVALS, MessageDetailsDialogComponent, MessageDetailsDialogService, MessageListenerService, MmListViewDataBindingDirective, NotificationDisplayService, PascalCasePipe, ProgressValue, ProgressWindowComponent, ProgressWindowService, RELATIVE_WEEKS, SECOND_INTERVALS, SaveAsDialogComponent, SaveAsDialogService, TimeRangePickerComponent, TimeRangeUtils, TreeComponent, UnsavedChangesDirective, UnsavedChangesGuard, UploadFileDialogComponent, WEEKDAYS, WEEKDAY_ABBREVIATIONS, WindowStateService, generateDayOfMonthOptions, generateHourOptions, generateMinuteOptions, provideMmSharedUi };
2337
- export type { BadgeMapping, BadgeMappingTable, BaseFormConfig, BaseFormMessages, ColumnDefinition, ConfirmationButtonLabels, ConfirmationWindowData, ConfirmationWindowMessages, ContextMenuType, CronBuilderConfig, CronFields, CronPreset, CronSchedule, CronValidationResult, DialogFetchOptions, DialogFetchResult, DropdownOption, EntitySelectDialogDataSource, EntitySelectDialogMessages, EntitySelectDialogOptions, EntitySelectDialogResult, EntitySelectInputMessages, FetchDataOptions, FetchResult, FileUploadData, HasUnsavedChanges, InputDialogMessages, ListViewMessages, MessageDetailsDialogData, MessageDetailsDialogMessages, NameAvailabilityResult, NodeDroppedEvent, NodeInfo, NotificationDisplayMessages, ProgressWindowConfig, ProgressWindowData, ProgressWindowMessages, ProgressWindowOptions, ProgressWindowResult, Quarter, RelativeTimeUnit, ResponsiveFormBreakPoint, RowClassFn, SaveAsDialogDataSource, SaveAsDialogMessages, SaveAsDialogOptions, SaveAsDialogResult, ScheduleType, StatusFieldConfig, StatusIconMapping, StatusMapping, TableColumn, TimeRange, TimeRangeISO, TimeRangeOption, TimeRangePickerConfig, TimeRangePickerLabels, TimeRangeSelection, TimeRangeType, TimeRangeZone, UnsavedChangesMessages, Weekday, WindowDimensions };
2455
+ export { BaseFormComponent, BaseTreeDetailComponent, ButtonTypes, BytesToSizePipe, CRON_PRESETS, ConfirmationService, ConfirmationWindowComponent, ConfirmationWindowResult, CopyableTextComponent, CronBuilderComponent, CronHumanizerService, CronParserService, DEFAULT_CONFIRMATION_WINDOW_MESSAGES, DEFAULT_CRON_BUILDER_CONFIG, DEFAULT_ENTITY_SELECT_DIALOG_MESSAGES, DEFAULT_ENTITY_SELECT_INPUT_MESSAGES, DEFAULT_INPUT_DIALOG_MESSAGES, DEFAULT_LIST_VIEW_MESSAGES, DEFAULT_MESSAGE_DETAILS_DIALOG_MESSAGES, DEFAULT_NOTIFICATION_DISPLAY_MESSAGES, DEFAULT_PROGRESS_WINDOW_MESSAGES, DEFAULT_RESPONSIVE_COLSPAN, DEFAULT_SAVE_AS_DIALOG_MESSAGES, DEFAULT_TIME_RANGE_LABELS, DataSourceBase, DataSourceTyped, DialogType, EntitySelectDialogComponent, EntitySelectDialogService, EntitySelectInputComponent, FetchResultBase, FetchResultTyped, FileUploadResult, FileUploadService, FormTitleExtraDirective, HAS_UNSAVED_CHANGES, HOUR_INTERVALS, HierarchyDataSource, HierarchyDataSourceBase, ImportStrategyDialogComponent, ImportStrategyDialogResult, ImportStrategyDialogService, ImportStrategyDto, InputDialogComponent, InputService, ListStateService, ListViewComponent, MINUTE_INTERVALS, MessageDetailsDialogComponent, MessageDetailsDialogService, MessageListenerService, MmListViewDataBindingDirective, NotificationDisplayService, PascalCasePipe, ProgressValue, ProgressWindowComponent, ProgressWindowService, RELATIVE_WEEKS, SECOND_INTERVALS, SaveAsDialogComponent, SaveAsDialogService, TimeRangePickerComponent, TimeRangeUtils, TreeComponent, UnsavedChangesDirective, UnsavedChangesGuard, UploadFileDialogComponent, WEEKDAYS, WEEKDAY_ABBREVIATIONS, WindowStateService, generateDayOfMonthOptions, generateHourOptions, generateMinuteOptions, provideMmSharedUi };
2456
+ export type { BadgeMapping, BadgeMappingTable, BaseFormConfig, BaseFormMessages, ColumnDefinition, ConfirmationButtonLabels, ConfirmationWindowData, ConfirmationWindowMessages, ContextMenuType, CronBuilderConfig, CronFields, CronPreset, CronSchedule, CronValidationResult, DialogFetchOptions, DialogFetchResult, DropdownOption, EntitySelectDialogDataSource, EntitySelectDialogMessages, EntitySelectDialogOptions, EntitySelectDialogResult, EntitySelectInputMessages, FetchDataOptions, FetchResult, FileUploadData, HasUnsavedChanges, InputDialogMessages, ListViewMessages, MessageDetailsDialogData, MessageDetailsDialogMessages, NameAvailabilityResult, NodeDroppedEvent, NodeInfo, NotificationDisplayMessages, PersistedListState, ProgressWindowConfig, ProgressWindowData, ProgressWindowMessages, ProgressWindowOptions, ProgressWindowResult, Quarter, RelativeTimeUnit, ResponsiveFormBreakPoint, RowClassFn, SaveAsDialogDataSource, SaveAsDialogMessages, SaveAsDialogOptions, SaveAsDialogResult, ScheduleType, StatusFieldConfig, StatusIconMapping, StatusMapping, TableColumn, TimeRange, TimeRangeISO, TimeRangeOption, TimeRangePickerConfig, TimeRangePickerLabels, TimeRangeSelection, TimeRangeType, TimeRangeZone, UnsavedChangesMessages, Weekday, WindowDimensions };