@inceptionbg/iui 1.0.6 → 1.0.8

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
@@ -1,9 +1,11 @@
1
+ /// <reference types="react" />
1
2
  export { default as clsx } from 'clsx';
2
3
  export { default as moment } from 'moment';
3
4
  export { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
5
+ export { default as reactI18next } from 'react-i18next';
4
6
  import * as react from 'react';
5
- import { ReactNode, FunctionComponent, RefObject, MouseEventHandler, ReactElement, Dispatch, SetStateAction, FC, ButtonHTMLAttributes, FormEvent } from 'react';
6
- import { IconDefinition } from '@fortawesome/fontawesome-svg-core';
7
+ import { ReactNode, FunctionComponent, RefObject, MouseEventHandler, ReactElement, Dispatch, SetStateAction, FormEvent, FC, ButtonHTMLAttributes, InputHTMLAttributes } from 'react';
8
+ import { IconDefinition, RotateProp } from '@fortawesome/fontawesome-svg-core';
7
9
 
8
10
  interface IAnyObject {
9
11
  [id: string]: any;
@@ -240,7 +242,7 @@ interface ITableTranslations {
240
242
 
241
243
  interface ISidebarItem {
242
244
  label: string;
243
- icon: IconDefinition;
245
+ icon?: IconDefinition;
244
246
  to?: string;
245
247
  content?: ISidebarSubItem[];
246
248
  menu?: {
@@ -270,6 +272,56 @@ interface ISelectData extends IValueLabel {
270
272
  [id: string]: any;
271
273
  }
272
274
 
275
+ interface IFormWrapper {
276
+ isLoading: boolean;
277
+ className?: string;
278
+ submitButton: {
279
+ label?: string;
280
+ icon?: any;
281
+ disabled?: boolean;
282
+ onSubmit: (e: FormEvent<HTMLFormElement>) => void;
283
+ primary?: boolean;
284
+ };
285
+ otherButtons?: {
286
+ label: string;
287
+ icon?: any;
288
+ disabled?: boolean;
289
+ outlined?: boolean;
290
+ onClick: () => void;
291
+ }[];
292
+ noAccess?: boolean;
293
+ children: ReactNode;
294
+ }
295
+ declare const FormWrapper: FC<IFormWrapper>;
296
+
297
+ interface IHeaderAction {
298
+ label: string;
299
+ icon?: IconDefinition;
300
+ iconRotation?: RotateProp;
301
+ to?: string;
302
+ onClick?: () => void;
303
+ primary?: boolean;
304
+ disabled?: boolean;
305
+ hidden?: boolean;
306
+ }
307
+
308
+ interface IPageWrapper {
309
+ breadcrumbs: string[];
310
+ actions?: IHeaderAction[];
311
+ moreActions?: IHeaderAction[];
312
+ showBackButton?: boolean;
313
+ noAccess?: boolean;
314
+ isLoading?: boolean;
315
+ loaderLogo?: string;
316
+ footer?: ReactElement;
317
+ translations?: {
318
+ NoAccessTitle?: string;
319
+ ReturnToHomepage?: string;
320
+ };
321
+ children?: ReactNode;
322
+ }
323
+ declare const PageWrapper: FC<IPageWrapper>;
324
+
273
325
  declare const formatDate: (date?: string) => string;
274
326
  declare const formatDateAndTime: (date?: string, withSeconds?: boolean) => string;
275
327
  declare const formatTime: (date?: string, withSeconds?: boolean) => string;
@@ -290,24 +342,39 @@ declare const deleteEmptyPropsIncludingArray: (obj: IAnyObject) => any;
290
342
  declare const getActiveFilterNumber: (obj: any) => number;
291
343
  declare const getVisibleColumnsIds: (tableCols: ITableColumn[], isPrint?: boolean) => string[];
292
344
 
293
- interface Props$8 {
345
+ interface Props$s {
294
346
  tabs: ITab[];
295
347
  initialValue?: string;
296
348
  compact?: boolean;
297
349
  className?: string;
298
350
  }
299
- declare const Accordions: FC<Props$8>;
351
+ declare const Accordions: FC<Props$s>;
300
352
 
301
- interface Props$7 {
353
+ interface Props$r {
302
354
  text?: string;
303
355
  severity: "success" | "info" | "warning" | "error";
304
356
  fitContent?: boolean;
305
357
  className?: string;
306
358
  children?: ReactNode;
307
359
  }
308
- declare const Alert: FC<Props$7>;
360
+ declare const Alert: FC<Props$r>;
309
361
 
310
- interface Props$6 {
362
+ interface Props$q {
363
+ number?: number;
364
+ className?: string;
365
+ small?: boolean;
366
+ children?: ReactNode;
367
+ }
368
+ declare const NotificationBadge: FC<Props$q>;
369
+
370
+ interface Props$p {
371
+ label: string;
372
+ color: "success" | "info" | "warning" | "error" | "gray";
373
+ className?: string;
374
+ }
375
+ declare const PillBadge: react.ForwardRefExoticComponent<Props$p & react.RefAttributes<HTMLDivElement>>;
376
+
377
+ interface Props$o {
311
378
  label: string;
312
379
  icon?: IconDefinition;
313
380
  iconEnd?: IconDefinition;
@@ -320,9 +387,9 @@ interface Props$6 {
320
387
  size?: "xs" | "s" | "m" | "l";
321
388
  buttonProps?: ButtonHTMLAttributes<HTMLButtonElement>;
322
389
  }
323
- declare const Button: react.ForwardRefExoticComponent<Props$6 & react.RefAttributes<HTMLButtonElement>>;
390
+ declare const Button: react.ForwardRefExoticComponent<Props$o & react.RefAttributes<HTMLButtonElement>>;
324
391
 
325
- interface Props$5 {
392
+ interface Props$n {
326
393
  icon: IconDefinition;
327
394
  onClick?: MouseEventHandler<HTMLButtonElement>;
328
395
  disabled?: boolean;
@@ -330,20 +397,314 @@ interface Props$5 {
330
397
  active?: boolean;
331
398
  buttonProps?: ButtonHTMLAttributes<HTMLButtonElement>;
332
399
  }
333
- declare const IconButton: react.ForwardRefExoticComponent<Props$5 & react.RefAttributes<HTMLButtonElement>>;
400
+ declare const IconButton: react.ForwardRefExoticComponent<Props$n & react.RefAttributes<HTMLButtonElement>>;
334
401
 
335
- interface Props$4 {
402
+ interface Props$m {
403
+ title?: string;
404
+ titleEl?: ReactNode;
405
+ desc?: string;
406
+ descEl?: ReactNode;
336
407
  isOpen: boolean;
408
+ onClose: () => void;
409
+ confirmButton?: {
410
+ label?: string;
411
+ icon?: IconDefinition;
412
+ onClick?: () => void;
413
+ onFormSubmit?: () => void;
414
+ disabled?: boolean;
415
+ keepOpen?: boolean;
416
+ };
417
+ cancelButton?: {
418
+ label?: string;
419
+ icon?: IconDefinition;
420
+ onClick?: () => void;
421
+ };
422
+ additionalButton?: {
423
+ label: string;
424
+ icon?: IconDefinition;
425
+ onClick?: () => void;
426
+ disabled?: boolean;
427
+ };
428
+ noBackgroundClick?: boolean;
429
+ noOverflow?: boolean;
430
+ type?: "info" | "error";
431
+ size?: "m" | "l" | "xl";
432
+ noPadding?: boolean;
337
433
  className?: string;
338
434
  children?: ReactNode;
339
435
  }
340
- declare const Collapse: FC<Props$4>;
436
+ declare const Dialog: FC<Props$m>;
341
437
 
342
- interface Props$3 {
438
+ interface Props$l {
439
+ isOpen: boolean;
440
+ className?: string;
441
+ children?: ReactNode;
442
+ }
443
+ declare const Collapse: FC<Props$l>;
444
+
445
+ interface Props$k {
343
446
  title?: string;
344
447
  buttonLabel?: string;
345
448
  }
346
- declare const NoAccessInfo: FC<Props$3>;
449
+ declare const NoAccessInfo: FC<Props$k>;
450
+
451
+ interface Props$j {
452
+ label?: string;
453
+ value: boolean;
454
+ setValue: (checked: boolean) => void;
455
+ required?: boolean;
456
+ disabled?: boolean;
457
+ className?: string;
458
+ children?: ReactNode;
459
+ }
460
+ declare const Checkbox: react.ForwardRefExoticComponent<Props$j & react.RefAttributes<HTMLLabelElement>>;
461
+
462
+ interface Props$i {
463
+ label?: string;
464
+ date?: string;
465
+ setDate: (date: string) => void;
466
+ required?: boolean;
467
+ disabled?: boolean;
468
+ autoFocus?: boolean;
469
+ helperText?: string;
470
+ error?: boolean;
471
+ className?: string;
472
+ calendarPlacementX?: "left" | "right";
473
+ }
474
+ declare const DateInput: react.ForwardRefExoticComponent<Props$i & react.RefAttributes<HTMLInputElement>>;
475
+
476
+ interface Props$h {
477
+ label: string;
478
+ value?: string;
479
+ setValue: (value: string) => void;
480
+ required?: boolean;
481
+ disabled?: boolean;
482
+ autoFocus?: boolean;
483
+ rows?: number;
484
+ placeholder?: string;
485
+ helperText?: string;
486
+ className?: string;
487
+ inputProps?: InputHTMLAttributes<HTMLTextAreaElement>;
488
+ error?: boolean;
489
+ }
490
+ declare const LargeTextInput: react.ForwardRefExoticComponent<Props$h & react.RefAttributes<HTMLTextAreaElement>>;
491
+
492
+ interface Props$g {
493
+ label?: string;
494
+ value?: string | number;
495
+ setValue: (value: string) => void;
496
+ required?: boolean;
497
+ disabled?: boolean;
498
+ autoFocus?: boolean;
499
+ placeholder?: string;
500
+ helperText?: string;
501
+ className?: string;
502
+ allowNegative?: boolean;
503
+ decimalPlaces?: number;
504
+ error?: boolean;
505
+ alignLeft?: boolean;
506
+ inputProps?: InputHTMLAttributes<HTMLInputElement>;
507
+ }
508
+ declare const NumberInput: react.ForwardRefExoticComponent<Props$g & react.RefAttributes<HTMLInputElement>>;
509
+
510
+ interface ITextInput {
511
+ label?: string;
512
+ value?: string;
513
+ setValue: (value: string) => void;
514
+ required?: boolean;
515
+ disabled?: boolean;
516
+ autoFocus?: boolean;
517
+ placeholder?: string;
518
+ helperText?: string;
519
+ className?: string;
520
+ inputProps?: InputHTMLAttributes<HTMLInputElement>;
521
+ error?: boolean;
522
+ endButton?: {
523
+ icon: IconDefinition;
524
+ onClick: () => void;
525
+ disabled?: boolean;
526
+ };
527
+ }
528
+ declare const TextInput: react.ForwardRefExoticComponent<ITextInput & react.RefAttributes<HTMLInputElement>>;
529
+
530
+ interface IProps extends ITextInput {
531
+ newPassword?: boolean;
532
+ }
533
+ declare const PasswordInput: FC<IProps>;
534
+
535
+ interface Props$f {
536
+ label?: string;
537
+ value: string | number | boolean;
538
+ selected: string | number | boolean;
539
+ setSelected: (selected: any) => void;
540
+ disabled?: boolean;
541
+ className?: string;
542
+ children?: ReactNode;
543
+ }
544
+ declare const Radio: react.ForwardRefExoticComponent<Props$f & react.RefAttributes<HTMLDivElement>>;
545
+
546
+ interface Props$e {
547
+ label?: string;
548
+ options: ISelectData[];
549
+ value?: ISelectData | null;
550
+ valuesMulti?: ISelectData[];
551
+ onChange: (value: any) => void;
552
+ required?: boolean;
553
+ disabled?: boolean;
554
+ placeholder?: string;
555
+ helperText?: string;
556
+ className?: string;
557
+ minWidth?: number;
558
+ menuWidth?: 'fit-content' | 'max-content' | number;
559
+ autoFocus?: boolean;
560
+ isClearable?: boolean;
561
+ isOpen?: boolean;
562
+ openDirection?: 'top' | 'auto' | 'bottom';
563
+ noOptionsMessage?: string;
564
+ error?: boolean;
565
+ }
566
+ declare const Select: FC<Props$e>;
567
+
568
+ interface Props$d {
569
+ label?: string;
570
+ value?: ISelectData | null;
571
+ valuesMulti?: ISelectData[];
572
+ loadOptions: any;
573
+ refresh?: any[];
574
+ onChange: (value: any) => void;
575
+ required?: boolean;
576
+ disabled?: boolean;
577
+ placeholder?: string;
578
+ helperText?: string;
579
+ className?: string;
580
+ minWidth?: number;
581
+ menuWidth?: "fit-content" | "max-content" | number;
582
+ autoFocus?: boolean;
583
+ isMulti?: boolean;
584
+ isClearable?: boolean;
585
+ isOpen?: boolean;
586
+ openDirection?: "top" | "auto" | "bottom";
587
+ noOptionsMessage?: string;
588
+ error?: boolean;
589
+ }
590
+ declare const SelectAsyncPaginate: FC<Props$d>;
591
+
592
+ interface Props$c {
593
+ isLoading: boolean;
594
+ logo?: string;
595
+ fullWidth?: boolean;
596
+ children: ReactNode;
597
+ }
598
+ declare const Loader: FC<Props$c>;
599
+ declare const FullScreenLoader: FC<{
600
+ isLoading: boolean;
601
+ logo?: string;
602
+ }>;
603
+ declare const LazyLoader: FC<{
604
+ logo?: string;
605
+ }>;
606
+
607
+ interface Props$b {
608
+ isOpen: boolean;
609
+ onClose: () => void;
610
+ renderButton: (ref: RefObject<any>) => ReactNode;
611
+ placementX?: "left" | "right";
612
+ placementY?: "bottom" | "top" | "auto";
613
+ size?: "s" | "m" | "l";
614
+ className?: string;
615
+ children?: ReactNode;
616
+ }
617
+ declare const Menu: FC<Props$b>;
618
+
619
+ interface Props$a {
620
+ label?: string;
621
+ icon?: IconDefinition;
622
+ iconRotation?: RotateProp;
623
+ onClick?: MouseEventHandler<HTMLDivElement>;
624
+ to?: string;
625
+ disabled?: boolean;
626
+ withDevider?: boolean;
627
+ className?: string;
628
+ children?: ReactNode;
629
+ }
630
+ declare const MenuItem: FC<Props$a>;
631
+
632
+ interface Props$9 {
633
+ moduleName?: string;
634
+ children?: ReactNode;
635
+ }
636
+ declare const Header: FC<Props$9>;
637
+
638
+ interface Props$8 {
639
+ items: ISidebarItem[][];
640
+ UserBox?: ReactElement;
641
+ logo?: string;
642
+ collapsed?: boolean;
643
+ setCollapsed?: (collapsed: boolean) => void;
644
+ }
645
+ declare const Sidebar: FC<Props$8>;
646
+
647
+ interface Props$7 extends ITableFilterData {
648
+ isOpen: boolean;
649
+ onClose: () => void;
650
+ translations?: ITableTranslations;
651
+ }
652
+ declare const SetTableFilter: FC<Props$7>;
653
+
654
+ declare const Table: FC<ITable>;
655
+
656
+ interface Props$6 {
657
+ limit: number;
658
+ offset: number;
659
+ setLimit: (limit: number) => void;
660
+ setOffset: (offset: number) => void;
661
+ totalRows: number;
662
+ footerAction?: {
663
+ icon?: IconDefinition;
664
+ onClick: MouseEventHandler<HTMLButtonElement>;
665
+ };
666
+ customLimit?: number[];
667
+ translations?: ITableTranslations;
668
+ }
669
+ declare const TableFooter: FC<Props$6>;
670
+
671
+ interface Props$5 {
672
+ item: any;
673
+ setSelectedItem?: (item: any) => void;
674
+ setItemToDeleteUuid?: (uuid: string) => void;
675
+ actions?: {
676
+ label: string;
677
+ onClick: (uuid: string) => void;
678
+ hidden?: boolean;
679
+ disabled?: boolean;
680
+ }[];
681
+ t?: (e: string) => string;
682
+ }
683
+ declare const ItemActionsMenu: FC<Props$5>;
684
+
685
+ interface Props$4 {
686
+ setData: (item: any) => void;
687
+ clearItem: () => void;
688
+ inputFocusRef?: RefObject<any>;
689
+ defaultDataValue?: any;
690
+ }
691
+ declare const ItemEditOptionsButtons: FC<Props$4>;
692
+
693
+ declare const TableEditRow: FC<ITableEditRow>;
694
+
695
+ interface Props$3 {
696
+ tabs: ITab[];
697
+ initialValue?: string;
698
+ control?: {
699
+ value: string;
700
+ setValue: (value: string) => void;
701
+ };
702
+ onChange?: (value: string) => void;
703
+ noWrap?: boolean;
704
+ className?: string;
705
+ classNameContent?: string;
706
+ }
707
+ declare const Tabs: FC<Props$3>;
347
708
 
348
709
  type Position = "left" | "right" | "top" | "bottom";
349
710
  interface Props$2 {
@@ -382,26 +743,4 @@ interface Props {
382
743
  }
383
744
  declare const FullPageWrapper: FC<Props>;
384
745
 
385
- interface IFormWrapper {
386
- isLoading: boolean;
387
- className?: string;
388
- submitButton: {
389
- label?: string;
390
- icon?: any;
391
- disabled?: boolean;
392
- onSubmit: (e: FormEvent<HTMLFormElement>) => void;
393
- primary?: boolean;
394
- };
395
- otherButtons?: {
396
- label: string;
397
- icon?: any;
398
- disabled?: boolean;
399
- outlined?: boolean;
400
- onClick: () => void;
401
- }[];
402
- noAccess?: boolean;
403
- children: ReactNode;
404
- }
405
- declare const FormWrapper: FC<IFormWrapper>;
406
-
407
- export { Accordions, Alert, Button, Collapse, ConditionalWrapper, FormWrapper, FullPageWrapper, IAnyObject, IBooleanObject, IError, IPagination, ISelectData, IServerSidePagination, ISidebarItem, ISimpleObject, ISimpleObjectWithCode, ISimpleObjectWithCodeNew, IStringObject, ITab, ITable, ITableColumn, ITableDataItem, ITableEditRow, ITableFilter, ITableFilterData, ITableFilterItem, ITableSort, IValueLabel, IconButton, NoAccessInfo, Tooltip, checkIfExpired, dateAddDays, deleteEmptyProps, deleteEmptyPropsIncludingArray, deleteProps, formatCurrency, formatCurrencyNoDecimals, formatDate, formatDateAndTime, formatTime, formatYearMonth, getActiveFilterNumber, getCurrentDateFormattedYMD, getDaysLeft, getVisibleColumnsIds, maxChar };
746
+ export { Accordions, Alert, Button, Checkbox, Collapse, ConditionalWrapper, DateInput, Dialog, FormWrapper, FullPageWrapper, FullScreenLoader, Header, IAnyObject, IBooleanObject, IError, IFormWrapper, IPageWrapper, IPagination, ISelectData, IServerSidePagination, ISidebarItem, ISimpleObject, ISimpleObjectWithCode, ISimpleObjectWithCodeNew, IStringObject, ITab, ITable, ITableColumn, ITableDataItem, ITableEditRow, ITableFilter, ITableFilterData, ITableFilterItem, ITableSort, IValueLabel, IconButton, ItemActionsMenu, ItemEditOptionsButtons, LargeTextInput, LazyLoader, Loader, Menu, MenuItem, NoAccessInfo, NotificationBadge, NumberInput, PageWrapper, PasswordInput, PillBadge, Radio, Select, SelectAsyncPaginate, SetTableFilter, Sidebar, Table, TableEditRow, TableFooter, Tabs, TextInput, Tooltip, checkIfExpired, dateAddDays, deleteEmptyProps, deleteEmptyPropsIncludingArray, deleteProps, formatCurrency, formatCurrencyNoDecimals, formatDate, formatDateAndTime, formatTime, formatYearMonth, getActiveFilterNumber, getCurrentDateFormattedYMD, getDaysLeft, getVisibleColumnsIds, maxChar };