mn-angular-lib 1.0.2 → 1.0.5

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": "1.0.2",
3
+ "version": "1.0.5",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^21.1.3",
6
6
  "@angular/core": "^21.1.3"
@@ -151,6 +151,7 @@ declare const mnButtonVariants: tailwind_variants.TVReturnType<{
151
151
  fill: string;
152
152
  outline: string;
153
153
  text: string;
154
+ textUnderline: string;
154
155
  };
155
156
  color: {
156
157
  primary: string;
@@ -174,7 +175,7 @@ declare const mnButtonVariants: tailwind_variants.TVReturnType<{
174
175
  disabled: {
175
176
  true: string;
176
177
  };
177
- }, undefined, "hover:cursor-pointer transition-colors duration-300 ease-in-out", {
178
+ }, undefined, "hover:cursor-pointer transition-all duration-300 ease-in-out", {
178
179
  size: {
179
180
  sm: string;
180
181
  md: string;
@@ -184,6 +185,7 @@ declare const mnButtonVariants: tailwind_variants.TVReturnType<{
184
185
  fill: string;
185
186
  outline: string;
186
187
  text: string;
188
+ textUnderline: string;
187
189
  };
188
190
  color: {
189
191
  primary: string;
@@ -217,6 +219,7 @@ declare const mnButtonVariants: tailwind_variants.TVReturnType<{
217
219
  fill: string;
218
220
  outline: string;
219
221
  text: string;
222
+ textUnderline: string;
220
223
  };
221
224
  color: {
222
225
  primary: string;
@@ -240,7 +243,7 @@ declare const mnButtonVariants: tailwind_variants.TVReturnType<{
240
243
  disabled: {
241
244
  true: string;
242
245
  };
243
- }, undefined, "hover:cursor-pointer transition-colors duration-300 ease-in-out", unknown, unknown, undefined>>;
246
+ }, undefined, "hover:cursor-pointer transition-all duration-300 ease-in-out", unknown, unknown, undefined>>;
244
247
  type MnButtonVariants = VariantProps<typeof mnButtonVariants>;
245
248
 
246
249
  interface MnButtonTypes {
@@ -287,7 +290,7 @@ declare const mnInputFieldVariants: tailwind_variants.TVReturnType<{
287
290
  hover: {
288
291
  true: string;
289
292
  };
290
- }, undefined, "bg-base-100 border-1 border-base-300 placeholder-base-content/50 text-base-content text-sm", {
293
+ }, undefined, "bg-base-100 border-1 border-base-300 placeholder-base-content/50 text-base-content text-sm outline-none focus:ring-1 focus:ring-primary", {
291
294
  shadow: {
292
295
  true: string;
293
296
  };
@@ -339,7 +342,7 @@ declare const mnInputFieldVariants: tailwind_variants.TVReturnType<{
339
342
  hover: {
340
343
  true: string;
341
344
  };
342
- }, undefined, "bg-base-100 border-1 border-base-300 placeholder-base-content/50 text-base-content text-sm", unknown, unknown, undefined>>;
345
+ }, undefined, "bg-base-100 border-1 border-base-300 placeholder-base-content/50 text-base-content text-sm outline-none focus:ring-1 focus:ring-primary", unknown, unknown, undefined>>;
343
346
  type MnInputVariants = VariantProps<typeof mnInputFieldVariants>;
344
347
 
345
348
  /**
@@ -1845,7 +1848,7 @@ interface TableDataSource<T> {
1845
1848
  searchPlaceholder?: string;
1846
1849
  isInSearch?: (row: T, searchValue: string) => boolean;
1847
1850
  searchForAdditionalItems?: (searchValue: string) => Promise<T[]>;
1848
- paginationMode?: 'none' | 'load-more' | 'paginated' | 'infinite-scroll';
1851
+ paginationMode?: 'none' | 'load-more' | 'paginated' | 'client-side-pagination' | 'infinite-scroll';
1849
1852
  paginationStrategy?: PaginationStrategy;
1850
1853
  loadAdditionalRows?: () => Promise<T[]>;
1851
1854
  /** Number of rows per page when paginationMode is 'paginated'. Defaults to 10. */
@@ -1854,6 +1857,28 @@ interface TableDataSource<T> {
1854
1857
  pageSizeOptions?: number[];
1855
1858
  /** Callback invoked when the user changes the page size via the dropdown. */
1856
1859
  onPageSizeChange?: (newSize: number) => void;
1860
+ /**
1861
+ * Total number of items on the server.
1862
+ * When set, pagination and infinite-scroll use this instead of filteredItems.length.
1863
+ */
1864
+ totalItems?: number;
1865
+ /**
1866
+ * Callback invoked when the user navigates to a different page.
1867
+ * When provided, the table delegates pagination to the consumer (server-side).
1868
+ * The consumer is responsible for fetching the new page data and updating dataRows.
1869
+ */
1870
+ onPageChange?: (page: number) => void;
1871
+ /**
1872
+ * Callback invoked when the user types in the search box (server-side search).
1873
+ * When provided, the table skips client-side filtering and delegates to the consumer.
1874
+ */
1875
+ onServerSearch?: (searchValue: string) => void;
1876
+ /**
1877
+ * Callback invoked when the user scrolls to the bottom in infinite-scroll mode.
1878
+ * When provided, the table delegates loading more rows to the consumer (server-side).
1879
+ * The consumer is responsible for appending new data to dataRows.
1880
+ */
1881
+ onLoadMore?: () => void;
1857
1882
  defaultSort?: SortState;
1858
1883
  selectionMode?: 'none' | 'single' | 'multi';
1859
1884
  selectedRows?: BehaviorSubject<T[]>;
@@ -3160,9 +3185,9 @@ declare class MnTable<T = any> implements OnInit, OnDestroy, DoCheck {
3160
3185
  * by Angular's default change detection (e.g. toolbarTemplate).
3161
3186
  */
3162
3187
  ngDoCheck(): void;
3163
- ngOnInit(): void;
3188
+ get showLoadMore(): boolean;
3164
3189
  ngOnDestroy(): void;
3165
- onSearch(searchString: string): void;
3190
+ get isPaginated(): boolean;
3166
3191
  /** Whether any column has filtering enabled. */
3167
3192
  get hasColumnFilters(): boolean;
3168
3193
  /** Updates a column filter value and re-applies filtering. */
@@ -3177,10 +3202,16 @@ declare class MnTable<T = any> implements OnInit, OnDestroy, DoCheck {
3177
3202
  get hasSelection(): boolean;
3178
3203
  get isMultiSelect(): boolean;
3179
3204
  onRowClick(row: T): void;
3180
- loadMoreRows(): void;
3181
- get showLoadMore(): boolean;
3182
- get isPaginated(): boolean;
3205
+ /** Whether the table delegates pagination to the consumer (server-side). */
3206
+ get isServerPaginated(): boolean;
3207
+ /** Whether the table delegates search to the consumer (server-side). */
3208
+ get isServerSearched(): boolean;
3209
+ /** Total number of items, accounting for server-side pagination. */
3210
+ get totalItemCount(): number;
3183
3211
  get totalPages(): number;
3212
+ ngOnInit(): void;
3213
+ onSearch(searchString: string): void;
3214
+ loadMoreRows(): void;
3184
3215
  get resolvedPageSizeOptions(): number[];
3185
3216
  goToPage(page: number): void;
3186
3217
  onPageSizeChange(newSize: number): void;
@@ -3196,6 +3227,7 @@ declare class MnTable<T = any> implements OnInit, OnDestroy, DoCheck {
3196
3227
  private applyFilterAndSort;
3197
3228
  private applySorting;
3198
3229
  private processLoadedRows;
3230
+ private validateDataSource;
3199
3231
  private emitSelection;
3200
3232
  static ɵfac: i0.ɵɵFactoryDeclaration<MnTable<any>, never>;
3201
3233
  static ɵcmp: i0.ɵɵComponentDeclaration<MnTable<any>, "mn-table", never, { "dataSource": { "alias": "dataSource"; "required": false; }; }, { "sortChange": "sortChange"; "selectionChange": "selectionChange"; "rowClick": "rowClick"; }, never, never, true, never>;
@@ -3244,13 +3276,35 @@ interface ListDataSource<T> {
3244
3276
  searchPlaceholder?: string;
3245
3277
  isInSearch?: (row: T, searchValue: string) => boolean;
3246
3278
  searchForAdditionalItems?: (searchValue: string) => Promise<T[]>;
3247
- paginationMode?: 'none' | 'load-more' | 'paginated' | 'infinite-scroll';
3279
+ paginationMode?: 'none' | 'load-more' | 'paginated' | 'client-side-pagination' | 'infinite-scroll';
3248
3280
  paginationStrategy?: PaginationStrategy;
3249
3281
  loadAdditionalRows?: () => Promise<T[]>;
3250
3282
  /** Number of items per page when paginationMode is 'paginated'. Defaults to 10. */
3251
3283
  pageSize?: number;
3252
3284
  /** Options for the page-size selector dropdown. Defaults to [5, 10, 25, 50]. */
3253
3285
  pageSizeOptions?: number[];
3286
+ /** Callback invoked when the user changes the page size via the dropdown. */
3287
+ onPageSizeChange?: (newSize: number) => void;
3288
+ /**
3289
+ * Total number of items on the server.
3290
+ * When set, pagination and infinite-scroll use this instead of filteredItems.length.
3291
+ */
3292
+ totalItems?: number;
3293
+ /**
3294
+ * Callback invoked when the user navigates to a different page.
3295
+ * When provided, the list delegates pagination to the consumer (server-side).
3296
+ */
3297
+ onPageChange?: (page: number) => void;
3298
+ /**
3299
+ * Callback invoked when the user types in the search box (server-side search).
3300
+ * When provided, the list skips client-side filtering and delegates to the consumer.
3301
+ */
3302
+ onServerSearch?: (searchValue: string) => void;
3303
+ /**
3304
+ * Callback invoked when the user scrolls to the bottom in infinite-scroll mode.
3305
+ * When provided, the list delegates loading more rows to the consumer (server-side).
3306
+ */
3307
+ onLoadMore?: () => void;
3254
3308
  selectionMode?: 'none' | 'single' | 'multi';
3255
3309
  selectedRows?: BehaviorSubject<T[]>;
3256
3310
  /** IDs to pre-select when the list initializes. */
@@ -3283,9 +3337,9 @@ declare class MnList<T = any> implements OnInit, OnDestroy, DoCheck {
3283
3337
  /** Tracks the previous toolbar template reference for change detection. */
3284
3338
  private previousToolbarTemplate?;
3285
3339
  ngDoCheck(): void;
3286
- ngOnInit(): void;
3340
+ get showLoadMore(): boolean;
3287
3341
  ngOnDestroy(): void;
3288
- onSearch(searchString: string): void;
3342
+ get isPaginated(): boolean;
3289
3343
  isSelected(item: T): boolean;
3290
3344
  toggleItem(item: T): void;
3291
3345
  toggleAll(): void;
@@ -3293,10 +3347,14 @@ declare class MnList<T = any> implements OnInit, OnDestroy, DoCheck {
3293
3347
  get hasSelection(): boolean;
3294
3348
  get isMultiSelect(): boolean;
3295
3349
  onItemClick(item: T): void;
3296
- loadMoreRows(): void;
3297
- get showLoadMore(): boolean;
3298
- get isPaginated(): boolean;
3350
+ /** Whether the list is in server-side paginated mode (always true when paginated or load-more). */
3351
+ get isServerPaginated(): boolean;
3352
+ /** Total number of items, accounting for server-side pagination. */
3353
+ get totalItemCount(): number;
3299
3354
  get totalPages(): number;
3355
+ ngOnInit(): void;
3356
+ onSearch(searchString: string): void;
3357
+ loadMoreRows(): void;
3300
3358
  get resolvedPageSizeOptions(): number[];
3301
3359
  goToPage(page: number): void;
3302
3360
  onPageSizeChange(newSize: number): void;
@@ -3306,6 +3364,7 @@ declare class MnList<T = any> implements OnInit, OnDestroy, DoCheck {
3306
3364
  private applyPagination;
3307
3365
  private applyFilter;
3308
3366
  private processLoadedRows;
3367
+ private validateDataSource;
3309
3368
  private emitSelection;
3310
3369
  static ɵfac: i0.ɵɵFactoryDeclaration<MnList<any>, never>;
3311
3370
  static ɵcmp: i0.ɵɵComponentDeclaration<MnList<any>, "mn-list", never, { "dataSource": { "alias": "dataSource"; "required": false; }; }, { "selectionChange": "selectionChange"; "itemClick": "itemClick"; }, never, never, true, never>;