ados-rcm 1.0.329 → 1.0.331
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/dist/AModule/AComponents/ATable/ATable.d.ts +45 -59
- package/dist/AModule/AUtils/objF.d.ts +6 -4
- package/dist/AModule/AUtils/tableF.d.ts +5 -0
- package/dist/index.cjs.js +23 -23
- package/dist/index.es.js +4084 -4095
- package/package.json +1 -1
|
@@ -5,6 +5,7 @@ import { IItem } from '../../AUtils/objF';
|
|
|
5
5
|
import { IABaseProps } from '../ABase/ABase';
|
|
6
6
|
import { Resources } from '../AResource/AResource';
|
|
7
7
|
import { TActionRef, TIdx, TPromisable } from '../ATypes/ATypes';
|
|
8
|
+
import { IDateRange } from '../ADatePicker/ADateRangePicker';
|
|
8
9
|
export interface IATableTHProps<T extends IItem> {
|
|
9
10
|
/**
|
|
10
11
|
* defKey : TIdx
|
|
@@ -109,7 +110,7 @@ export type TATableDefs<T extends IItem> = {
|
|
|
109
110
|
[key: TIdx]: IATableDef<T>;
|
|
110
111
|
};
|
|
111
112
|
export type TATableFilterType = 'String' | 'Select' | 'Date' | 'DateRange';
|
|
112
|
-
export interface IATableFilter<T extends IItem> {
|
|
113
|
+
export interface IATableFilter<T extends IItem, K extends IItem = any> {
|
|
113
114
|
String: {
|
|
114
115
|
/**
|
|
115
116
|
* type : 'String'
|
|
@@ -117,12 +118,6 @@ export interface IATableFilter<T extends IItem> {
|
|
|
117
118
|
* Description : type of the String filter
|
|
118
119
|
*/
|
|
119
120
|
type: 'String';
|
|
120
|
-
/**
|
|
121
|
-
* defKey? : keyof T | ''
|
|
122
|
-
*
|
|
123
|
-
* Description : defKey of the String filter
|
|
124
|
-
*/
|
|
125
|
-
defKey: keyof T | '';
|
|
126
121
|
/**
|
|
127
122
|
* value : string = ''
|
|
128
123
|
*
|
|
@@ -130,11 +125,17 @@ export interface IATableFilter<T extends IItem> {
|
|
|
130
125
|
*/
|
|
131
126
|
value?: string;
|
|
132
127
|
/**
|
|
133
|
-
*
|
|
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;
|
|
133
|
+
/**
|
|
134
|
+
* predicate? : (item: T, defs: TATableDefs<T>, filterKey: keyof T | string, filter: IATableFilter<T>['String']) => any
|
|
134
135
|
*
|
|
135
136
|
* Description : predicate of the String filter
|
|
136
137
|
*/
|
|
137
|
-
predicate?: (item: T, defs: TATableDefs<T>, filter: IATableFilter<T>['String']) => any;
|
|
138
|
+
predicate?: (item: T, defs: TATableDefs<T>, filterKey: keyof T | string, filter: IATableFilter<T>['String']) => any;
|
|
138
139
|
/**
|
|
139
140
|
* placeholder? : string
|
|
140
141
|
*
|
|
@@ -155,18 +156,18 @@ export interface IATableFilter<T extends IItem> {
|
|
|
155
156
|
* Description : type of the Select filter
|
|
156
157
|
*/
|
|
157
158
|
type: 'Select';
|
|
158
|
-
/**
|
|
159
|
-
* defKey : keyof T | ''
|
|
160
|
-
*
|
|
161
|
-
* Description : defKey of the Select filter
|
|
162
|
-
*/
|
|
163
|
-
defKey: keyof T | '';
|
|
164
159
|
/**
|
|
165
160
|
* value : string | number | null = null
|
|
166
161
|
*
|
|
167
162
|
* Description : values of the Select filter
|
|
168
163
|
*/
|
|
169
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;
|
|
170
171
|
/**
|
|
171
172
|
* options :
|
|
172
173
|
*
|
|
@@ -188,11 +189,11 @@ export interface IATableFilter<T extends IItem> {
|
|
|
188
189
|
option: string | number | null;
|
|
189
190
|
}) => React.ReactNode;
|
|
190
191
|
/**
|
|
191
|
-
* predicate? : (item: T, defs: TATableDefs<T>, filter: IATableFilter<T>['Select']) => any
|
|
192
|
+
* predicate? : (item: T, defs: TATableDefs<T>, filterKey: keyof T | string, filter: IATableFilter<T>['Select']) => any
|
|
192
193
|
*
|
|
193
194
|
* Description : predicate of the Select filter. if not provided, it will have default predicate.
|
|
194
195
|
*/
|
|
195
|
-
predicate?: (item: T, defs: TATableDefs<T>, filter: IATableFilter<T>['Select']) => any;
|
|
196
|
+
predicate?: (item: T, defs: TATableDefs<T>, filterKey: keyof T | string, filter: IATableFilter<T>['Select']) => any;
|
|
196
197
|
};
|
|
197
198
|
Date: {
|
|
198
199
|
/**
|
|
@@ -201,18 +202,18 @@ export interface IATableFilter<T extends IItem> {
|
|
|
201
202
|
* Description : type of the Date filter
|
|
202
203
|
*/
|
|
203
204
|
type: 'Date';
|
|
204
|
-
/**
|
|
205
|
-
* defKey : keyof T | ''
|
|
206
|
-
*
|
|
207
|
-
* Description : defKey of the Date filter
|
|
208
|
-
*/
|
|
209
|
-
defKey: keyof T;
|
|
210
205
|
/**
|
|
211
206
|
* value : Date = new Date()
|
|
212
207
|
*
|
|
213
208
|
* Description : value of the Date filter
|
|
214
209
|
*/
|
|
215
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;
|
|
216
217
|
/**
|
|
217
218
|
* minDate? : Date
|
|
218
219
|
*
|
|
@@ -226,11 +227,11 @@ export interface IATableFilter<T extends IItem> {
|
|
|
226
227
|
*/
|
|
227
228
|
maxDate?: Date;
|
|
228
229
|
/**
|
|
229
|
-
* predicate? : (item: T, defs: TATableDefs<T>, filter: IATableFilter<T>['Date']) => any
|
|
230
|
+
* predicate? : (item: T, defs: TATableDefs<T>, filterKey: keyof T, filter: IATableFilter<T>['Date']) => any
|
|
230
231
|
*
|
|
231
232
|
* Description : predicate of the Date filter. if not provided, it will have default predicate.
|
|
232
233
|
*/
|
|
233
|
-
predicate?: (item: T, defs: TATableDefs<T>, filter: IATableFilter<T>['Date']) => any;
|
|
234
|
+
predicate?: (item: T, defs: TATableDefs<T>, filterKey: keyof T, filter: IATableFilter<T>['Date']) => any;
|
|
234
235
|
};
|
|
235
236
|
DateRange: {
|
|
236
237
|
/**
|
|
@@ -240,23 +241,23 @@ export interface IATableFilter<T extends IItem> {
|
|
|
240
241
|
*/
|
|
241
242
|
type: 'DateRange';
|
|
242
243
|
/**
|
|
243
|
-
*
|
|
244
|
+
* value : IDateRange
|
|
244
245
|
*
|
|
245
|
-
* Description :
|
|
246
|
+
* Description : value of the DateRange filter
|
|
246
247
|
*/
|
|
247
|
-
|
|
248
|
+
value?: IDateRange;
|
|
248
249
|
/**
|
|
249
|
-
*
|
|
250
|
+
* sParamKey : keyof K
|
|
250
251
|
*
|
|
251
|
-
* Description :
|
|
252
|
+
* Description : paramKey of the filter.value.sDate. This is used when to make apiParams using tableF.getFilterParams()
|
|
252
253
|
*/
|
|
253
|
-
|
|
254
|
+
sParamKey: keyof K;
|
|
254
255
|
/**
|
|
255
|
-
*
|
|
256
|
+
* eParamKey : keyof K
|
|
256
257
|
*
|
|
257
|
-
* Description :
|
|
258
|
+
* Description : paramKey of the filter.value.eDate. This is used when to make apiParams using tableF.getFilterParams()
|
|
258
259
|
*/
|
|
259
|
-
|
|
260
|
+
eParamKey: keyof K;
|
|
260
261
|
/**
|
|
261
262
|
* minDate? : Date
|
|
262
263
|
*
|
|
@@ -270,33 +271,18 @@ export interface IATableFilter<T extends IItem> {
|
|
|
270
271
|
*/
|
|
271
272
|
maxDate?: Date;
|
|
272
273
|
/**
|
|
273
|
-
* predicate? : (item: T, defs: TATableDefs<T>, filter: IATableFilter<T>['DateRange']) => any
|
|
274
|
+
* predicate? : (item: T, defs: TATableDefs<T>, filterKey: keyof T | string, filter: IATableFilter<T>['DateRange']) => any
|
|
274
275
|
*
|
|
275
276
|
* Description : predicate of the DateRange filter. if not provided, it will have default predicate.
|
|
276
277
|
*/
|
|
277
|
-
predicate?: (item: T, defs: TATableDefs<T>, filter: IATableFilter<T>['DateRange']) => any;
|
|
278
|
+
predicate?: (item: T, defs: TATableDefs<T>, filterKey: keyof T, filter: IATableFilter<T>['DateRange']) => any;
|
|
278
279
|
};
|
|
279
280
|
}
|
|
280
|
-
export type TATableSomeFilter<T extends IItem> = IATableFilter<T>[TATableFilterType];
|
|
281
|
-
export type TATableFilteration<T extends IItem> = {
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
* Description : type of the filteration
|
|
286
|
-
*/
|
|
287
|
-
type: 'And' | 'Or';
|
|
288
|
-
/**
|
|
289
|
-
* style? : React.CSSProperties
|
|
290
|
-
*
|
|
291
|
-
* Description : width of the String filter
|
|
292
|
-
*/
|
|
293
|
-
style?: React.CSSProperties;
|
|
294
|
-
/**
|
|
295
|
-
* filters : TATableSomeFilter<T>[]
|
|
296
|
-
*
|
|
297
|
-
* Description : filters of the filteration
|
|
298
|
-
*/
|
|
299
|
-
filters: 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>;
|
|
284
|
+
} & {
|
|
285
|
+
[key: string]: TATableSomeFilter<T, K>;
|
|
300
286
|
};
|
|
301
287
|
export type TATableSortF<T extends IItem> = (a: T, b: T) => number;
|
|
302
288
|
export interface IATableSortation<T extends IItem> {
|
|
@@ -339,7 +325,7 @@ export interface IATablePagination {
|
|
|
339
325
|
*/
|
|
340
326
|
pageRange: number;
|
|
341
327
|
}
|
|
342
|
-
export interface IATableState<T extends IItem> {
|
|
328
|
+
export interface IATableState<T extends IItem, K extends IItem = any> {
|
|
343
329
|
/**
|
|
344
330
|
* entireItems? : T[]
|
|
345
331
|
*
|
|
@@ -347,11 +333,11 @@ export interface IATableState<T extends IItem> {
|
|
|
347
333
|
*/
|
|
348
334
|
entireItems?: T[];
|
|
349
335
|
/**
|
|
350
|
-
* filteration : TATableFilteration<T>
|
|
336
|
+
* filteration : TATableFilteration<T, K>
|
|
351
337
|
*
|
|
352
338
|
* Description : filteration of the state
|
|
353
339
|
*/
|
|
354
|
-
filteration: TATableFilteration<T>;
|
|
340
|
+
filteration: TATableFilteration<T, K>;
|
|
355
341
|
/**
|
|
356
342
|
* pagination : IATablePagination
|
|
357
343
|
*
|
|
@@ -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
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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
|
+
getKeyValueFilterValue: <T_5 extends IItem, K extends IItem = any>(filteration: TATableFilteration<T_5, K>) => TKeyValuePairs<K>;
|
|
20
25
|
};
|
|
21
26
|
export {};
|