@cagatayfdn/flora-components 0.0.148 → 0.0.149

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.
@@ -5,14 +5,14 @@ import { Accordion as m, AccordionItem as x } from "./Accordion/Accordion.js";
5
5
  import { default as u } from "./ActionButton/ActionButton.js";
6
6
  import { default as n } from "./AlertCard/AlertCard.js";
7
7
  import { default as C } from "./AuthUserCan/Permission.js";
8
- import { default as I } from "./Autocomplete/Autocomplete.js";
9
- import { default as T } from "./Avatar/Avatar.js";
8
+ import { default as T } from "./Autocomplete/Autocomplete.js";
9
+ import { default as S } from "./Avatar/Avatar.js";
10
10
  import { default as P } from "./Card/Card.js";
11
11
  import { default as h } from "./Charts/index.js";
12
12
  import { default as A } from "./Checkbox/Checkbox.js";
13
- import { default as D } from "./Config/Config.js";
14
- import { default as B } from "./Confirm/Confirm.js";
15
- import { default as M } from "./ContentHeader/ContentHeader.js";
13
+ import { default as v } from "./Config/Config.js";
14
+ import { default as M } from "./Confirm/Confirm.js";
15
+ import { default as B } from "./ContentHeader/ContentHeader.js";
16
16
  import { default as U } from "./ContentLoader/ContentLoader.js";
17
17
  import { default as y } from "./Countdown/Countdown.js";
18
18
  import { default as E } from "./Datepicker/Datepicker.js";
@@ -32,53 +32,54 @@ import { default as so } from "./InfiniteScroll/InfiniteScroll.js";
32
32
  import { default as io } from "./InfoBoxList/InfoBoxList.js";
33
33
  import { createConnectedService as co } from "./InfoBoxList/helper.js";
34
34
  import { default as go } from "./InfoDate/InfoDate.js";
35
- import { InfoText as So } from "./InfoText/InfoText.js";
35
+ import { InfoText as Io } from "./InfoText/InfoText.js";
36
36
  import { default as Lo } from "./Input/Input.js";
37
37
  import { default as bo } from "./Label/Label.js";
38
38
  import { default as wo } from "./Loading/Loading.js";
39
- import { default as vo } from "./Modal/Modal.js";
40
- import { default as No } from "./NavigatorCard/index.js";
41
- import { default as Fo } from "./NoResult/NoResult.js";
42
- import { Notification as Ro } from "./Notification/Notification.js";
39
+ import { default as Ro } from "./Modal/Modal.js";
40
+ import { default as Do } from "./NavigatorCard/index.js";
41
+ import { default as No } from "./NoResult/NoResult.js";
42
+ import { Notification as Fo } from "./Notification/Notification.js";
43
43
  import { default as ko } from "./PageWrapper/PageWrap.js";
44
44
  import { default as Ho } from "./Pager/Pager.js";
45
45
  import { default as Vo } from "./Panel/Panel.js";
46
46
  import { default as jo } from "./PermaLink/PermaLink.js";
47
47
  import { default as zo, RadioList as Go } from "./Radio/Radio.js";
48
- import { default as Ko } from "./ResultError/ResultError.js";
49
- import { default as Qo } from "./ScrollContainer/ScrollContainer.js";
50
- import { default as Yo } from "./Select/NoData.js";
51
- import { S as _o } from "../Select-nhp2PiJK.js";
52
- import { default as oe } from "./Sidebar/index.js";
53
- import { M as re } from "../MenuItem-Df6Zsa7E.js";
54
- import { default as te } from "./StatusTag/StatusTag.js";
55
- import { default as le } from "./StatusTypography/StatusTypography.js";
56
- import { default as pe } from "./Stepper/Stepper.js";
57
- import { default as xe } from "./Switch/Switch.js";
58
- import { default as ue } from "./Tab/Tab.js";
59
- import { default as ne } from "./Table/Table.js";
60
- import { default as Ce } from "./Table/TableHeader.js";
61
- import { default as Ie } from "./Table/TableSort.js";
62
- import { default as Te } from "./Textarea/Textarea.js";
63
- import { default as Pe } from "./Tooltip/Tooltip.js";
64
- import { default as he } from "./TypographyText/TypographyText.js";
65
- import { default as Ae } from "./UserInfo/UserInfo.js";
66
- import { default as De } from "./ValidationError/ValidationError.js";
48
+ import { R as Ko } from "../RealtimeLogModal-gZOv7y-z.js";
49
+ import { default as Qo } from "./ResultError/ResultError.js";
50
+ import { default as Yo } from "./ScrollContainer/ScrollContainer.js";
51
+ import { default as _o } from "./Select/NoData.js";
52
+ import { S as oe } from "../Select-nhp2PiJK.js";
53
+ import { default as re } from "./Sidebar/index.js";
54
+ import { M as te } from "../MenuItem-Df6Zsa7E.js";
55
+ import { default as le } from "./StatusTag/StatusTag.js";
56
+ import { default as pe } from "./StatusTypography/StatusTypography.js";
57
+ import { default as xe } from "./Stepper/Stepper.js";
58
+ import { default as ue } from "./Switch/Switch.js";
59
+ import { default as ne } from "./Tab/Tab.js";
60
+ import { default as Ce } from "./Table/Table.js";
61
+ import { default as Te } from "./Table/TableHeader.js";
62
+ import { default as Se } from "./Table/TableSort.js";
63
+ import { default as Pe } from "./Textarea/Textarea.js";
64
+ import { default as he } from "./Tooltip/Tooltip.js";
65
+ import { default as Ae } from "./TypographyText/TypographyText.js";
66
+ import { default as ve } from "./UserInfo/UserInfo.js";
67
+ import { default as Me } from "./ValidationError/ValidationError.js";
67
68
  export {
68
69
  m as Accordion,
69
70
  x as AccordionItem,
70
71
  u as ActionButton,
71
72
  n as AlertCard,
72
- I as Autocomplete,
73
- T as Avatar,
73
+ T as Autocomplete,
74
+ S as Avatar,
74
75
  r as Button,
75
76
  P as Card,
76
77
  h as Chart,
77
78
  A as Checkbox,
78
79
  oo as Column,
79
- D as Config,
80
- B as Confirm,
81
- M as ContentHeader,
80
+ v as Config,
81
+ M as Confirm,
82
+ B as ContentHeader,
82
83
  U as ContentLoader,
83
84
  y as Countdown,
84
85
  E as Datepicker,
@@ -95,17 +96,17 @@ export {
95
96
  so as InfiniteScroll,
96
97
  io as InfoBoxList,
97
98
  go as InfoDate,
98
- So as InfoText,
99
+ Io as InfoText,
99
100
  Lo as Input,
100
101
  bo as Label,
101
102
  wo as Loading,
102
- re as MenuItem,
103
- vo as Modal,
104
- No as NavigatorCard,
103
+ te as MenuItem,
104
+ Ro as Modal,
105
+ Do as NavigatorCard,
105
106
  t as NiceModal,
106
- Yo as NoData,
107
- Fo as NoResult,
108
- Ro as Notification,
107
+ _o as NoData,
108
+ No as NoResult,
109
+ Fo as Notification,
109
110
  ko as PageWrapper,
110
111
  Ho as Pager,
111
112
  Vo as Panel,
@@ -114,24 +115,25 @@ export {
114
115
  C as Permission,
115
116
  zo as Radio,
116
117
  Go as RadioList,
117
- Ko as ResultError,
118
+ Ko as RealTimeLogModal,
119
+ Qo as ResultError,
118
120
  ro as Row,
119
- Qo as ScrollContainer,
120
- _o as Select,
121
- oe as Sidebar,
122
- te as StatusTag,
123
- le as StatusTypography,
124
- pe as Stepper,
125
- xe as Switch,
126
- ue as Tab,
127
- ne as Table,
128
- Ce as TableHeader,
129
- Ie as TableSort,
130
- Te as Textarea,
131
- Pe as Tooltip,
132
- he as TypographyText,
133
- Ae as UserInfo,
134
- De as ValidationError,
121
+ Yo as ScrollContainer,
122
+ oe as Select,
123
+ re as Sidebar,
124
+ le as StatusTag,
125
+ pe as StatusTypography,
126
+ xe as Stepper,
127
+ ue as Switch,
128
+ ne as Tab,
129
+ Ce as Table,
130
+ Te as TableHeader,
131
+ Se as TableSort,
132
+ Pe as Textarea,
133
+ he as Tooltip,
134
+ Ae as TypographyText,
135
+ ve as UserInfo,
136
+ Me as ValidationError,
135
137
  co as createConnectedService,
136
138
  d as getAuth
137
139
  };
@@ -1451,12 +1451,12 @@ export {
1451
1451
  Nt as a,
1452
1452
  St as b,
1453
1453
  xt as c,
1454
- kt as d,
1455
- Et as e,
1454
+ qt as d,
1455
+ kt as e,
1456
1456
  it as f,
1457
- Ft as g,
1458
- It as h,
1459
- qt as i,
1457
+ Et as g,
1458
+ Ft as h,
1459
+ It as i,
1460
1460
  ft as p,
1461
1461
  Lt as r,
1462
1462
  Wt as s,
package/dist/index.d.mts CHANGED
@@ -6,9 +6,10 @@ import { CustomLocale } from 'flatpickr/dist/types/locale';
6
6
  import { DateLimit } from 'flatpickr/dist/types/options';
7
7
  import { DateOption } from 'flatpickr/dist/types/options';
8
8
  import dayjs from 'dayjs';
9
- import { Dispatch as Dispatch_2 } from 'react';
9
+ import { Dispatch } from 'react';
10
10
  import { FC } from 'react';
11
11
  import { FieldError } from 'react-hook-form';
12
+ import { FieldValues } from 'react-hook-form';
12
13
  import { format } from 'date-fns';
13
14
  import i18n from 'i18next';
14
15
  import { JSX as JSX_2 } from 'react/jsx-runtime';
@@ -27,6 +28,8 @@ import { TFunction } from 'i18next';
27
28
  import { TFunctionResult } from 'i18next';
28
29
  import { Tick } from 'chart.js';
29
30
  import { TooltipItem } from 'chart.js';
31
+ import { UseFormWatch } from 'react-hook-form';
32
+ import { WatchObserver } from 'react-hook-form';
30
33
 
31
34
  export declare const Accordion: ({ children, className, }: AccordionProps) => JSX.Element;
32
35
 
@@ -142,6 +145,13 @@ export declare enum AppearanceTag {
142
145
  WARNING = "warning"
143
146
  }
144
147
 
148
+ export declare interface ApplicationLogs {
149
+ id: string;
150
+ application_type: string;
151
+ log_timestamp: string;
152
+ message: string;
153
+ }
154
+
145
155
  export declare enum ApplicationTypeSlug {
146
156
  COMMERCE = "commerce",
147
157
  ZERO = "zero",
@@ -164,7 +174,7 @@ export declare enum AppTypeEnum {
164
174
 
165
175
  declare type AuthContextType = [state: State & {
166
176
  token?: string;
167
- }, dispatch: Dispatch];
177
+ }, dispatch: Dispatch_2];
168
178
 
169
179
  export declare const AuthProvider: (props: {
170
180
  children: React_2.ReactNode;
@@ -430,7 +440,7 @@ export declare interface DateRange {
430
440
 
431
441
  export { dayjs }
432
442
 
433
- declare type Dispatch = React_2.Dispatch<Actiontype>;
443
+ declare type Dispatch_2 = React_2.Dispatch<Actiontype>;
434
444
 
435
445
  export declare const Divider: ({ appearance, className, margin, }: DividerProps) => JSX.Element;
436
446
 
@@ -509,6 +519,22 @@ declare type ExpandableType = {
509
519
  onExpand?: (expanded: boolean, record: any) => void;
510
520
  };
511
521
 
522
+ export declare type FetcherReturnType = {
523
+ fetch: (...params: any) => void;
524
+ stopInterval: () => void;
525
+ startInterval: (...params: any) => void;
526
+ };
527
+
528
+ export declare type FetcherType = (...params: any) => void;
529
+
530
+ export declare interface FetchLogsParams {
531
+ applications: string[];
532
+ scroll_mode?: 'older' | 'newer';
533
+ projectPk: string;
534
+ appPk: string;
535
+ withoutPermission?: boolean;
536
+ }
537
+
512
538
  export declare const FileUpload: React_2.ForwardRefExoticComponent<{
513
539
  type?: "number" | "email" | "search" | "text" | "url" | "tel" | "password" | "hidden" | undefined;
514
540
  id?: string | undefined;
@@ -635,6 +661,14 @@ export declare interface FormElementProps {
635
661
  value?: string | number;
636
662
  }
637
663
 
664
+ export declare type FormFetcherReturnType<T extends FieldValues> = {
665
+ fetch: (...params: any) => void;
666
+ stop: () => void;
667
+ startInterval: (page: number, limit: number, values: T) => void;
668
+ stopInterval: () => void;
669
+ startSubscription: (watch: UseFormWatch<T>, callback: WatchObserver<T>) => void;
670
+ };
671
+
638
672
  export declare enum FormFieldAppearance {
639
673
  LIGHT = "light",
640
674
  DARK = "dark",
@@ -745,6 +779,7 @@ export declare const Input: React_2.ForwardRefExoticComponent<{
745
779
  type?: "number" | "email" | "search" | "text" | "url" | "tel" | "password" | "hidden" | undefined;
746
780
  prefix?: ReactNode;
747
781
  suffix?: ReactNode;
782
+ prefixClickable?: boolean | undefined;
748
783
  suffixClickable?: boolean | undefined;
749
784
  id?: string | undefined;
750
785
  size?: Size | undefined;
@@ -766,6 +801,7 @@ export declare type InputProps = {
766
801
  type?: 'text' | 'url' | 'number' | 'tel' | 'password' | 'email' | 'search' | 'hidden';
767
802
  prefix?: ReactNode;
768
803
  suffix?: ReactNode;
804
+ prefixClickable?: boolean;
769
805
  suffixClickable?: boolean;
770
806
  id?: string;
771
807
  size?: Size;
@@ -1074,6 +1110,30 @@ export declare type RadioProps = {
1074
1110
  setContext?: (v: OptionItem) => void;
1075
1111
  } & FormElementProps & Pick<EventProps<HTMLInputElement>, 'onChange' | 'onFocus'>;
1076
1112
 
1113
+ export declare const RealTimeLogModal: FC<RealTimeLogModalProps & NiceModalHocProps>;
1114
+
1115
+ export declare type RealTimeLogModalProps = {
1116
+ id: string;
1117
+ projectPk: string;
1118
+ logs: ApplicationLogs[];
1119
+ responseCount?: number;
1120
+ totalLogCount?: number;
1121
+ lastLogIndex?: number;
1122
+ withoutPermission?: boolean;
1123
+ appPk: string;
1124
+ interval: number;
1125
+ loading?: boolean;
1126
+ logTypes: {
1127
+ label: string;
1128
+ value: string;
1129
+ }[];
1130
+ setVisible?: Dispatch<SetStateAction<boolean>>;
1131
+ download: (value: any, isRealTime: boolean) => void;
1132
+ onClose?: () => void;
1133
+ onFetchLogs: (params: FetchLogsParams) => Promise<any>;
1134
+ onClearLogs: () => void;
1135
+ };
1136
+
1077
1137
  export declare enum ReportStatus {
1078
1138
  PENDING = "pending",
1079
1139
  FAILED = "failed",
@@ -1185,6 +1245,10 @@ export declare enum SortEnum {
1185
1245
  DESC = "desc"
1186
1246
  }
1187
1247
 
1248
+ export declare function startFetcher(fetcher: FetcherType, ms: number): FetcherReturnType;
1249
+
1250
+ export declare function startFormFetcher<T extends FieldValues>(fetcher: FetcherType, ms: number): FormFetcherReturnType<T>;
1251
+
1188
1252
  declare interface State {
1189
1253
  user: UserEntity_2 | null;
1190
1254
  status: Status;
@@ -1450,7 +1514,7 @@ export declare const useAuth: () => AuthContextType;
1450
1514
 
1451
1515
  export declare function useDisclosure(isOpenInit?: boolean): {
1452
1516
  isOpen: boolean;
1453
- setIsOpen: Dispatch_2<SetStateAction<boolean>>;
1517
+ setIsOpen: Dispatch<SetStateAction<boolean>>;
1454
1518
  onOpen: () => void;
1455
1519
  onClose: () => void;
1456
1520
  onToggle: () => void;
package/dist/index.d.ts CHANGED
@@ -6,9 +6,10 @@ import { CustomLocale } from 'flatpickr/dist/types/locale';
6
6
  import { DateLimit } from 'flatpickr/dist/types/options';
7
7
  import { DateOption } from 'flatpickr/dist/types/options';
8
8
  import dayjs from 'dayjs';
9
- import { Dispatch as Dispatch_2 } from 'react';
9
+ import { Dispatch } from 'react';
10
10
  import { FC } from 'react';
11
11
  import { FieldError } from 'react-hook-form';
12
+ import { FieldValues } from 'react-hook-form';
12
13
  import { format } from 'date-fns';
13
14
  import i18n from 'i18next';
14
15
  import { JSX as JSX_2 } from 'react/jsx-runtime';
@@ -27,6 +28,8 @@ import { TFunction } from 'i18next';
27
28
  import { TFunctionResult } from 'i18next';
28
29
  import { Tick } from 'chart.js';
29
30
  import { TooltipItem } from 'chart.js';
31
+ import { UseFormWatch } from 'react-hook-form';
32
+ import { WatchObserver } from 'react-hook-form';
30
33
 
31
34
  export declare const Accordion: ({ children, className, }: AccordionProps) => JSX.Element;
32
35
 
@@ -142,6 +145,13 @@ export declare enum AppearanceTag {
142
145
  WARNING = "warning"
143
146
  }
144
147
 
148
+ export declare interface ApplicationLogs {
149
+ id: string;
150
+ application_type: string;
151
+ log_timestamp: string;
152
+ message: string;
153
+ }
154
+
145
155
  export declare enum ApplicationTypeSlug {
146
156
  COMMERCE = "commerce",
147
157
  ZERO = "zero",
@@ -164,7 +174,7 @@ export declare enum AppTypeEnum {
164
174
 
165
175
  declare type AuthContextType = [state: State & {
166
176
  token?: string;
167
- }, dispatch: Dispatch];
177
+ }, dispatch: Dispatch_2];
168
178
 
169
179
  export declare const AuthProvider: (props: {
170
180
  children: React_2.ReactNode;
@@ -430,7 +440,7 @@ export declare interface DateRange {
430
440
 
431
441
  export { dayjs }
432
442
 
433
- declare type Dispatch = React_2.Dispatch<Actiontype>;
443
+ declare type Dispatch_2 = React_2.Dispatch<Actiontype>;
434
444
 
435
445
  export declare const Divider: ({ appearance, className, margin, }: DividerProps) => JSX.Element;
436
446
 
@@ -509,6 +519,22 @@ declare type ExpandableType = {
509
519
  onExpand?: (expanded: boolean, record: any) => void;
510
520
  };
511
521
 
522
+ export declare type FetcherReturnType = {
523
+ fetch: (...params: any) => void;
524
+ stopInterval: () => void;
525
+ startInterval: (...params: any) => void;
526
+ };
527
+
528
+ export declare type FetcherType = (...params: any) => void;
529
+
530
+ export declare interface FetchLogsParams {
531
+ applications: string[];
532
+ scroll_mode?: 'older' | 'newer';
533
+ projectPk: string;
534
+ appPk: string;
535
+ withoutPermission?: boolean;
536
+ }
537
+
512
538
  export declare const FileUpload: React_2.ForwardRefExoticComponent<{
513
539
  type?: "number" | "email" | "search" | "text" | "url" | "tel" | "password" | "hidden" | undefined;
514
540
  id?: string | undefined;
@@ -635,6 +661,14 @@ export declare interface FormElementProps {
635
661
  value?: string | number;
636
662
  }
637
663
 
664
+ export declare type FormFetcherReturnType<T extends FieldValues> = {
665
+ fetch: (...params: any) => void;
666
+ stop: () => void;
667
+ startInterval: (page: number, limit: number, values: T) => void;
668
+ stopInterval: () => void;
669
+ startSubscription: (watch: UseFormWatch<T>, callback: WatchObserver<T>) => void;
670
+ };
671
+
638
672
  export declare enum FormFieldAppearance {
639
673
  LIGHT = "light",
640
674
  DARK = "dark",
@@ -745,6 +779,7 @@ export declare const Input: React_2.ForwardRefExoticComponent<{
745
779
  type?: "number" | "email" | "search" | "text" | "url" | "tel" | "password" | "hidden" | undefined;
746
780
  prefix?: ReactNode;
747
781
  suffix?: ReactNode;
782
+ prefixClickable?: boolean | undefined;
748
783
  suffixClickable?: boolean | undefined;
749
784
  id?: string | undefined;
750
785
  size?: Size | undefined;
@@ -766,6 +801,7 @@ export declare type InputProps = {
766
801
  type?: 'text' | 'url' | 'number' | 'tel' | 'password' | 'email' | 'search' | 'hidden';
767
802
  prefix?: ReactNode;
768
803
  suffix?: ReactNode;
804
+ prefixClickable?: boolean;
769
805
  suffixClickable?: boolean;
770
806
  id?: string;
771
807
  size?: Size;
@@ -1074,6 +1110,30 @@ export declare type RadioProps = {
1074
1110
  setContext?: (v: OptionItem) => void;
1075
1111
  } & FormElementProps & Pick<EventProps<HTMLInputElement>, 'onChange' | 'onFocus'>;
1076
1112
 
1113
+ export declare const RealTimeLogModal: FC<RealTimeLogModalProps & NiceModalHocProps>;
1114
+
1115
+ export declare type RealTimeLogModalProps = {
1116
+ id: string;
1117
+ projectPk: string;
1118
+ logs: ApplicationLogs[];
1119
+ responseCount?: number;
1120
+ totalLogCount?: number;
1121
+ lastLogIndex?: number;
1122
+ withoutPermission?: boolean;
1123
+ appPk: string;
1124
+ interval: number;
1125
+ loading?: boolean;
1126
+ logTypes: {
1127
+ label: string;
1128
+ value: string;
1129
+ }[];
1130
+ setVisible?: Dispatch<SetStateAction<boolean>>;
1131
+ download: (value: any, isRealTime: boolean) => void;
1132
+ onClose?: () => void;
1133
+ onFetchLogs: (params: FetchLogsParams) => Promise<any>;
1134
+ onClearLogs: () => void;
1135
+ };
1136
+
1077
1137
  export declare enum ReportStatus {
1078
1138
  PENDING = "pending",
1079
1139
  FAILED = "failed",
@@ -1185,6 +1245,10 @@ export declare enum SortEnum {
1185
1245
  DESC = "desc"
1186
1246
  }
1187
1247
 
1248
+ export declare function startFetcher(fetcher: FetcherType, ms: number): FetcherReturnType;
1249
+
1250
+ export declare function startFormFetcher<T extends FieldValues>(fetcher: FetcherType, ms: number): FormFetcherReturnType<T>;
1251
+
1188
1252
  declare interface State {
1189
1253
  user: UserEntity_2 | null;
1190
1254
  status: Status;
@@ -1450,7 +1514,7 @@ export declare const useAuth: () => AuthContextType;
1450
1514
 
1451
1515
  export declare function useDisclosure(isOpenInit?: boolean): {
1452
1516
  isOpen: boolean;
1453
- setIsOpen: Dispatch_2<SetStateAction<boolean>>;
1517
+ setIsOpen: Dispatch<SetStateAction<boolean>>;
1454
1518
  onOpen: () => void;
1455
1519
  onClose: () => void;
1456
1520
  onToggle: () => void;