@cagatayfdn/flora-components 0.0.163 → 0.0.165

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
@@ -208,6 +208,9 @@ export declare type BreadcrumbProps = {
208
208
  state?: any;
209
209
  };
210
210
 
211
+ /** Build the final request URL from `baseURL`, `url` and serialized `params`. */
212
+ export declare function buildFullURL(config: FetchRequestConfig): string;
213
+
211
214
  export declare const Button: ({ children, size, isLoading, isDisabled, isBlock, noBorder, noBackground, round, isSolid, isPill, type, focus, className, prefixIcon, appearance, onClick, }: ButtonProps) => JSX.Element;
212
215
 
213
216
  export declare type ButtonProps = {
@@ -319,6 +322,12 @@ export declare type ColumnsType = {
319
322
  render?: (property: any, row: any) => void;
320
323
  };
321
324
 
325
+ /**
326
+ * Join a base URL and a relative URL with a single slash. An absolute
327
+ * `relativeURL` (with its own scheme/host) is returned untouched.
328
+ */
329
+ export declare function combineURLs(baseURL?: string, relativeURL?: string): string;
330
+
322
331
  export declare function Config({ config, scrollProps }: ConfigProps): JSX_2.Element;
323
332
 
324
333
  declare function Config({ config, scrollProps }: ConfigProps): JSX_2.Element;
@@ -379,6 +388,20 @@ export declare type CountdownProps = {
379
388
 
380
389
  export declare const createConnectedService: (projects: Record<string, any>[], isFlex?: boolean) => JSX_2.Element[] | undefined;
381
390
 
391
+ /**
392
+ * Create an axios-like HTTP client backed by the Fetch API.
393
+ *
394
+ * @example
395
+ * const instance = createFetchClient({ baseURL: import.meta.env.VITE_APP_API_URL });
396
+ * instance.interceptors.request.use((config) => {
397
+ * const token = localStorage.getItem("token");
398
+ * if (token) config.headers = { ...config.headers, Authorization: `Token ${token}` };
399
+ * return config;
400
+ * });
401
+ * const { data } = await instance.get("/users");
402
+ */
403
+ export declare function createFetchClient(defaultConfig?: FetchRequestConfig): FetchInstance;
404
+
382
405
  export declare type CustomItemProps = {
383
406
  item: OptionProps;
384
407
  };
@@ -440,6 +463,13 @@ export declare interface DateRange {
440
463
 
441
464
  export { dayjs }
442
465
 
466
+ /**
467
+ * Serialize `params` into a query string. Arrays repeat the key with a `[]`
468
+ * suffix, `Date`s become ISO strings, plain objects are JSON-encoded, and
469
+ * `null`/`undefined` values are skipped — matching axios' default behaviour.
470
+ */
471
+ export declare function defaultParamsSerializer(params: any): string;
472
+
443
473
  declare type Dispatch_2 = React_2.Dispatch<Actiontype>;
444
474
 
445
475
  export declare const Divider: ({ appearance, className, margin, }: DividerProps) => JSX.Element;
@@ -525,6 +555,7 @@ declare type ExpandableType = {
525
555
  expandedRowRender: (record: any) => ReactNode;
526
556
  rowExpandable?: (record: any) => boolean;
527
557
  onExpand?: (expanded: boolean, record: any) => void;
558
+ expandStrategy?: 'single' | 'multiple';
528
559
  };
529
560
 
530
561
  export declare type FetcherReturnType = {
@@ -533,8 +564,69 @@ export declare type FetcherReturnType = {
533
564
  startInterval: (...params: any) => void;
534
565
  };
535
566
 
567
+ /**
568
+ * Error thrown for failed requests. Mirrors `AxiosError`: it carries the
569
+ * originating `config`, the `response` (when the server responded) and a
570
+ * machine-readable `code`. Network failures, timeouts and cancellations have
571
+ * no `response`.
572
+ */
573
+ export declare class FetchError<T = any> extends Error {
574
+ config: FetchRequestConfig;
575
+ code?: string;
576
+ request?: any;
577
+ response?: FetchResponse<T>;
578
+ isFetchError: boolean;
579
+ constructor(message: string, config: FetchRequestConfig, code?: string, request?: any, response?: FetchResponse<T>);
580
+ toJSON(): {
581
+ name: string;
582
+ message: string;
583
+ code: string | undefined;
584
+ status: number | undefined;
585
+ };
586
+ }
587
+
588
+ export declare const FetchErrorCode: {
589
+ readonly BAD_REQUEST: "ERR_BAD_REQUEST";
590
+ readonly BAD_RESPONSE: "ERR_BAD_RESPONSE";
591
+ readonly NETWORK: "ERR_NETWORK";
592
+ readonly TIMEOUT: "ERR_TIMEOUT";
593
+ readonly CANCELED: "ERR_CANCELED";
594
+ };
595
+
536
596
  export declare type FetcherType = (...params: any) => void;
537
597
 
598
+ export declare type FetchHeaders = Record<string, string>;
599
+
600
+ /**
601
+ * A configured client. Callable like axios (`instance(config)` /
602
+ * `instance(url, config)`) and exposes `request`, the HTTP verb helpers,
603
+ * `interceptors`, `defaults`, and `create`.
604
+ */
605
+ export declare interface FetchInstance {
606
+ <T = any>(config: FetchRequestConfig): Promise<FetchResponse<T>>;
607
+ <T = any>(url: string, config?: FetchRequestConfig): Promise<FetchResponse<T>>;
608
+ request<T = any>(config: FetchRequestConfig): Promise<FetchResponse<T>>;
609
+ get<T = any>(url: string, config?: FetchRequestConfig): Promise<FetchResponse<T>>;
610
+ delete<T = any>(url: string, config?: FetchRequestConfig): Promise<FetchResponse<T>>;
611
+ head<T = any>(url: string, config?: FetchRequestConfig): Promise<FetchResponse<T>>;
612
+ options<T = any>(url: string, config?: FetchRequestConfig): Promise<FetchResponse<T>>;
613
+ post<T = any, D = any>(url: string, data?: D, config?: FetchRequestConfig): Promise<FetchResponse<T>>;
614
+ put<T = any, D = any>(url: string, data?: D, config?: FetchRequestConfig): Promise<FetchResponse<T>>;
615
+ patch<T = any, D = any>(url: string, data?: D, config?: FetchRequestConfig): Promise<FetchResponse<T>>;
616
+ interceptors: {
617
+ request: FetchInterceptorManager<FetchRequestConfig>;
618
+ response: FetchInterceptorManager<FetchResponse>;
619
+ };
620
+ defaults: FetchRequestConfig;
621
+ create(config?: FetchRequestConfig): FetchInstance;
622
+ }
623
+
624
+ export declare interface FetchInterceptorManager<V> {
625
+ use(onFulfilled?: (value: V) => V | Promise<V>, onRejected?: InterceptorRejected): number;
626
+ eject(id: number): void;
627
+ clear(): void;
628
+ }
629
+
538
630
  export declare interface FetchLogsParams {
539
631
  applications: string[];
540
632
  scroll_mode?: 'older' | 'newer';
@@ -543,6 +635,47 @@ export declare interface FetchLogsParams {
543
635
  withoutPermission?: boolean;
544
636
  }
545
637
 
638
+ export declare type FetchMethod = "get" | "GET" | "post" | "POST" | "put" | "PUT" | "patch" | "PATCH" | "delete" | "DELETE" | "head" | "HEAD" | "options" | "OPTIONS";
639
+
640
+ /**
641
+ * Request configuration. Mirrors the shape of an axios request config so that
642
+ * migrating existing axios code requires minimal changes. Unknown keys are
643
+ * allowed (e.g. custom flags like `_retry`) via the index signature.
644
+ */
645
+ export declare interface FetchRequestConfig<D = any> {
646
+ url?: string;
647
+ method?: FetchMethod;
648
+ baseURL?: string;
649
+ headers?: FetchHeaders;
650
+ params?: any;
651
+ data?: D;
652
+ signal?: AbortSignal;
653
+ /** Abort the request after this many milliseconds. */
654
+ timeout?: number;
655
+ /** When true, sends credentials (cookies) cross-origin (`credentials: "include"`). */
656
+ withCredentials?: boolean;
657
+ /** Fine-grained override of the fetch `credentials` mode. Takes precedence over `withCredentials`. */
658
+ credentials?: RequestCredentials;
659
+ /** How to parse the response body. Defaults to `"json"`. */
660
+ responseType?: FetchResponseType;
661
+ /** Custom query-string serializer. Defaults to an axios-compatible serializer. */
662
+ paramsSerializer?: (params: any) => string;
663
+ /** Resolves the promise only for matching statuses. `null` accepts every status. */
664
+ validateStatus?: ((status: number) => boolean) | null;
665
+ [key: string]: any;
666
+ }
667
+
668
+ export declare interface FetchResponse<T = any, D = any> {
669
+ data: T;
670
+ status: number;
671
+ statusText: string;
672
+ headers: FetchHeaders;
673
+ config: FetchRequestConfig<D>;
674
+ request?: any;
675
+ }
676
+
677
+ export declare type FetchResponseType = "json" | "text" | "blob" | "arrayBuffer" | "formData";
678
+
546
679
  export declare const FileUpload: React_2.ForwardRefExoticComponent<{
547
680
  type?: "number" | "email" | "search" | "text" | "url" | "tel" | "password" | "hidden" | undefined;
548
681
  id?: string | undefined;
@@ -851,11 +984,42 @@ export declare type InputProps = {
851
984
  textFillColor?: string;
852
985
  } & Omit<FormElementProps, 'value'> & Omit<EventProps<HTMLInputElement>, 'onMouseUp' | 'onMouseDown' | 'onMouseEnter' | 'onMouseLeave'>;
853
986
 
987
+ declare interface InterceptorHandler<V> {
988
+ fulfilled?: (value: V) => V | Promise<V>;
989
+ rejected?: InterceptorRejected;
990
+ }
991
+
992
+ /**
993
+ * Holds a list of interceptor handlers. Ejecting nulls a slot instead of
994
+ * splicing so previously returned ids stay valid (same approach as axios).
995
+ */
996
+ export declare class InterceptorManager<V> {
997
+ private handlers;
998
+ /**
999
+ * Register a handler pair. Returns an id usable with {@link eject}.
1000
+ */
1001
+ use(onFulfilled?: (value: V) => V | Promise<V>, onRejected?: InterceptorRejected): number;
1002
+ /** Remove the handler registered under `id`. */
1003
+ eject(id: number): void;
1004
+ /** Remove every registered handler. */
1005
+ clear(): void;
1006
+ /** Iterate over the non-ejected handlers in registration order. */
1007
+ forEach(fn: (handler: InterceptorHandler<V>) => void): void;
1008
+ }
1009
+
1010
+ export declare type InterceptorRejected = (error: any) => any;
1011
+
854
1012
  export declare enum isActiveColor {
855
1013
  inActive = "#4482ff",
856
1014
  active = "#3f4b5c"
857
1015
  }
858
1016
 
1017
+ /** True when `value` is the error produced by an aborted/cancelled request. */
1018
+ export declare function isCancel(value: any): boolean;
1019
+
1020
+ /** Type guard: true when `value` is a `FetchError`. */
1021
+ export declare function isFetchError(value: any): value is FetchError;
1022
+
859
1023
  export declare interface KeyValueParams {
860
1024
  [key: string]: string | string[] | number | number[] | undefined | Record<string, unknown>;
861
1025
  }
package/dist/index.js CHANGED
@@ -1,15 +1,15 @@
1
- import { AppAndServicesStatusApperenceType as o, AppearanceAlertCard as a, AppearanceButton as t, AppearanceDirection as f, AppearanceSpinner as p, AppearanceTag as l, DividerAppearance as s, FormFieldAppearance as d, ModalAppearanceType as m, NotificationAppearanceType as u, ThemeAppearance as x } from "./enums/appearance.js";
1
+ import { AppAndServicesStatusApperenceType as o, AppearanceAlertCard as a, AppearanceButton as t, AppearanceDirection as f, AppearanceSpinner as p, AppearanceTag as l, DividerAppearance as s, FormFieldAppearance as m, ModalAppearanceType as d, NotificationAppearanceType as u, ThemeAppearance as x } from "./enums/appearance.js";
2
2
  import { ApplicationTypeSlug as i } from "./enums/applicationTypeSlug.js";
3
- import { isActiveColor as A } from "./enums/isActiveColor.js";
3
+ import { isActiveColor as c } from "./enums/isActiveColor.js";
4
4
  import { Size as E } from "./enums/size.js";
5
- import { AppTypeEnum as I, CopyTextStatusEnum as C, PodStatusEnum as M, ReportStatus as R, SortEnum as S, StatusEnum as D, StatusType as g, TagStatus as F } from "./enums/status.js";
5
+ import { AppTypeEnum as C, CopyTextStatusEnum as I, PodStatusEnum as R, ReportStatus as M, SortEnum as S, StatusEnum as D, StatusType as F, TagStatus as g } from "./enums/status.js";
6
6
  import { default as N } from "./components/Button/Button.js";
7
- import { N as y } from "./index-H7XbDVmH.js";
8
- import { PermFallBack as P, getAuth as v } from "./components/AuthUserCan/index.js";
9
- import { Accordion as w, AccordionItem as B } from "./components/Accordion/Accordion.js";
10
- import { default as H } from "./components/ActionButton/ActionButton.js";
7
+ import { N as O } from "./index-H7XbDVmH.js";
8
+ import { PermFallBack as P, getAuth as b } from "./components/AuthUserCan/index.js";
9
+ import { Accordion as w, AccordionItem as U } from "./components/Accordion/Accordion.js";
10
+ import { default as k } from "./components/ActionButton/ActionButton.js";
11
11
  import { default as V } from "./components/AlertCard/AlertCard.js";
12
- import { default as j } from "./components/AuthUserCan/Permission.js";
12
+ import { default as W } from "./components/AuthUserCan/Permission.js";
13
13
  import { default as K } from "./components/Autocomplete/Autocomplete.js";
14
14
  import { default as Y } from "./components/Avatar/Avatar.js";
15
15
  import { default as G } from "./components/Card/Card.js";
@@ -19,23 +19,23 @@ import { default as re } from "./components/Config/Config.js";
19
19
  import { default as ae } from "./components/Confirm/Confirm.js";
20
20
  import { default as fe } from "./components/ContentHeader/ContentHeader.js";
21
21
  import { default as le } from "./components/ContentLoader/ContentLoader.js";
22
- import { default as de } from "./components/Countdown/Countdown.js";
22
+ import { default as me } from "./components/Countdown/Countdown.js";
23
23
  import { default as ue } from "./components/Datepicker/Datepicker.js";
24
24
  import { default as ne } from "./components/Divider/Divider.js";
25
25
  import { default as Te } from "./components/Drawer/index.js";
26
- import { default as ce } from "./components/Dropdown/DropdownList.js";
27
- import { E as _e, R as Ie, T as Ce, a as Me } from "./ErrorLogModal-CQFdcFKP.js";
26
+ import { default as Ae } from "./components/Dropdown/DropdownList.js";
27
+ import { E as _e, R as Ce, T as Ie, a as Re } from "./ErrorLogModal-CQFdcFKP.js";
28
28
  import { default as Se } from "./components/FileUpload/FileUpload.js";
29
- import { default as ge } from "./components/FileUpload/ImagePreview.js";
29
+ import { default as Fe } from "./components/FileUpload/ImagePreview.js";
30
30
  import { default as Le } from "./components/FileUpload/LengthCard.js";
31
- import { default as Oe } from "./components/FileUpload/PreviewModal.js";
32
- import { default as he } from "./components/Grid/Column.js";
33
- import { default as ve } from "./components/Grid/Row.js";
31
+ import { default as he } from "./components/FileUpload/PreviewModal.js";
32
+ import { default as ye } from "./components/Grid/Column.js";
33
+ import { default as be } from "./components/Grid/Row.js";
34
34
  import { default as we } from "./components/Heading/Heading.js";
35
- import { default as ke } from "./components/Icon/index.js";
36
- import { default as Ue } from "./components/IconBox/IconBox.js";
37
- import { default as We } from "./components/InfiniteScroll/InfiniteScroll.js";
38
- import { default as ze } from "./components/InfoBoxList/InfoBoxList.js";
35
+ import { default as Be } from "./components/Icon/index.js";
36
+ import { default as He } from "./components/IconBox/IconBox.js";
37
+ import { default as ze } from "./components/InfiniteScroll/InfiniteScroll.js";
38
+ import { default as je } from "./components/InfoBoxList/InfoBoxList.js";
39
39
  import { createConnectedService as Qe } from "./components/InfoBoxList/helper.js";
40
40
  import { default as qe } from "./components/InfoDate/InfoDate.js";
41
41
  import { InfoText as Je } from "./components/InfoText/InfoText.js";
@@ -45,23 +45,23 @@ import { default as or } from "./components/Loading/Loading.js";
45
45
  import { default as tr } from "./components/Modal/Modal.js";
46
46
  import { default as pr } from "./components/NavigatorCard/index.js";
47
47
  import { default as sr } from "./components/NoResult/NoResult.js";
48
- import { Notification as mr } from "./components/Notification/Notification.js";
48
+ import { Notification as dr } from "./components/Notification/Notification.js";
49
49
  import { default as xr } from "./components/PageWrapper/PageWrap.js";
50
50
  import { default as ir } from "./components/Pager/Pager.js";
51
- import { default as Ar } from "./components/Panel/Panel.js";
51
+ import { default as cr } from "./components/Panel/Panel.js";
52
52
  import { default as Er } from "./components/PermaLink/PermaLink.js";
53
- import { default as Ir, RadioList as Cr } from "./components/Radio/Radio.js";
54
- import { default as Rr } from "./components/ResultError/ResultError.js";
53
+ import { default as Cr, RadioList as Ir } from "./components/Radio/Radio.js";
54
+ import { default as Mr } from "./components/ResultError/ResultError.js";
55
55
  import { default as Dr } from "./components/ScrollContainer/ScrollContainer.js";
56
- import { default as Fr } from "./components/Select/NoData.js";
56
+ import { default as gr } from "./components/Select/NoData.js";
57
57
  import { S as Nr } from "./Select-nhp2PiJK.js";
58
- import { default as yr } from "./components/Sidebar/index.js";
58
+ import { default as Or } from "./components/Sidebar/index.js";
59
59
  import { M as Pr } from "./MenuItem-Df6Zsa7E.js";
60
- import { default as br } from "./components/StatusTag/StatusTag.js";
61
- import { default as Br } from "./components/StatusTypography/StatusTypography.js";
62
- import { default as Hr } from "./components/Stepper/Stepper.js";
60
+ import { default as vr } from "./components/StatusTag/StatusTag.js";
61
+ import { default as Ur } from "./components/StatusTypography/StatusTypography.js";
62
+ import { default as kr } from "./components/Stepper/Stepper.js";
63
63
  import { default as Vr } from "./components/Switch/Switch.js";
64
- import { default as jr } from "./components/Tab/Tab.js";
64
+ import { default as Wr } from "./components/Tab/Tab.js";
65
65
  import { default as Kr } from "./components/Table/Table.js";
66
66
  import { default as Yr } from "./components/Table/TableHeader.js";
67
67
  import { default as Gr } from "./components/Table/TableSort.js";
@@ -74,22 +74,26 @@ import { AuthProvider as lo, useAuth as so } from "./hooks/useAauth.js";
74
74
  import { default as uo } from "./hooks/useDisclosure.js";
75
75
  import { default as no } from "./hooks/useNiceModal.js";
76
76
  import { default as To } from "./hooks/useMediaQuery.js";
77
- import { useDrawerContext as co } from "./components/Drawer/Provider.js";
77
+ import { useDrawerContext as Ao } from "./components/Drawer/Provider.js";
78
78
  import { default as _o } from "./hooks/useDrawer.js";
79
- import { default as Co, t as Mo } from "./locales/i18n.js";
80
- import { CLIENT_DATE_AND_TIME_FORMAT as So, CLIENT_DATE_AND_TIME_SHORT_FORMAT as Do, CLIENT_DATE_COMPARE_FORMAT as go, CLIENT_DATE_FILTER_FORMAT as Fo, CLIENT_DATE_SHORT_FORMAT as Lo, CLIENT_TIME_FORMAT as No, CLIENT_TIME_FORMAT_PICKER as Oo, DateFormats as yo, MIN_DATE_TODAY as ho, MIN_DATE_TOMORROW as Po, SERVER_DATE_AND_TIME_FORMAT as vo, SERVER_DATE_FORMAT as bo, default as wo, friendlyDate as Bo } from "./utils/date.js";
81
- import { startFetcher as Ho, startFormFetcher as Uo } from "./utils/fetcher.js";
82
- import { changeLanguage as Wo, getCurrentLanguage as jo, getDatepickerLocale as zo } from "./utils/language.js";
83
- import { IconTestIds as Qo } from "./utils/test.js";
84
- import { default as qo } from "./prodivers.js";
85
- import { f as Jo, p as Xo } from "./helper-1SQ9SI45.js";
79
+ import { default as Io, t as Ro } from "./locales/i18n.js";
80
+ import { CLIENT_DATE_AND_TIME_FORMAT as So, CLIENT_DATE_AND_TIME_SHORT_FORMAT as Do, CLIENT_DATE_COMPARE_FORMAT as Fo, CLIENT_DATE_FILTER_FORMAT as go, CLIENT_DATE_SHORT_FORMAT as Lo, CLIENT_TIME_FORMAT as No, CLIENT_TIME_FORMAT_PICKER as ho, DateFormats as Oo, MIN_DATE_TODAY as yo, MIN_DATE_TOMORROW as Po, SERVER_DATE_AND_TIME_FORMAT as bo, SERVER_DATE_FORMAT as vo, default as wo, friendlyDate as Uo } from "./utils/date.js";
81
+ import { startFetcher as ko, startFormFetcher as Ho } from "./utils/fetcher.js";
82
+ import { changeLanguage as zo, getCurrentLanguage as Wo, getDatepickerLocale as jo } from "./utils/language.js";
83
+ import { createFetchClient as Qo } from "./utils/http/createFetchClient.js";
84
+ import { FetchError as qo, FetchErrorCode as Go, isCancel as Jo, isFetchError as Xo } from "./utils/http/errors.js";
85
+ import { InterceptorManager as $o } from "./utils/http/interceptorManager.js";
86
+ import { buildFullURL as ra, combineURLs as oa, defaultParamsSerializer as aa } from "./utils/http/helpers.js";
87
+ import { IconTestIds as fa } from "./utils/test.js";
88
+ import { default as la } from "./prodivers.js";
89
+ import { f as ma, p as da } from "./helper-1SQ9SI45.js";
86
90
  export {
87
91
  w as Accordion,
88
- B as AccordionItem,
89
- H as ActionButton,
92
+ U as AccordionItem,
93
+ k as ActionButton,
90
94
  V as AlertCard,
91
95
  o as AppAndServicesStatusApperenceType,
92
- I as AppTypeEnum,
96
+ C as AppTypeEnum,
93
97
  a as AppearanceAlertCard,
94
98
  t as AppearanceButton,
95
99
  f as AppearanceDirection,
@@ -102,113 +106,122 @@ export {
102
106
  N as Button,
103
107
  So as CLIENT_DATE_AND_TIME_FORMAT,
104
108
  Do as CLIENT_DATE_AND_TIME_SHORT_FORMAT,
105
- go as CLIENT_DATE_COMPARE_FORMAT,
106
- Fo as CLIENT_DATE_FILTER_FORMAT,
109
+ Fo as CLIENT_DATE_COMPARE_FORMAT,
110
+ go as CLIENT_DATE_FILTER_FORMAT,
107
111
  Lo as CLIENT_DATE_SHORT_FORMAT,
108
112
  No as CLIENT_TIME_FORMAT,
109
- Oo as CLIENT_TIME_FORMAT_PICKER,
113
+ ho as CLIENT_TIME_FORMAT_PICKER,
110
114
  G as Card,
111
115
  X as Chart,
112
116
  $ as Checkbox,
113
- he as Column,
117
+ ye as Column,
114
118
  re as Config,
115
119
  ae as Confirm,
116
120
  fe as ContentHeader,
117
121
  le as ContentLoader,
118
- C as CopyTextStatusEnum,
119
- de as Countdown,
120
- yo as DateFormats,
122
+ I as CopyTextStatusEnum,
123
+ me as Countdown,
124
+ Oo as DateFormats,
121
125
  ue as Datepicker,
122
126
  ne as Divider,
123
127
  s as DividerAppearance,
124
128
  Te as Drawer,
125
- ce as DropdownList,
129
+ Ae as DropdownList,
126
130
  _e as ErrorLogModal,
131
+ qo as FetchError,
132
+ Go as FetchErrorCode,
127
133
  Se as FileUpload,
128
- ge as FileUploadImagePreview,
134
+ Fe as FileUploadImagePreview,
129
135
  Le as FileUploadLengthCard,
130
- Oe as FileUploadPreviewModal,
131
- d as FormFieldAppearance,
136
+ he as FileUploadPreviewModal,
137
+ m as FormFieldAppearance,
132
138
  we as Heading,
133
- ke as Icon,
134
- Ue as IconBox,
135
- Qo as IconTestIds,
136
- We as InfiniteScroll,
137
- ze as InfoBoxList,
139
+ Be as Icon,
140
+ He as IconBox,
141
+ fa as IconTestIds,
142
+ ze as InfiniteScroll,
143
+ je as InfoBoxList,
138
144
  qe as InfoDate,
139
145
  Je as InfoText,
140
146
  Ze as Input,
147
+ $o as InterceptorManager,
141
148
  er as Label,
142
149
  or as Loading,
143
- ho as MIN_DATE_TODAY,
150
+ yo as MIN_DATE_TODAY,
144
151
  Po as MIN_DATE_TOMORROW,
145
152
  Pr as MenuItem,
146
153
  tr as Modal,
147
- m as ModalAppearanceType,
154
+ d as ModalAppearanceType,
148
155
  pr as NavigatorCard,
149
- y as NiceModal,
150
- Fr as NoData,
156
+ O as NiceModal,
157
+ gr as NoData,
151
158
  sr as NoResult,
152
- mr as Notification,
159
+ dr as Notification,
153
160
  u as NotificationAppearanceType,
154
161
  xr as PageWrapper,
155
162
  ir as Pager,
156
- Ar as Panel,
163
+ cr as Panel,
157
164
  P as PermFallBack,
158
165
  Er as PermaLink,
159
- j as Permission,
160
- M as PodStatusEnum,
161
- qo as Provider,
162
- Ir as Radio,
163
- Cr as RadioList,
164
- Ie as RealTimeLogModal,
165
- R as ReportStatus,
166
- Rr as ResultError,
167
- ve as Row,
168
- vo as SERVER_DATE_AND_TIME_FORMAT,
169
- bo as SERVER_DATE_FORMAT,
166
+ W as Permission,
167
+ R as PodStatusEnum,
168
+ la as Provider,
169
+ Cr as Radio,
170
+ Ir as RadioList,
171
+ Ce as RealTimeLogModal,
172
+ M as ReportStatus,
173
+ Mr as ResultError,
174
+ be as Row,
175
+ bo as SERVER_DATE_AND_TIME_FORMAT,
176
+ vo as SERVER_DATE_FORMAT,
170
177
  Dr as ScrollContainer,
171
178
  Nr as Select,
172
- yr as Sidebar,
179
+ Or as Sidebar,
173
180
  E as Size,
174
181
  S as SortEnum,
175
182
  D as StatusEnum,
176
- br as StatusTag,
177
- g as StatusType,
178
- Br as StatusTypography,
179
- Hr as Stepper,
183
+ vr as StatusTag,
184
+ F as StatusType,
185
+ Ur as StatusTypography,
186
+ kr as Stepper,
180
187
  Vr as Switch,
181
- jr as Tab,
188
+ Wr as Tab,
182
189
  Kr as Table,
183
- Ce as TableActions,
184
- Me as TableColumns,
190
+ Ie as TableActions,
191
+ Re as TableColumns,
185
192
  Yr as TableHeader,
186
193
  Gr as TableSort,
187
- F as TagStatus,
194
+ g as TagStatus,
188
195
  Xr as Textarea,
189
196
  x as ThemeAppearance,
190
197
  $r as Tooltip,
191
198
  ro as TypographyText,
192
199
  ao as UserInfo,
193
200
  fo as ValidationError,
194
- Wo as changeLanguage,
201
+ ra as buildFullURL,
202
+ zo as changeLanguage,
203
+ oa as combineURLs,
195
204
  Qe as createConnectedService,
205
+ Qo as createFetchClient,
196
206
  wo as dayjs,
197
- Jo as format,
198
- Bo as friendlyDate,
199
- v as getAuth,
200
- jo as getCurrentLanguage,
201
- zo as getDatepickerLocale,
202
- Co as i18n,
203
- A as isActiveColor,
204
- Xo as parseISO,
205
- Ho as startFetcher,
206
- Uo as startFormFetcher,
207
- Mo as t,
207
+ aa as defaultParamsSerializer,
208
+ ma as format,
209
+ Uo as friendlyDate,
210
+ b as getAuth,
211
+ Wo as getCurrentLanguage,
212
+ jo as getDatepickerLocale,
213
+ Io as i18n,
214
+ c as isActiveColor,
215
+ Jo as isCancel,
216
+ Xo as isFetchError,
217
+ da as parseISO,
218
+ ko as startFetcher,
219
+ Ho as startFormFetcher,
220
+ Ro as t,
208
221
  so as useAuth,
209
222
  uo as useDisclosure,
210
223
  _o as useDrawer,
211
- co as useDrawerContext,
224
+ Ao as useDrawerContext,
212
225
  To as useMediaQuery,
213
226
  no as useNiceModal
214
227
  };
@@ -0,0 +1,76 @@
1
+ import { FetchError as m, FetchErrorCode as c } from "./errors.js";
2
+ import { mergeConfig as f, setupAbort as E, serializeBody as y, buildFullURL as T, parseResponseBody as q, headersToObject as R, defaultValidateStatus as C } from "./helpers.js";
3
+ import { InterceptorManager as w } from "./interceptorManager.js";
4
+ async function b(s) {
5
+ const { signal: i, cleanup: p, isTimeout: a } = E(s), r = (s.method || "get").toUpperCase(), e = { ...s.headers || {} }, t = { method: r, signal: i };
6
+ if (r !== "GET" && r !== "HEAD") {
7
+ const h = y(s.data, e);
8
+ typeof h < "u" && (t.body = h);
9
+ }
10
+ typeof s.credentials < "u" ? t.credentials = s.credentials : typeof s.withCredentials < "u" && (t.credentials = s.withCredentials ? "include" : "same-origin"), t.headers = e;
11
+ const o = T(s);
12
+ let l;
13
+ try {
14
+ l = await fetch(o, t);
15
+ } catch (h) {
16
+ throw p(), a() ? new m(
17
+ `timeout of ${s.timeout}ms exceeded`,
18
+ s,
19
+ c.TIMEOUT
20
+ ) : i && i.aborted || h && h.name === "AbortError" ? new m(
21
+ "Request canceled",
22
+ s,
23
+ c.CANCELED
24
+ ) : new m(
25
+ h && h.message || "Network Error",
26
+ s,
27
+ c.NETWORK
28
+ );
29
+ }
30
+ let n;
31
+ try {
32
+ n = await q(l, s.responseType);
33
+ } finally {
34
+ p();
35
+ }
36
+ const d = {
37
+ data: n,
38
+ status: l.status,
39
+ statusText: l.statusText,
40
+ headers: R(l.headers),
41
+ config: s,
42
+ request: { url: o, ...t }
43
+ }, u = s.validateStatus === null ? null : s.validateStatus || C;
44
+ if (u && !u(d.status))
45
+ throw new m(
46
+ `Request failed with status code ${d.status}`,
47
+ s,
48
+ d.status >= 500 ? c.BAD_RESPONSE : c.BAD_REQUEST,
49
+ d.request,
50
+ d
51
+ );
52
+ return d;
53
+ }
54
+ function S(s = {}) {
55
+ const i = { ...s }, p = {
56
+ request: new w(),
57
+ response: new w()
58
+ };
59
+ function a(e, t) {
60
+ const o = typeof e == "string" ? { ...t || {}, url: e } : { ...e || {} }, l = f(i, o), n = [b, void 0];
61
+ p.request.forEach((u) => {
62
+ n.unshift(u.fulfilled, u.rejected);
63
+ }), p.response.forEach((u) => {
64
+ n.push(u.fulfilled, u.rejected);
65
+ });
66
+ let d = Promise.resolve(l);
67
+ for (; n.length; )
68
+ d = d.then(n.shift(), n.shift());
69
+ return d;
70
+ }
71
+ const r = a;
72
+ return r.request = a, r.interceptors = p, r.defaults = i, r.get = (e, t) => a({ ...t || {}, method: "get", url: e }), r.delete = (e, t) => a({ ...t || {}, method: "delete", url: e }), r.head = (e, t) => a({ ...t || {}, method: "head", url: e }), r.options = (e, t) => a({ ...t || {}, method: "options", url: e }), r.post = (e, t, o) => a({ ...o || {}, method: "post", url: e, data: t }), r.put = (e, t, o) => a({ ...o || {}, method: "put", url: e, data: t }), r.patch = (e, t, o) => a({ ...o || {}, method: "patch", url: e, data: t }), r.create = (e) => S(f(i, e || {})), r;
73
+ }
74
+ export {
75
+ S as createFetchClient
76
+ };
@@ -0,0 +1,41 @@
1
+ var h = Object.defineProperty;
2
+ var R = (e, s, t) => s in e ? h(e, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[s] = t;
3
+ var r = (e, s, t) => (R(e, typeof s != "symbol" ? s + "" : s, t), t);
4
+ const u = {
5
+ BAD_REQUEST: "ERR_BAD_REQUEST",
6
+ BAD_RESPONSE: "ERR_BAD_RESPONSE",
7
+ NETWORK: "ERR_NETWORK",
8
+ TIMEOUT: "ERR_TIMEOUT",
9
+ CANCELED: "ERR_CANCELED"
10
+ };
11
+ class o extends Error {
12
+ constructor(t, E, i, n, c) {
13
+ super(t);
14
+ r(this, "config");
15
+ r(this, "code");
16
+ r(this, "request");
17
+ r(this, "response");
18
+ r(this, "isFetchError");
19
+ this.name = "FetchError", this.config = E, this.code = i, this.request = n, this.response = c, this.isFetchError = !0, Object.setPrototypeOf(this, o.prototype);
20
+ }
21
+ toJSON() {
22
+ return {
23
+ name: this.name,
24
+ message: this.message,
25
+ code: this.code,
26
+ status: this.response ? this.response.status : void 0
27
+ };
28
+ }
29
+ }
30
+ function p(e) {
31
+ return !!(e && e.isFetchError);
32
+ }
33
+ function O(e) {
34
+ return !!(e && e.code === u.CANCELED);
35
+ }
36
+ export {
37
+ o as FetchError,
38
+ u as FetchErrorCode,
39
+ O as isCancel,
40
+ p as isFetchError
41
+ };