ados-rcm 1.0.330 → 1.0.332

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.
@@ -110,7 +110,7 @@ export type TATableDefs<T extends IItem> = {
110
110
  [key: TIdx]: IATableDef<T>;
111
111
  };
112
112
  export type TATableFilterType = 'String' | 'Select' | 'Date' | 'DateRange';
113
- export interface IATableFilter<T extends IItem> {
113
+ export interface IATableFilter<T extends IItem, K extends IItem = any> {
114
114
  String: {
115
115
  /**
116
116
  * type : 'String'
@@ -124,6 +124,12 @@ export interface IATableFilter<T extends IItem> {
124
124
  * Description : value of the String filter
125
125
  */
126
126
  value?: string;
127
+ /**
128
+ * paramKey? : keyof K
129
+ *
130
+ * Description : paramKey of the filter. if not provided, it will use the key of the filter. This is used when to make apiParams using tableF.getFilterParams()
131
+ */
132
+ paramKey?: keyof K;
127
133
  /**
128
134
  * predicate? : (item: T, defs: TATableDefs<T>, filterKey: keyof T | string, filter: IATableFilter<T>['String']) => any
129
135
  *
@@ -156,6 +162,12 @@ export interface IATableFilter<T extends IItem> {
156
162
  * Description : values of the Select filter
157
163
  */
158
164
  value?: string | number | null;
165
+ /**
166
+ * paramKey? : keyof K
167
+ *
168
+ * Description : paramKey of the filter. if not provided, it will use the key of the filter. This is used when to make apiParams using tableF.getFilterParams()
169
+ */
170
+ paramKey?: keyof K;
159
171
  /**
160
172
  * options :
161
173
  *
@@ -196,6 +208,12 @@ export interface IATableFilter<T extends IItem> {
196
208
  * Description : value of the Date filter
197
209
  */
198
210
  value?: Date;
211
+ /**
212
+ * paramKey? : keyof K
213
+ *
214
+ * Description : paramKey of the filter. if not provided, it will use the key of the filter. This is used when to make apiParams using tableF.getFilterParams()
215
+ */
216
+ paramKey?: keyof K;
199
217
  /**
200
218
  * minDate? : Date
201
219
  *
@@ -228,6 +246,18 @@ export interface IATableFilter<T extends IItem> {
228
246
  * Description : value of the DateRange filter
229
247
  */
230
248
  value?: IDateRange;
249
+ /**
250
+ * sParamKey : keyof K
251
+ *
252
+ * Description : paramKey of the filter.value.sDate. This is used when to make apiParams using tableF.getFilterParams()
253
+ */
254
+ sParamKey: keyof K;
255
+ /**
256
+ * eParamKey : keyof K
257
+ *
258
+ * Description : paramKey of the filter.value.eDate. This is used when to make apiParams using tableF.getFilterParams()
259
+ */
260
+ eParamKey: keyof K;
231
261
  /**
232
262
  * minDate? : Date
233
263
  *
@@ -248,11 +278,11 @@ export interface IATableFilter<T extends IItem> {
248
278
  predicate?: (item: T, defs: TATableDefs<T>, filterKey: keyof T, filter: IATableFilter<T>['DateRange']) => any;
249
279
  };
250
280
  }
251
- export type TATableSomeFilter<T extends IItem> = IATableFilter<T>[TATableFilterType];
252
- export type TATableFilteration<T extends IItem> = {
253
- [key in keyof T]?: TATableSomeFilter<T>;
281
+ export type TATableSomeFilter<T extends IItem, K extends IItem = any> = IATableFilter<T, K>[TATableFilterType];
282
+ export type TATableFilteration<T extends IItem, K extends IItem = any> = {
283
+ [key in keyof T]?: TATableSomeFilter<T, K>;
254
284
  } & {
255
- [key: string]: TATableSomeFilter<T>;
285
+ [key: string]: TATableSomeFilter<T, K>;
256
286
  };
257
287
  export type TATableSortF<T extends IItem> = (a: T, b: T) => number;
258
288
  export interface IATableSortation<T extends IItem> {
@@ -295,7 +325,12 @@ export interface IATablePagination {
295
325
  */
296
326
  pageRange: number;
297
327
  }
298
- export interface IATableState<T extends IItem> {
328
+ /**
329
+ * IATableState<T extends IItem, K extends IItem = any>
330
+ *
331
+ * Description : IATableState of ATable. K is used for tableF.getMultiFilterValues. if used, it specifies the type of the filteration.
332
+ */
333
+ export interface IATableState<T extends IItem, K extends IItem = any> {
299
334
  /**
300
335
  * entireItems? : T[]
301
336
  *
@@ -303,11 +338,11 @@ export interface IATableState<T extends IItem> {
303
338
  */
304
339
  entireItems?: T[];
305
340
  /**
306
- * filteration : TATableFilteration<T>
341
+ * filteration : TATableFilteration<T, K>
307
342
  *
308
343
  * Description : filteration of the state
309
344
  */
310
- filteration: TATableFilteration<T>;
345
+ filteration: TATableFilteration<T, K>;
311
346
  /**
312
347
  * pagination : IATablePagination
313
348
  *
@@ -14,9 +14,11 @@ export declare const objF: {
14
14
  stringify: (value: any, indent?: number | string) => string;
15
15
  keys: <T_2 extends IObject>(obj: T_2) => (keyof T_2)[];
16
16
  values: <T_3 extends IObject>(obj: T_3) => T_3[keyof T_3][];
17
- hasKey: <T_4 extends IObject>(obj: T_4, key: string | number | symbol) => key is keyof T_4;
18
- map: <T_5 extends IObject, U>(obj: T_5, fn: (keyValue: [keyof T_5, T_5[keyof T_5]], idx: number) => U) => U[];
19
- some: <T_6 extends IObject>(obj: T_6, fn: (key: keyof T_6, value: T_6[keyof T_6]) => any) => boolean;
20
- find: <T_7 extends IObject>(obj: T_7, fn: (key: keyof T_7, value: T_7[keyof T_7]) => any) => [string, any] | undefined;
17
+ entries: <T_4 extends IObject>(obj: T_4) => [keyof T_4, T_4[keyof T_4]][];
18
+ forEach: <T_5 extends IObject, P extends keyof T_5>(obj: T_5, fn: (key: P, value: T_5[P]) => any) => void;
19
+ hasKey: <T_6 extends IObject>(obj: T_6, key: string | number | symbol) => key is keyof T_6;
20
+ map: <T_7 extends IObject, U>(obj: T_7, fn: (keyValue: [keyof T_7, T_7[keyof T_7]], idx: number) => U) => U[];
21
+ some: <T_8 extends IObject>(obj: T_8, fn: (key: keyof T_8, value: T_8[keyof T_8]) => any) => boolean;
22
+ find: <T_9 extends IObject>(obj: T_9, fn: (key: keyof T_9, value: T_9[keyof T_9]) => any) => [string, any] | undefined;
21
23
  isReactNode: (value: any) => value is React.ReactNode;
22
24
  };
@@ -4,6 +4,9 @@ type TDefaultPredicate = {
4
4
  [key in TATableFilterType]: IATableFilter<any>[key]['predicate'];
5
5
  };
6
6
  export declare const defaultPredicate: TDefaultPredicate;
7
+ type TKeyValuePairs<K> = {
8
+ [P in keyof K]?: K[P];
9
+ };
7
10
  /**
8
11
  * tableF : table functions
9
12
  */
@@ -17,5 +20,7 @@ export declare const tableF: {
17
20
  rangedPages: number[];
18
21
  };
19
22
  downloadCsv: <T_3 extends IItem>(name: string, items: T_3[], defs: TATableDefs<T_3>) => void;
23
+ getSingleFilterValue: <T_4 extends IItem>(filteration: TATableFilteration<T_4>) => string | undefined;
24
+ getMultiFilterValues: <T_5 extends IItem, K extends IItem = any>(filteration: TATableFilteration<T_5, K>) => TKeyValuePairs<K>;
20
25
  };
21
26
  export {};