@cagatayfdn/flora-components 0.0.15 → 0.0.17

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
@@ -17,11 +17,29 @@ import { SelectItemRenderer } from 'react-dropdown-select';
17
17
  import { SetStateAction } from 'react';
18
18
  import { TFunction } from 'i18next';
19
19
 
20
+ export declare const Accordion: ({ children, className, }: AccordionProps) => JSX.Element;
21
+
22
+ export declare const AccordionItem: ({ children, title, isVisible, className, onClick, customItemRenderer, }: AccordionItemProps) => JSX.Element;
23
+
24
+ declare type AccordionItemProps = {
25
+ title?: ReactNode;
26
+ children: ReactNode;
27
+ customItemRenderer?: (isOpen: boolean) => ReactNode;
28
+ isVisible: boolean;
29
+ className?: string;
30
+ onClick?: (value: boolean) => void;
31
+ };
32
+
33
+ declare type AccordionProps = {
34
+ children: ReactNode;
35
+ className?: string;
36
+ };
37
+
20
38
  declare type Actiontype = {
21
39
  type: 'login_pending';
22
40
  } | {
23
41
  type: 'active_user_success';
24
- payload: UserEntity;
42
+ payload: UserEntity_2;
25
43
  } | {
26
44
  type: 'login_failure';
27
45
  payload: any;
@@ -131,6 +149,15 @@ declare type ButtonProps = {
131
149
  prefixIcon?: Icons;
132
150
  } & Omit<EventProps<HTMLButtonElement>, 'onKeyPress' | 'onKeyUp' | 'onKeydown' | 'onChange'>;
133
151
 
152
+ declare type CanProps = {
153
+ permItem: PermItem;
154
+ permType: PermType | PermType[];
155
+ children: ReactNode;
156
+ fallback?: JSX_2.Element | null;
157
+ pk?: string;
158
+ byPass?: boolean;
159
+ };
160
+
134
161
  export declare const changeLanguage: (user: any, t: TFunction) => void;
135
162
 
136
163
  export declare const Checkbox: React_2.ForwardRefExoticComponent<{
@@ -156,6 +183,19 @@ declare type ColumnProps = {
156
183
  className?: string;
157
184
  };
158
185
 
186
+ declare type ColumnsType = {
187
+ title: ReactNode;
188
+ dataIndex: string;
189
+ key?: string;
190
+ width?: string | number;
191
+ className?: string;
192
+ tdClassName?: string;
193
+ permItem?: PermItem_2;
194
+ permType?: PermType_2 | PermType_2[];
195
+ onClick?: (e: any, item: any, colItem: any, index: any) => void;
196
+ render?: (property: any, row: any) => void;
197
+ };
198
+
159
199
  export declare const Confirm: FC<ConfirmProps & NiceModalHocProps>;
160
200
 
161
201
  declare type ConfirmProps = {
@@ -220,6 +260,15 @@ export declare enum FormFieldAppearance {
220
260
  MORE_DARK = "more_dark"
221
261
  }
222
262
 
263
+ export declare const getAuth: ({ permType, user, permItem }: GetAuthProps) => boolean;
264
+
265
+ declare type GetAuthProps = {
266
+ permItem: PermItem;
267
+ permType: PermType | PermType[];
268
+ pk?: string;
269
+ user: UserEntity | null | undefined;
270
+ };
271
+
223
272
  export declare function getCurrentLanguage(): string;
224
273
 
225
274
  export declare function getDatepickerLocale(): "en" | CustomLocale;
@@ -343,7 +392,9 @@ declare type LoadingProps = {
343
392
  layer?: boolean;
344
393
  };
345
394
 
346
- declare type MappedObjectPermission = HashMap<PermissionsType, number[]>
395
+ declare type MappedObjectPermission = HashMap<PermissionsType, number[]>;
396
+
397
+ declare type MappedObjectPermission_2 = HashMap<PermissionsType_2, number[]>
347
398
 
348
399
  export declare const Modal: (props: ModalProps) => JSX.Element;
349
400
 
@@ -402,15 +453,45 @@ declare type PagerProps = {
402
453
  appearance?: ThemeAppearance;
403
454
  };
404
455
 
456
+ export declare const PermFallBack: () => JSX_2.Element;
457
+
458
+ export declare function Permission(props: Props): JSX_2.Element;
459
+
405
460
  declare interface Permissions_2 {
461
+ default: boolean;
462
+ depends_on: PermissionsType[] | null;
463
+ description: string;
464
+ name: string;
465
+ slug: PermItem;
466
+ }
467
+
468
+ declare interface Permissions_3 {
406
469
  default: boolean
407
- depends_on: PermissionsType[] | null
470
+ depends_on: PermissionsType_2[] | null
408
471
  description: string
409
472
  name: string
410
- slug: PermItem
473
+ slug: PermItem_2
411
474
  }
412
475
 
413
476
  declare enum PermissionsSlug {
477
+ Read = "read",
478
+ Write = "write",
479
+ Edit = "edit",
480
+ Delete = "delete",
481
+ Build = "build",
482
+ Deploy = "deploy",
483
+ EditPermissions = "edit_permissions",
484
+ ViewAddonInfo = "view_addon_info",
485
+ SetStableVersion = "set_stable_version",
486
+ AttachCertificate = "attach_certificate",
487
+ ManageEnvironments = "manage_environments",
488
+ ManageSecretEnvironments = "manage_secret_environments",
489
+ Monitor = "monitor",
490
+ Resend = "resend",
491
+ ExportZonefile = "export_zonefile"
492
+ }
493
+
494
+ declare enum PermissionsSlug_2 {
414
495
  Read = 'read',
415
496
  Write = 'write',
416
497
  Edit = 'edit',
@@ -428,51 +509,101 @@ declare enum PermissionsSlug {
428
509
  ExportZonefile = 'export_zonefile',
429
510
  }
430
511
 
431
- declare type PermissionsType = `${PermItem}::${PermissionsSlug}`
512
+ declare type PermissionsType = `${PermItem}::${PermissionsSlug}`;
513
+
514
+ declare type PermissionsType_2 = `${PermItem_2}::${PermissionsSlug_2}`
432
515
 
433
516
  declare interface PermissionTree {
434
- users: PermissionTreeItem
435
- roles: PermissionTreeItem
436
- public_key: PermissionTreeItem
437
- apps: PermissionTreeItem
438
- app_versions: PermissionTreeItem
439
- quality_assurance_report: PermissionTreeItem
440
- addon_types: PermissionTreeItem
441
- related_app: PermissionTreeItem
442
- public_apps: PermissionTreeItem
443
- public_services: PermissionTreeItem
444
- projects: PermissionTreeItem
445
- project_apps: PermissionTreeItem
446
- export_project_app_log: PermissionTreeItem
447
- project_app_deployments: PermissionTreeItem
448
- related_project_app: PermissionTreeItem
449
- project_app_email: PermissionTreeItem
450
- addons: PermissionTreeItem
451
- accounts: PermissionTreeItem
452
- domain: PermissionTreeItem
453
- certificate: PermissionTreeItem
454
- email: PermissionTreeItem
455
- mail_identity_domain: PermissionTreeItem
456
- remote_group: PermissionTreeItem
457
- remote_group_user: PermissionTreeItem
458
- remote_group_application: PermissionTreeItem
459
- app_bundle: PermissionTreeItem
460
- app_bundle_app: PermissionTreeItem
461
- app_bundle_base_app: PermissionTreeItem
462
- monitoring: PermissionTreeItem
463
- kubernetes: PermissionTreeItem
464
- app_user: PermissionTreeItem
517
+ users: PermissionTreeItem;
518
+ roles: PermissionTreeItem;
519
+ public_key: PermissionTreeItem;
520
+ apps: PermissionTreeItem;
521
+ app_versions: PermissionTreeItem;
522
+ quality_assurance_report: PermissionTreeItem;
523
+ addon_types: PermissionTreeItem;
524
+ related_app: PermissionTreeItem;
525
+ public_apps: PermissionTreeItem;
526
+ public_services: PermissionTreeItem;
527
+ projects: PermissionTreeItem;
528
+ project_apps: PermissionTreeItem;
529
+ export_project_app_log: PermissionTreeItem;
530
+ project_app_deployments: PermissionTreeItem;
531
+ related_project_app: PermissionTreeItem;
532
+ project_app_email: PermissionTreeItem;
533
+ addons: PermissionTreeItem;
534
+ accounts: PermissionTreeItem;
535
+ domain: PermissionTreeItem;
536
+ certificate: PermissionTreeItem;
537
+ email: PermissionTreeItem;
538
+ mail_identity_domain: PermissionTreeItem;
539
+ remote_group: PermissionTreeItem;
540
+ remote_group_user: PermissionTreeItem;
541
+ remote_group_application: PermissionTreeItem;
542
+ app_bundle: PermissionTreeItem;
543
+ app_bundle_app: PermissionTreeItem;
544
+ app_bundle_base_app: PermissionTreeItem;
545
+ monitoring: PermissionTreeItem;
546
+ kubernetes: PermissionTreeItem;
547
+ app_user: PermissionTreeItem;
548
+ }
549
+
550
+ declare interface PermissionTree_2 {
551
+ users: PermissionTreeItem_2
552
+ roles: PermissionTreeItem_2
553
+ public_key: PermissionTreeItem_2
554
+ apps: PermissionTreeItem_2
555
+ app_versions: PermissionTreeItem_2
556
+ quality_assurance_report: PermissionTreeItem_2
557
+ addon_types: PermissionTreeItem_2
558
+ related_app: PermissionTreeItem_2
559
+ public_apps: PermissionTreeItem_2
560
+ public_services: PermissionTreeItem_2
561
+ projects: PermissionTreeItem_2
562
+ project_apps: PermissionTreeItem_2
563
+ export_project_app_log: PermissionTreeItem_2
564
+ project_app_deployments: PermissionTreeItem_2
565
+ related_project_app: PermissionTreeItem_2
566
+ project_app_email: PermissionTreeItem_2
567
+ addons: PermissionTreeItem_2
568
+ accounts: PermissionTreeItem_2
569
+ domain: PermissionTreeItem_2
570
+ certificate: PermissionTreeItem_2
571
+ email: PermissionTreeItem_2
572
+ mail_identity_domain: PermissionTreeItem_2
573
+ remote_group: PermissionTreeItem_2
574
+ remote_group_user: PermissionTreeItem_2
575
+ remote_group_application: PermissionTreeItem_2
576
+ app_bundle: PermissionTreeItem_2
577
+ app_bundle_app: PermissionTreeItem_2
578
+ app_bundle_base_app: PermissionTreeItem_2
579
+ monitoring: PermissionTreeItem_2
580
+ kubernetes: PermissionTreeItem_2
581
+ app_user: PermissionTreeItem_2
465
582
  }
466
583
 
467
584
  declare interface PermissionTreeItem {
468
- depends_on: PermissionsType[] | null
585
+ depends_on: PermissionsType[] | null;
586
+ description: string;
587
+ name: string;
588
+ permissions: Permissions_2[];
589
+ slug: PermItem;
590
+ }
591
+
592
+ declare interface PermissionTreeItem_2 {
593
+ depends_on: PermissionsType_2[] | null
469
594
  description: string
470
595
  name: string
471
- permissions: Permissions_2[]
472
- slug: PermItem
596
+ permissions: Permissions_3[]
597
+ slug: PermItem_2
473
598
  }
474
599
 
475
- declare type PermItem = keyof PermissionTree
600
+ declare type PermItem = keyof PermissionTree;
601
+
602
+ declare type PermItem_2 = keyof PermissionTree_2
603
+
604
+ declare type PermType = `${PermissionsSlug}`;
605
+
606
+ declare type PermType_2 = `${PermissionsSlug_2}`
476
607
 
477
608
  export declare enum PodStatusEnum {
478
609
  TERMINATED = "Terminated",
@@ -484,6 +615,11 @@ export declare enum PodStatusEnum {
484
615
  EVICTED = "Evicted"
485
616
  }
486
617
 
618
+ declare type Props = {
619
+ id: string;
620
+ tooltipText?: string;
621
+ } & CanProps;
622
+
487
623
  export declare enum ReportStatus {
488
624
  PENDING = "pending",
489
625
  FAILED = "failed",
@@ -491,13 +627,32 @@ export declare enum ReportStatus {
491
627
  SUCCESS = "completed"
492
628
  }
493
629
 
630
+ export declare const ResultError: ({ title, text, image, buttonText, onClick, }: ResultErrorProps) => JSX.Element;
631
+
632
+ declare type ResultErrorProps = {
633
+ title: string;
634
+ text: string;
635
+ image: string;
636
+ buttonText?: string;
637
+ onClick?: () => void;
638
+ };
639
+
494
640
  declare interface Role {
641
+ pk: number;
642
+ name: string;
643
+ account: number;
644
+ description: string | null;
645
+ permission_tree: PermissionTree;
646
+ permissions: PermissionsType[];
647
+ }
648
+
649
+ declare interface Role_2 {
495
650
  pk: number
496
651
  name: string
497
652
  account: number
498
653
  description: string | null
499
- permission_tree: PermissionTree
500
- permissions: PermissionsType[]
654
+ permission_tree: PermissionTree_2
655
+ permissions: PermissionsType_2[]
501
656
  }
502
657
 
503
658
  export declare const Row: ({ children, className }: RowProps) => JSX.Element;
@@ -561,7 +716,7 @@ export declare enum Size {
561
716
  }
562
717
 
563
718
  declare interface State {
564
- user: UserEntity | null;
719
+ user: UserEntity_2 | null;
565
720
  status: Status;
566
721
  error: AxiosError | null;
567
722
  }
@@ -611,12 +766,66 @@ declare type StepperProps = {
611
766
 
612
767
  export declare const t: TFunction;
613
768
 
769
+ export declare const Table: (props: TableProps) => JSX.Element;
770
+
771
+ export declare const TableHeader: ({ totalCount, currentPage, title, actionOnChange, className, pagerOnChange, pageSizeOnChange, pagerVisible, pageSizeVisible, pageSize, actionItems, pageSizeItems, headerLeftItem, appearance, showItemsText, }: TableHeaderProps) => JSX_2.Element;
772
+
773
+ declare type TableHeaderProps = {
774
+ totalCount?: number;
775
+ currentPage?: number;
776
+ title?: string;
777
+ pagerVisible?: boolean;
778
+ pageSizeVisible?: boolean;
779
+ pageSize?: number;
780
+ actionItems?: OptionProps[];
781
+ pageSizeItems?: OptionProps[];
782
+ headerLeftItem?: ReactNode;
783
+ className?: string;
784
+ appearance?: ThemeAppearance;
785
+ actionOnChange?: (value: any) => void;
786
+ pagerOnChange?: (pageIndex: number) => void;
787
+ pageSizeOnChange?: (pageSize: number) => void;
788
+ showItemsText?: string;
789
+ };
790
+
791
+ declare type TableProps = {
792
+ columns: ColumnsType[];
793
+ dataSource: any[];
794
+ disabledItems?: any[];
795
+ isLoading?: boolean;
796
+ className?: string;
797
+ wrapperClass?: string;
798
+ headerVisible?: boolean;
799
+ headerLeftItem?: ReactNode;
800
+ selectedItems?: any[];
801
+ footerAction?: boolean;
802
+ rowSelection?: boolean;
803
+ rowSelectionChange?: (value: any) => void;
804
+ fixedHeader?: boolean;
805
+ customHeader?: ReactNode;
806
+ scrollClass?: string;
807
+ } & TableHeaderProps;
808
+
614
809
  export declare enum ThemeAppearance {
615
810
  LIGHT = "light",
616
811
  DARK = "dark",
617
812
  DARK_BLUE = "dark_blue"
618
813
  }
619
814
 
815
+ export declare const Tooltip: (props: TooltipProps) => JSX.Element;
816
+
817
+ declare type TooltipProps = {
818
+ id: string;
819
+ children: ReactNode;
820
+ tooltipContent: ReactNode;
821
+ contentClass?: string;
822
+ childClass?: string;
823
+ className?: string;
824
+ direction?: AppearanceDirection;
825
+ ellipsis?: boolean;
826
+ tooltipVisible?: boolean;
827
+ };
828
+
620
829
  export declare const useAuth: () => AuthContextType;
621
830
 
622
831
  export declare function useDisclosure(isOpenInit?: boolean): {
@@ -632,6 +841,22 @@ declare type UseNiceModal = [() => void, () => void, string];
632
841
  export declare function useNiceModal(modalId?: string): UseNiceModal;
633
842
 
634
843
  declare interface UserEntity {
844
+ pk: number;
845
+ email?: string;
846
+ first_name?: string;
847
+ last_name?: string;
848
+ language?: string;
849
+ account?: number;
850
+ last_login?: string | null;
851
+ permission_tree?: PermissionTree;
852
+ is_active?: boolean;
853
+ avatar?: string;
854
+ role?: Role;
855
+ object_permissions: MappedObjectPermission;
856
+ permissions: PermissionsType[];
857
+ }
858
+
859
+ declare interface UserEntity_2 {
635
860
  pk: number
636
861
  email?: string
637
862
  first_name?: string
@@ -639,12 +864,12 @@ declare interface UserEntity {
639
864
  language?: string
640
865
  account?: number
641
866
  last_login?: string | null
642
- permission_tree?: PermissionTree
867
+ permission_tree?: PermissionTree_2
643
868
  is_active?: boolean
644
869
  avatar?: string
645
- role?: Role
646
- object_permissions: MappedObjectPermission
647
- permissions: PermissionsType[]
870
+ role?: Role_2
871
+ object_permissions: MappedObjectPermission_2
872
+ permissions: PermissionsType_2[]
648
873
  }
649
874
 
650
875
  export declare const ValidationError: ({ message }: ValidationErrorProps) => JSX.Element;