@firestitch/list 12.1.3 → 12.1.4

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.
@@ -31,7 +31,7 @@ export interface FsListConfig {
31
31
  savedFilters?: IFilterSavedFiltersConfig;
32
32
  persist?: FsListPersitance;
33
33
  rowActions?: (FsListRowActionGroup | FsListRowAction)[];
34
- rowClass?: (row: any) => string;
34
+ rowClass?: (row: any, options?: FsListRowClassOptions) => string;
35
35
  actions?: FsListAction[];
36
36
  fetch?: FsListFetchFn;
37
37
  afterFetch?: FsListAfterFetchFn;
@@ -241,3 +241,8 @@ export declare type FsListFetchFn = (query: Record<string, any>, options: FsList
241
241
  }>;
242
242
  export declare type FsListAfterFetchFn = (query: Record<string, any>, data: unknown[]) => void;
243
243
  export declare type FsListAfterContentInitFn = (query: Record<string, any>, data: unknown[]) => void;
244
+ export interface FsListRowClassOptions {
245
+ index: number;
246
+ groupIndex?: number;
247
+ groupChildIndex?: number;
248
+ }
@@ -5484,7 +5484,16 @@
5484
5484
  if (this.row && this.row.isGroup)
5485
5485
  cls += ' fs-list-row-group';
5486
5486
  if (this.rowClass) {
5487
- var resultClass = this.rowClass(this.row.data);
5487
+ var options = {
5488
+ index: this.rowIndex,
5489
+ };
5490
+ if (this.row.isGroup) {
5491
+ options.groupIndex = this.row.index;
5492
+ }
5493
+ else if (this.row.isChild) {
5494
+ options.groupChildIndex = this.row.index;
5495
+ }
5496
+ var resultClass = this.rowClass(this.row.data, options);
5488
5497
  if (typeof resultClass === 'string') {
5489
5498
  cls += " " + resultClass;
5490
5499
  }