mn-angular-lib 2.0.25 → 2.0.27

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": "mn-angular-lib",
3
- "version": "2.0.25",
3
+ "version": "2.0.27",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^22.1.7",
6
6
  "@angular/core": "^22.1.7",
@@ -127,6 +127,12 @@ type MnCollectionDataSource<T> = {
127
127
  pageSize?: number;
128
128
  /** Options for the page-size selector dropdown. Defaults to [5, 10, 25, 50]. */
129
129
  pageSizeOptions?: number[];
130
+ /**
131
+ * The largest page mn-table's phone "Load more" may ask a `paginated` (server-side) consumer
132
+ * for. Each tap grows the page by the size it started at, up to this cap; past it the pager
133
+ * comes back. Defaults to 100, a common server limit. Client-side pagination has no cap.
134
+ */
135
+ maxPageSize?: number;
130
136
  /** Callback invoked when the user changes the page size via the dropdown. */
131
137
  onPageSizeChange?: (newSize: number) => void;
132
138
  /**
@@ -794,6 +800,13 @@ type ColumnBase<T> = {
794
800
  * a date that comes first but is not the row's name, an image that should not be text.
795
801
  */
796
802
  mobile?: MnColumnMobileSlot;
803
+ /**
804
+ * Whether this row has no value for the column. Below 640px an empty value is left off the
805
+ * composed row and the detail sheet, label included. A string cell needs nothing: a blank or
806
+ * lone-dash value is caught already. Set it on a template cell, whose markup the table cannot
807
+ * read, when that template draws a placeholder ("-") for "nothing".
808
+ */
809
+ isEmpty?: (row: T) => boolean;
797
810
  /** Customizes the loading-skeleton placeholder shown in this column's cells while data loads. */
798
811
  skeleton?: ColumnSkeleton;
799
812
  };
@@ -1074,9 +1087,10 @@ declare class MnTable<T = object> extends MnSelectableCollectionBase<T, TableDat
1074
1087
  /** The template a composed row renders for a column; null for a string column. */
1075
1088
  rowCellTemplate(column: ColumnDefinition<T>): TemplateRef<unknown> | null;
1076
1089
  /**
1077
- * Whether a string cell is empty for this row: blank, or the lone dash an app writes for
1078
- * "nothing". Such a value is left off the composed row ("Beschrijving -" said nothing); the
1079
- * sheet still lists it. A template cell is never judged empty — its markup is the app's.
1090
+ * Whether a cell is empty for this row: what the column's `isEmpty` says, else for a string
1091
+ * cell blank or the lone dash an app writes for "nothing". Such a value is left off the
1092
+ * composed row and the detail sheet ("Beschrijving: -" said nothing). A template cell without
1093
+ * `isEmpty` is never judged empty — its markup is the app's.
1080
1094
  */
1081
1095
  rowValueEmpty(column: ColumnDefinition<T>, row: T): boolean;
1082
1096
  /** The second-line columns that have something to show for this row. */
@@ -1111,6 +1125,40 @@ declare class MnTable<T = object> extends MnSelectableCollectionBase<T, TableDat
1111
1125
  * an empty or short list is chrome with nothing to do. Above it the strip stays as it was.
1112
1126
  */
1113
1127
  get showsPagination(): boolean;
1128
+ /**
1129
+ * Whether a paginated table offers "Load more" instead of the pager: below 640px, on the first
1130
+ * page, while rows remain and the next size stays within {@link MnCollectionDataSource.maxPageSize}.
1131
+ * A tap grows the page instead of appending the next one, so a consumer that reloads after an
1132
+ * edit or a delete gets the whole visible list back rather than one page under stale rows.
1133
+ */
1134
+ get showsPhoneLoadMore(): boolean;
1135
+ /**
1136
+ * How many rows the phone list shows. A server-side consumer's rows, not the size asked for:
1137
+ * a consumer that answers an older, bigger request last shows more than {@link pageSize}.
1138
+ */
1139
+ private get phoneShownCount();
1140
+ /** How far the phone list has grown, as "10 of 48". */
1141
+ get phoneLoadedLabel(): string;
1142
+ /** The phone "Load more" button's label: the consumer's, the app's convention key, or English. */
1143
+ get phoneLoadMoreLabel(): string;
1144
+ /** A grown phone list has no pager to hold steady, so it keeps no full-page height floor. */
1145
+ get reservedPageHeight(): number;
1146
+ /**
1147
+ * Grows the phone list by one step: a client-side table shows more of the rows it holds, a
1148
+ * server-side one asks its consumer for a bigger first page. The rows on screen stay there
1149
+ * while that loads ({@link phoneLoadingMore}); skeletons would throw the reader back to the top.
1150
+ */
1151
+ loadMorePhoneRows(): void;
1152
+ /**
1153
+ * The page size the next "Load more" asks for: one step more than the rows shown, capped for a
1154
+ * server.
1155
+ * @returns The next size; equal to the rows shown when the cap is reached.
1156
+ */
1157
+ private nextPhonePageSize;
1158
+ /** Fresh rows answer a "Load more": the button stops spinning. */
1159
+ protected onRowsChanged(): void;
1160
+ /** A failed "Load more" shows the error, not a button that spins forever. */
1161
+ ngDoCheck(): void;
1114
1162
  /** How many column filters are set, shown as a count on the filter button. */
1115
1163
  get activeFilterCount(): number;
1116
1164
  /**
@@ -1157,6 +1205,12 @@ declare class MnTable<T = object> extends MnSelectableCollectionBase<T, TableDat
1157
1205
  * and its footer is pinned over the bottom of the table.
1158
1206
  */
1159
1207
  private static readonly MOBILE_PAGE_SIZE;
1208
+ /** {@link MnCollectionDataSource.maxPageSize} when the consumer sets none. */
1209
+ private static readonly DEFAULT_MAX_PAGE_SIZE;
1210
+ /** Rows one phone "Load more" tap adds: the page size before the first tap; 0 while not grown. */
1211
+ private phoneLoadStep;
1212
+ /** Whether a phone "Load more" refetch is in flight: rows stay up and the button spins. */
1213
+ protected phoneLoadingMore: boolean;
1160
1214
  /**
1161
1215
  * The component's own element, measured for every responsive decision. Typed via
1162
1216
  * the annotation, not `inject(ElementRef<HTMLElement>)` — that form is a generic