@ambuj.bhaskar/react-component-library 0.18.13-alpha → 0.18.14-alpha

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/index.d.ts CHANGED
@@ -8,7 +8,164 @@ import { SetStateAction } from 'react';
8
8
  import { TableProps as TableProps_2 } from 'antd';
9
9
  import { TimeRangePickerProps } from 'antd';
10
10
 
11
- export declare const AwiModal: ({ children, isBackdrop, backdropAction, detailsModal, className, type, popupPosition, }: AwiModalProps) => JSX_2.Element;
11
+ export declare interface Annotation {
12
+ awi_id: string;
13
+ awi_request_id: number;
14
+ awi_content_key: string;
15
+ awi_status: AnnotationStatus;
16
+ awi_coords: Array<{
17
+ x: number;
18
+ y: number;
19
+ }>;
20
+ awi_outline_type: AnnotationType;
21
+ awi_outline_status: AnnotationStatus;
22
+ awi_classes: MiniData | {
23
+ awi_color: string;
24
+ }[];
25
+ awi_attributes: AnnotationAttributes;
26
+ sam_status: string;
27
+ awi_last_updation: Date;
28
+ awi_added_by: any;
29
+ }
30
+
31
+ export declare type AnnotationAttributes = {
32
+ awi_id: number;
33
+ awi_values: string[];
34
+ awi_corrected_values: string[];
35
+ awi_status: AnnotationStatus;
36
+ awi_added_by?: {
37
+ awi_id: number;
38
+ awi_level: "awi_annotator" | "awi_verifier" | "awi_supervisor";
39
+ };
40
+ }[];
41
+
42
+ export declare type AnnotationLibraryComponentProps = {
43
+ title?: string;
44
+ };
45
+
46
+ export declare type AnnotationStatus = "approved" | "rejected" | "pending" | "corrected";
47
+
48
+ export declare type AnnotationType = "rectangle" | "circle" | "polygon" | "dot";
49
+
50
+ declare function areAllValuesEmpty(obj: any): boolean;
51
+
52
+ export declare const AWI_ALL_GLOBALS: {
53
+ MAX_TOASTS_COUNT: number;
54
+ DISPLAY_SEARCH_MINIMUM_RECORDS: number;
55
+ SAM_MODEL_NAME: string;
56
+ SAM_MODEL_CONFIDENCE: number;
57
+ SAM_MODEL_MAX_RESULTS: number;
58
+ SAM_MODEL_MAX_RESULTS_MIN: number;
59
+ SAM_MODEL_MAX_RESULTS_MAX: number;
60
+ SAM_MODEL_DATA: {
61
+ awi_id: string;
62
+ awi_label: string;
63
+ value: string;
64
+ }[];
65
+ };
66
+
67
+ /**
68
+ * File for handling and returning background images
69
+ */
70
+ export declare const AWI_IMAGE_VALIDITY_HELPER: {
71
+ checkImageValidity: (url: string, setBackgroundImage: any, contentKey: string | undefined, annotationViewType: string | undefined, fallbackImageUrl: any, defaultImage?: string) => Promise<void>;
72
+ };
73
+
74
+ export declare const AwiEmptyState: React.FC<AwiEmptyStateProps>;
75
+
76
+ export declare type AwiEmptyStateProps = {
77
+ stateKey?: any;
78
+ loadState?: boolean;
79
+ stateDescription?: string;
80
+ stateLoadDescription?: string;
81
+ showImage?: boolean;
82
+ textClass?: string;
83
+ noPadding?: boolean;
84
+ title?: string;
85
+ };
86
+
87
+ export declare const AwiHelperMethods: {
88
+ getStatusDisplayText: (status: string, user: any) => any;
89
+ displayVersion: (branch: any, commitId: any, buildDate: any, buildNumber: any) => void;
90
+ toAPIQueryString: (params: any) => string;
91
+ isSAMAllowed: (type: string | undefined, requestFor?: string) => boolean;
92
+ checkValidPassword: (val: any) => boolean;
93
+ getRelativeTime: (inputDate: Date) => string;
94
+ randomVibrantColor: () => string;
95
+ chunkArray: typeof chunkArray;
96
+ isValidMobileNumber: (val: any) => boolean;
97
+ sleepSystem: (time: number) => Promise<void>;
98
+ secondDelayDisplayMessage: (time: number) => string;
99
+ areAllValuesEmpty: typeof areAllValuesEmpty;
100
+ isEighteenOrOlder: typeof isEighteenOrOlder;
101
+ displayTimeAndDateInfo: (date?: any) => string;
102
+ hasMoreRecords: (allPages: any) => any;
103
+ checkOnboardingComplete: (myDetails: any) => boolean;
104
+ checkBillingAvailable: (myDetails: any) => boolean;
105
+ capitalizeFirstChar: typeof capitalizeFirstChar;
106
+ sendEmptyLabelStatus: (labels: any) => any;
107
+ isImageKitURL: (src?: string) => boolean;
108
+ byteToSize: (bytes: number) => string;
109
+ useThrottle: (func: any, limit: any) => (...args: any) => void;
110
+ };
111
+
112
+ export declare const AwiInput: React.FC<AwiInputProps>;
113
+
114
+ export declare type AwiInputProps = {
115
+ data?: {
116
+ awi_id: number | string;
117
+ awi_label: string;
118
+ value?: any;
119
+ }[];
120
+ onClick?: (...arg: any) => void;
121
+ onChange?: (s: string, event?: React.ChangeEvent<HTMLInputElement>) => void;
122
+ className?: string;
123
+ type?: "drop-down" | "input" | "drop-down-single";
124
+ keyDown?: (...arg: any) => void;
125
+ placeholder?: string;
126
+ searchString?: string;
127
+ required?: boolean;
128
+ disabled?: boolean;
129
+ name?: string;
130
+ selectedData?: any[];
131
+ handleSelectAllUnselectAll?: any;
132
+ };
133
+
134
+ export declare type AwiListProps = {
135
+ items: string[];
136
+ listType?: "ol" | "ul";
137
+ maxHeight?: string;
138
+ };
139
+
140
+ export declare const AwiLoadMoreButton: default_2.FC<AwiLoadMoreButtonProps>;
141
+
142
+ export declare type AwiLoadMoreButtonProps = {
143
+ hasNextPage?: boolean | undefined;
144
+ isFetchingNextPage?: boolean;
145
+ fetchNextPage?: () => void;
146
+ isLoading?: boolean | undefined;
147
+ totalResults?: number;
148
+ totalFetchedResults?: number;
149
+ currentPage?: number;
150
+ totalPages?: number;
151
+ onPageChange?: (value: number) => void;
152
+ isPagination?: boolean;
153
+ loadText?: string;
154
+ };
155
+
156
+ export declare interface AwiMessageProps {
157
+ iconUrl?: string;
158
+ title?: string;
159
+ description: string;
160
+ messageType?: "information" | "warning" | "error" | "success";
161
+ isLoading?: boolean;
162
+ textClass?: string;
163
+ noPadding?: boolean;
164
+ }
165
+
166
+ export declare const AwiMessageScreen: React.FC<AwiMessageProps>;
167
+
168
+ export declare const AwiModal: React.FC<AwiModalProps>;
12
169
 
13
170
  export declare const AwiModalBody: default_2.FC<AwiModalBodyProps>;
14
171
 
@@ -62,6 +219,123 @@ export declare interface AwiModalRowProps {
62
219
  className?: string;
63
220
  }
64
221
 
222
+ export declare const AwiPagination: default_2.FC<AwiPaginationProps>;
223
+
224
+ export declare type AwiPaginationProps = {
225
+ currentPage: number;
226
+ totalPages: number;
227
+ onPageChange: (page: number) => void;
228
+ isLoading: boolean;
229
+ };
230
+
231
+ export declare const AwiSafeLocalStorage: {
232
+ getItem: (key: any) => string | null;
233
+ setItem: (key: any, value: any) => void;
234
+ removeItem: (key: any) => void;
235
+ getToken: () => string;
236
+ removeToken: () => void;
237
+ removeLogout: () => void;
238
+ };
239
+
240
+ export declare const AwiSamModal: React.FC<AwiSamModalProps>;
241
+
242
+ export declare type AwiSamModalProps = {
243
+ closeSAMPromptModal: () => void;
244
+ onSubmit: any;
245
+ directPrompt: any;
246
+ isLoading: boolean;
247
+ requestInfo: any;
248
+ title?: string;
249
+ };
250
+
251
+ export declare const AwiScrollableTableCellList: React.FC<AwiListProps>;
252
+
253
+ export declare const AwiSlider: React.FC<AwiSliderProps>;
254
+
255
+ export declare type AwiSliderProps = {
256
+ label?: string;
257
+ min?: number;
258
+ max?: number;
259
+ step?: number;
260
+ value: number;
261
+ onChange: (value: number) => void;
262
+ unit?: string;
263
+ enableUnits?: boolean;
264
+ name?: string;
265
+ multiFactor?: number;
266
+ inputEdit?: boolean;
267
+ };
268
+
269
+ export declare const AwiTableBody: React.FC<AwiTableBodyProps>;
270
+
271
+ export declare type AwiTableBodyProps = {
272
+ children: React.ReactNode;
273
+ };
274
+
275
+ export declare const AwiTableCell: default_2.FC<AwiTableCellProps>;
276
+
277
+ export declare type AwiTableCellProps = {
278
+ children: React.ReactNode;
279
+ className?: string;
280
+ extraClass?: string;
281
+ title?: string;
282
+ [key: string]: any;
283
+ };
284
+
285
+ export declare const AwiTableHeader: default_2.FC<AwiTableHeaderProps>;
286
+
287
+ export declare type AwiTableHeaderProps = {
288
+ children: React.ReactNode;
289
+ className?: string;
290
+ title?: string;
291
+ };
292
+
293
+ export declare const AwiTableHeaders: React.FC<AwiTableHeadersProp>;
294
+
295
+ export declare type AwiTableHeadersProp = {
296
+ children: React.ReactNode;
297
+ className?: string;
298
+ };
299
+
300
+ export declare const AwiTableInfinite: React.FC<AwiTableInfiniteProps>;
301
+
302
+ export declare type AwiTableInfiniteProps = {
303
+ children: any;
304
+ disableOverflowY?: boolean;
305
+ tableClass?: string;
306
+ disableFixHeight?: boolean;
307
+ isPagination?: boolean;
308
+ title?: string;
309
+ };
310
+
311
+ export declare const AwiTableRow: React.FC<AwiTableRowProps>;
312
+
313
+ export declare type AwiTableRowProps = {
314
+ children: React.ReactNode;
315
+ className?: string;
316
+ title?: string;
317
+ onclick?: () => void;
318
+ };
319
+
320
+ /**
321
+ * Display Message Helper Utilities
322
+ */
323
+ export declare const AwiToastMessage: {
324
+ success: (message?: string, options?: {}) => void;
325
+ error: (message?: string, options?: {}) => void;
326
+ exception: (errorInfo: any, options?: {}) => void;
327
+ promise: (payload: any, options?: {
328
+ loading: string;
329
+ success: () => string;
330
+ error: () => string;
331
+ }) => void;
332
+ };
333
+
334
+ export declare const AwiUseKeyChecker: () => {
335
+ isCtrlPressedFunc: () => boolean;
336
+ isAltPressedFunc: () => boolean;
337
+ };
338
+
65
339
  export declare const Backdrop: default_2.FC<BackdropProps>;
66
340
 
67
341
  export declare interface BackdropProps extends ComponentProps<"div"> {
@@ -140,6 +414,15 @@ export declare type ButtonProps = HTMLButtonProps & {
140
414
 
141
415
  declare type ButtonVariant = "primary" | "secondary" | "tertiary" | "nav";
142
416
 
417
+ declare function calculateCentroid(coordinates: any): {
418
+ x: number;
419
+ y: number;
420
+ }[];
421
+
422
+ declare function calculateCircleFromCoordinates(coordinates: any): any;
423
+
424
+ declare function capitalizeFirstChar(str: any): any;
425
+
143
426
  export declare const Chart: React.FC<ChartProps>;
144
427
 
145
428
  declare type ChartData = {
@@ -167,6 +450,13 @@ export declare type ChartProps = {
167
450
 
168
451
  declare type ChartType = "line" | "bar" | "doughnut" | "pie";
169
452
 
453
+ /**
454
+ * All Helper methods will be defined here
455
+ */
456
+ declare function chunkArray<T>(arr: T[], chunkSize?: number): T[][];
457
+
458
+ declare function clampValue(value: any, min: any, max: any): number;
459
+
170
460
  declare type Color = string;
171
461
 
172
462
  export declare const CompactEventCard: React.FC<CompactEventCardPropsType>;
@@ -201,6 +491,8 @@ export declare type ContactInputProps = {
201
491
  dsabledColor?: Color;
202
492
  };
203
493
 
494
+ export declare type CorrectedAnnotationType = "created" | "not-created" | "";
495
+
204
496
  declare type CSSstring = string;
205
497
 
206
498
  declare type CustomOption = {
@@ -307,10 +599,88 @@ export declare type InputProps = HTMLInputProps & {
307
599
  borderColor?: Color;
308
600
  };
309
601
 
602
+ declare function isEighteenOrOlder(birthDate: any): boolean;
603
+
310
604
  declare type JustifyContent = "center" | "start" | "end" | "flex-start" | "flex-end" | "left" | "right" | "baseline" | "first baseline" | "last baseline" | "space-between" | "space-around" | "space-evenly" | "stretch";
311
605
 
312
606
  declare type LineVariant = "fill" | "line";
313
607
 
608
+ export declare const MathAnnotationHelper: {
609
+ gcd: any;
610
+ getDistance: (x1: number, y1: number, x2: number, y2: number) => number;
611
+ isLeft: (P0: any, P1: any, P2: any) => number;
612
+ windingNumber: (P: any, polygon: any, sensitivity?: number) => number;
613
+ getDiameter: (coords: {
614
+ x: number;
615
+ y: number;
616
+ }[]) => number;
617
+ checkPointInsidePolygon: (x: number, y: number, polygon: any, pos_sensitivity: number, neg_sensitivity: number, request: any, scale?: number) => boolean;
618
+ isAnnotationCoordinatesValid: (request: any, coords: {
619
+ x: number;
620
+ y: number;
621
+ }[], usingSamFunction?: boolean, scale?: number) => boolean;
622
+ distanceToSegment: (px: any, py: any, x1: any, y1: any, x2: any, y2: any) => number;
623
+ findClosestSegment: (polygon: any, px: any, py: any) => {
624
+ insertIndex: number;
625
+ minDistance: number;
626
+ };
627
+ transformCoordinatesCheck: (newXTransform: any, newYTransform: any, widthIncreased: any, heightIncreased: any) => {
628
+ newXTransform: any;
629
+ newYTransform: any;
630
+ };
631
+ getBoundingBox: (points: any) => {
632
+ x: number;
633
+ y: number;
634
+ }[];
635
+ translateCoordinatesWithFixedWidth: typeof translateCoordinatesWithFixedWidth;
636
+ clampValue: typeof clampValue;
637
+ calculateCircleFromCoordinates: typeof calculateCircleFromCoordinates;
638
+ calculateCentroid: typeof calculateCentroid;
639
+ minDistanceToPolygon: (point: Point, polygon: Polygon) => number;
640
+ closestCoordinates: (point: Point, polygon: Polygon) => {
641
+ minDistance: number;
642
+ insertIndex: number;
643
+ };
644
+ fineTuneCoordinates: (coordinateList: any) => any;
645
+ zoomLevelValue: (value: any, scale: any) => number;
646
+ createPolygonLoop: (outline: {
647
+ x: number;
648
+ y: number;
649
+ }[]) => {
650
+ x: number;
651
+ y: number;
652
+ }[];
653
+ breakPointCount: (coordinate: any) => number;
654
+ getBoundingBoxValues: (points: Point[]) => {
655
+ minX: number;
656
+ minY: number;
657
+ maxX: number;
658
+ maxY: number;
659
+ };
660
+ shiftPolygon: typeof shiftPolygon;
661
+ getPerfectPointValue: (coordinatePoint?: number) => number;
662
+ adjustToCircle: (coords: any) => any;
663
+ getMousePos: (canvas: any, evt: any) => {
664
+ x: number;
665
+ y: number;
666
+ };
667
+ getMousePosAbsolute: (canvas: any, evt: any) => {
668
+ x: number;
669
+ y: number;
670
+ };
671
+ getUpdatedCoordinates: (canvasRef: any, event: any, initialCoords: any) => {
672
+ x: number;
673
+ y: number;
674
+ }[];
675
+ };
676
+
677
+ export declare interface MiniData {
678
+ awi_id: number;
679
+ awi_label: string;
680
+ awi_image_assignable_request?: boolean;
681
+ awi_creation?: Date;
682
+ }
683
+
314
684
  export declare const Modal: default_2.FC<ModalProps>;
315
685
 
316
686
  export declare interface ModalButtonProps {
@@ -376,6 +746,16 @@ export declare type PaginationProps = {
376
746
  className?: string;
377
747
  };
378
748
 
749
+ /**
750
+ * Mathematics helpers for our system, majorly for annotations
751
+ */
752
+ declare type Point = {
753
+ x: number;
754
+ y: number;
755
+ };
756
+
757
+ declare type Polygon = Point[];
758
+
379
759
  export declare const Select: React.FC<SelectProps>;
380
760
 
381
761
  export declare type SelectProps = {
@@ -399,6 +779,10 @@ export declare type SelectProps = {
399
779
  suffixIcon?: ReactNode | boolean;
400
780
  };
401
781
 
782
+ declare function shiftPolygon(polygon: any): any;
783
+
784
+ export declare type ShowAnnotationStatus = "approved" | "rejected" | "pending" | "corrected" | "all";
785
+
402
786
  export declare const Sidebar: React.FC<SidebarProps>;
403
787
 
404
788
  export declare type SidebarConfig = {
@@ -538,6 +922,8 @@ declare type ToastProps = {
538
922
 
539
923
  declare type ToastType = "success" | "error" | "info" | "warning";
540
924
 
925
+ declare function translateCoordinatesWithFixedWidth(coordinates: any, shiftAmount?: number, targetCoordinate?: any): any;
926
+
541
927
  export declare function usePagination(initialPage?: number, initialTotalPages?: number): {
542
928
  currentPage: number;
543
929
  setPage: (newPage: number) => void;