@one-paragon/angular-utilities 2.3.3 → 2.3.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/index.d.ts CHANGED
@@ -165,7 +165,19 @@ declare class RequestStateStore<TParam extends any[], V, R = null, T = R extends
165
165
  */
166
166
  on: <V_1>(srcObservable: Observable<V_1>, func: (obj: V_1) => void) => Subscription;
167
167
  request: (...value: [...TParam]) => Subscription;
168
+ /**
169
+ * @param params An observable or signal that returns an array to be spread into the request function.
170
+ * If undefined is returned, the request will not be made.
171
+ */
168
172
  requestWith: (params: Observable<[...TParam]> | Signal<[...TParam]>) => this;
173
+ /**
174
+ * @param params The parameters to be passed to the request function.
175
+ * The parameters can be either actual values or wrapped in a signal.
176
+ * If any of the parameters are a signal, it will be unwrapped and passed to the request.
177
+ * It will be tracked and the request will be made whenever its value changes.
178
+ * If any of the signals return undefined, the request will not be made.
179
+ */
180
+ requestOn: (...params: SignalOrValArr<TParam>) => this;
169
181
  private assertInjectionContext;
170
182
  destroy(): void;
171
183
  }
@@ -193,6 +205,10 @@ interface RequestStateStoreConfig {
193
205
  defaultSuccessHandling?: <T>(e?: T) => void;
194
206
  }
195
207
  declare const RequestStateStoreConfigToken: InjectionToken<RequestStateStoreConfig>;
208
+ type SignalOrVal<T> = Signal<T> | T;
209
+ type SignalOrValArr<T extends readonly any[]> = {
210
+ [K in keyof T]: SignalOrVal<T[K]>;
211
+ };
196
212
 
197
213
  interface HttpSuccessStateViewContext<T> {
198
214
  $implicit: T;
@@ -358,6 +374,14 @@ interface BaseMeta<T = any> {
358
374
  filterType?: FieldType;
359
375
  };
360
376
  noFilter?: boolean;
377
+ groupByLogic?: {
378
+ groupBy?: ((t: T) => any) | 'use map';
379
+ /**
380
+ * It will be called with the groupBy value. This will be the type of value table builder uses for the column unless groupBy is a function,
381
+ * in which case groupByHeader will be called with the value returned by groupBy.
382
+ */
383
+ groupByHeader?: (groupByVal: any) => string;
384
+ };
361
385
  customCell?: boolean;
362
386
  /**
363
387
  * @deprecated Use `map`
@@ -1199,7 +1223,7 @@ declare class MatButtonToggleFilterDirective extends TbSelectedFilterDirective i
1199
1223
  }
1200
1224
 
1201
1225
  declare class TableWrapperDirective {
1202
- $registrations: _angular_core.WritableSignal<(TableCustomFilterDirective | TableFilterDirective)[]>;
1226
+ $registrations: _angular_core.WritableSignal<(TableFilterDirective | TableCustomFilterDirective)[]>;
1203
1227
  register(filter: TableCustomFilterDirective | TableFilterDirective): void;
1204
1228
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<TableWrapperDirective, never>;
1205
1229
  static ɵdir: _angular_core.ɵɵDirectiveDeclaration<TableWrapperDirective, "[tbWrapper]", never, {}, {}, never, never, true, never>;
@@ -1268,12 +1292,12 @@ interface GlobalStorageState {
1268
1292
  localProfiles: Dictionary<Profile>;
1269
1293
  }
1270
1294
 
1271
- declare function setCustomGroupBy(customGroupBy: <T extends NoneGroupHeader = any>(data: T[], groupByKeys: string[], level?: number, parentGroupName?: string) => DataGroup<T>[] | GroupGroup<T>[]): void;
1295
+ declare function setCustomGroupBy(customGroupBy: <T extends NoneGroupHeader = any>(data: T[], groupByKeys: string[], level?: number, metaData?: Dictionary$1<MetaData<T>>, parentGroupName?: string) => DataGroup<T>[] | GroupGroup<T>[]): void;
1272
1296
  declare function updateGroupByState<T extends NoneGroupHeader = any>(groupedData: any[], { data, groups, expanded }: {
1273
1297
  data: Timestamp<T[]>;
1274
1298
  groups: Timestamp<string[]>;
1275
1299
  expanded: Timestamp<GroupedData[]>;
1276
- }, firstRun: boolean): GroupByState;
1300
+ }, firstRun: boolean, metaData: Dictionary$1<MetaData<T>>): GroupByState;
1277
1301
  declare function mapGroupHeader(obj: DataGroup | GroupGroup, expandedHeaders: string[] | true): any[];
1278
1302
  interface GroupByState {
1279
1303
  displayData: any[];
@@ -1472,7 +1496,7 @@ declare class TableContainerComponent<T = any> {
1472
1496
  $tableBuilder: _angular_core.InputSignal<TableBuilder<T>>;
1473
1497
  $tableIdInput: _angular_core.InputSignal<string | undefined>;
1474
1498
  $trackByInput: _angular_core.InputSignal<string | undefined>;
1475
- $inputFilters: _angular_core.InputSignal<(FilterInfo<any, T> | Predicate<T> | CustomFilter<T>)[]>;
1499
+ $inputFilters: _angular_core.InputSignal<(Predicate<T> | CustomFilter<T> | FilterInfo<any, T>)[]>;
1476
1500
  $filterInfoInputs: _angular_core.Signal<(FilterInfo<any, any> | CustomFilter<any>)[]>;
1477
1501
  $indexColumnInput: _angular_core.InputSignal<boolean>;
1478
1502
  $selectionColumnInput: _angular_core.InputSignal<boolean>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@one-paragon/angular-utilities",
3
- "version": "2.3.3",
3
+ "version": "2.3.5",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "20.0.3",
6
6
  "@angular/core": "20.0.3",