@bluemarble/bm-components 2.4.2 → 2.4.4

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.cts CHANGED
@@ -1,3 +1,4 @@
1
+ import * as cookie from 'cookie';
1
2
  import * as React from 'react';
2
3
  import React__default, { PropsWithChildren, ReactNode, FC, Provider } from 'react';
3
4
  import * as _mui_material from '@mui/material';
@@ -5,9 +6,55 @@ import { TableCellProps, TableCell, TextFieldProps, StandardTextFieldProps, Sele
5
6
  import * as _mui_material_OverridableComponent from '@mui/material/OverridableComponent';
6
7
  import { FactoryOpts } from 'imask';
7
8
  import { IconType } from 'react-icons';
8
- import { ZodSchema } from 'zod';
9
9
  import { AxiosInstance } from 'axios';
10
- import * as cookie from 'cookie';
10
+ import { ZodSchema } from 'zod';
11
+
12
+ interface NookiesRequest {
13
+ headers?: {
14
+ cookie?: string;
15
+ };
16
+ }
17
+ interface NookiesResponse {
18
+ finished?: boolean;
19
+ getHeader(name: string): string | string[] | number | undefined;
20
+ setHeader(name: string, value: string | readonly string[]): any;
21
+ }
22
+
23
+ /**
24
+ * Parses cookies.
25
+ *
26
+ * @param ctx Object with a `req` property, null or undefined.
27
+ * @param options Options that we pass down to `cookie` library.
28
+ */
29
+ declare function parseCookies(ctx?: {
30
+ req: NookiesRequest;
31
+ } | null | undefined, options?: cookie.ParseOptions): cookie.Cookies;
32
+ /**
33
+ * Sets a cookie.
34
+ *
35
+ * @param ctx Object with a `res` property, null or undefined.
36
+ * @param name The name of your cookie.
37
+ * @param value The value of your cookie.
38
+ * @param options Options that we pass down to `cookie` library.
39
+ */
40
+ declare function setCookie(ctx: {
41
+ res: NookiesResponse;
42
+ } | null | undefined, name: string, value: string, options?: cookie.SerializeOptions): {};
43
+ /**
44
+ * Destroys a cookie with a particular name.
45
+ *
46
+ * @param ctx Object with a `res` property, null or undefined.
47
+ * @param name Cookie name.
48
+ * @param options Options that we pass down to `cookie` library.
49
+ */
50
+ declare function destroyCookie(ctx: {
51
+ res: NookiesResponse;
52
+ } | null | undefined, name: string, options?: cookie.SerializeOptions): {};
53
+ declare const nookies: {
54
+ set: typeof setCookie;
55
+ get: typeof parseCookies;
56
+ destroy: typeof destroyCookie;
57
+ };
11
58
 
12
59
  /** @deprecated Use {@link ColumnsProps} from `BaseGrid` instead. */
13
60
  interface ColumnTitleProps {
@@ -442,6 +489,42 @@ declare const BaseDialog: {
442
489
  Body: (props: IBaseDialogBodyProps) => React__default.JSX.Element;
443
490
  };
444
491
 
492
+ type FormHelperContextProps = {
493
+ formatErrorMessage: (message: any) => string;
494
+ api: AxiosInstance;
495
+ };
496
+ declare const FormHelperContext: React__default.Context<FormHelperContextProps>;
497
+ type FormHelperProviderProps = {
498
+ formatErrorMessage: (message: any) => string;
499
+ children: ReactNode;
500
+ api: AxiosInstance;
501
+ };
502
+ declare const FormHelperProvider: ({ formatErrorMessage, api, children }: FormHelperProviderProps) => React__default.JSX.Element;
503
+
504
+ type AlertContextProps = {
505
+ createAlert(message: string, type: AlertColor): void;
506
+ };
507
+ declare const AlertContext: React__default.Context<AlertContextProps>;
508
+ type AlertProviderProps = {
509
+ children: ReactNode;
510
+ };
511
+ declare const AlertProvider: ({ children }: AlertProviderProps) => React__default.JSX.Element;
512
+
513
+ type AuthenticateStatus = 'autenticated' | 'unauthenticated' | 'loading';
514
+ interface AuthContextProps<T> {
515
+ user?: T;
516
+ status: AuthenticateStatus;
517
+ signIn(credentials: Record<string, any>): Promise<boolean>;
518
+ signOut: () => Promise<void>;
519
+ }
520
+ declare function createAuthContext<T>(): React__default.Context<AuthContextProps<T>>;
521
+ declare function CreateAuthProvider<T>({ api, children, sessionTokenName, Provider }: {
522
+ Provider: Provider<AuthContextProps<T>>;
523
+ children: ReactNode;
524
+ api: AxiosInstance;
525
+ sessionTokenName: string;
526
+ }): React__default.JSX.Element;
527
+
445
528
  declare class HttpError extends Error {
446
529
  status: number;
447
530
  constructor(status: number, message: any);
@@ -468,6 +551,7 @@ interface HelperResponse {
468
551
  finished?: boolean;
469
552
  status(code: number): HelperResponse;
470
553
  json(data: any): any;
554
+ send(data: any): any;
471
555
  end(data?: any): any;
472
556
  getHeader(name: string): string | string[] | number | undefined;
473
557
  setHeader(name: string, value: string | readonly string[]): any;
@@ -664,87 +748,4 @@ declare function useFormHelper(): {
664
748
  createAlert(message: string, type: _mui_material.AlertColor): void;
665
749
  };
666
750
 
667
- type FormHelperContextProps = {
668
- formatErrorMessage: (message: any) => string;
669
- api: AxiosInstance;
670
- };
671
- declare const FormHelperContext: React__default.Context<FormHelperContextProps>;
672
- type FormHelperProviderProps = {
673
- formatErrorMessage: (message: any) => string;
674
- children: ReactNode;
675
- api: AxiosInstance;
676
- };
677
- declare const FormHelperProvider: ({ formatErrorMessage, api, children }: FormHelperProviderProps) => React__default.JSX.Element;
678
-
679
- type AlertContextProps = {
680
- createAlert(message: string, type: AlertColor): void;
681
- };
682
- declare const AlertContext: React__default.Context<AlertContextProps>;
683
- type AlertProviderProps = {
684
- children: ReactNode;
685
- };
686
- declare const AlertProvider: ({ children }: AlertProviderProps) => React__default.JSX.Element;
687
-
688
- type AuthenticateStatus = 'autenticated' | 'unauthenticated' | 'loading';
689
- interface AuthContextProps<T> {
690
- user?: T;
691
- status: AuthenticateStatus;
692
- signIn(credentials: Record<string, any>): Promise<boolean>;
693
- signOut: () => Promise<void>;
694
- }
695
- declare function createAuthContext<T>(): React__default.Context<AuthContextProps<T>>;
696
- declare function CreateAuthProvider<T>({ api, children, sessionTokenName, Provider }: {
697
- Provider: Provider<AuthContextProps<T>>;
698
- children: ReactNode;
699
- api: AxiosInstance;
700
- sessionTokenName: string;
701
- }): React__default.JSX.Element;
702
-
703
- interface NookiesRequest {
704
- headers?: {
705
- cookie?: string;
706
- };
707
- }
708
- interface NookiesResponse {
709
- finished?: boolean;
710
- getHeader(name: string): string | string[] | number | undefined;
711
- setHeader(name: string, value: string | readonly string[]): any;
712
- }
713
-
714
- /**
715
- * Parses cookies.
716
- *
717
- * @param ctx Object with a `req` property, null or undefined.
718
- * @param options Options that we pass down to `cookie` library.
719
- */
720
- declare function parseCookies(ctx?: {
721
- req: NookiesRequest;
722
- } | null | undefined, options?: cookie.ParseOptions): cookie.Cookies;
723
- /**
724
- * Sets a cookie.
725
- *
726
- * @param ctx Object with a `res` property, null or undefined.
727
- * @param name The name of your cookie.
728
- * @param value The value of your cookie.
729
- * @param options Options that we pass down to `cookie` library.
730
- */
731
- declare function setCookie(ctx: {
732
- res: NookiesResponse;
733
- } | null | undefined, name: string, value: string, options?: cookie.SerializeOptions): {};
734
- /**
735
- * Destroys a cookie with a particular name.
736
- *
737
- * @param ctx Object with a `res` property, null or undefined.
738
- * @param name Cookie name.
739
- * @param options Options that we pass down to `cookie` library.
740
- */
741
- declare function destroyCookie(ctx: {
742
- res: NookiesResponse;
743
- } | null | undefined, name: string, options?: cookie.SerializeOptions): {};
744
- declare const nookies: {
745
- set: typeof setCookie;
746
- get: typeof parseCookies;
747
- destroy: typeof destroyCookie;
748
- };
749
-
750
- export { AlertContext, AlertProvider, ApiHelper, type AuthContextProps, AuthHelper, Autocomplete, BaseDialog, BaseDialogBody, BaseDialogContainer, BaseDialogCreate, BaseDialogTrigger, BaseGrid, BaseGridAutoRows, Checkbox, type ColumnTitleProps, type ColumnsProps, CreateAuthProvider, Dialog, DialogConfirm, DomainError, EditableTableCell, type FilterCompareType, type FilterProps, FormHelperContext, FormHelperProvider, GetInputLabel, Grid, type HandlerProps, HttpError, type IBaseDialogBodyProps, type IBaseDialogContainerProps, type IBaseDialogTriggerProps, type IDialogConfirmProps, type IFilter, Input, InputMask, LargeButton, type MethodProps, Modal, type NookiesRequest, type NookiesResponse, Radio, Select, type SortedByProps$1 as SortedByProps, Switch, type TApiOptions, type TUseDialogConfirm, TabPanel, type TabPanelProps, Td, Tr, UseDialogConfirm, createAuthContext, createFilter, destroyCookie, filterData, getTabProps, nookies, parseCookies, setCookie, useAlert, useAsyncGrid, useBaseDialog, useBaseDialogInstance, useEvent, useFilter, useFormHelper, useGrid, useLoading };
751
+ export { AlertContext, AlertProvider, ApiHelper, type AuthContextProps, AuthHelper, Autocomplete, BaseDialog, BaseDialogBody, BaseDialogContainer, BaseDialogCreate, BaseDialogTrigger, BaseGrid, BaseGridAutoRows, Checkbox, type ColumnTitleProps, type ColumnsProps, CreateAuthProvider, Dialog, DialogConfirm, DomainError, EditableTableCell, type FilterCompareType, type FilterProps, FormHelperContext, FormHelperProvider, GetInputLabel, Grid, type HandlerProps, type HelperRequest, type HelperResponse, HttpError, type IBaseDialogBodyProps, type IBaseDialogContainerProps, type IBaseDialogTriggerProps, type IDialogConfirmProps, type IFilter, Input, InputMask, LargeButton, type MethodProps, type MiddlewaresProps, Modal, type NextHandlerApiRequest, type NookiesRequest, type NookiesResponse, Radio, Select, type ServerSidePropsContext, type SortedByProps$1 as SortedByProps, Switch, type TApiOptions, type TUseDialogConfirm, TabPanel, type TabPanelProps, Td, Tr, UseDialogConfirm, createAuthContext, createFilter, destroyCookie, filterData, getTabProps, nookies, parseCookies, setCookie, useAlert, useAsyncGrid, useBaseDialog, useBaseDialogInstance, useEvent, useFilter, useFormHelper, useGrid, useLoading };
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import * as cookie from 'cookie';
1
2
  import * as React from 'react';
2
3
  import React__default, { PropsWithChildren, ReactNode, FC, Provider } from 'react';
3
4
  import * as _mui_material from '@mui/material';
@@ -5,9 +6,55 @@ import { TableCellProps, TableCell, TextFieldProps, StandardTextFieldProps, Sele
5
6
  import * as _mui_material_OverridableComponent from '@mui/material/OverridableComponent';
6
7
  import { FactoryOpts } from 'imask';
7
8
  import { IconType } from 'react-icons';
8
- import { ZodSchema } from 'zod';
9
9
  import { AxiosInstance } from 'axios';
10
- import * as cookie from 'cookie';
10
+ import { ZodSchema } from 'zod';
11
+
12
+ interface NookiesRequest {
13
+ headers?: {
14
+ cookie?: string;
15
+ };
16
+ }
17
+ interface NookiesResponse {
18
+ finished?: boolean;
19
+ getHeader(name: string): string | string[] | number | undefined;
20
+ setHeader(name: string, value: string | readonly string[]): any;
21
+ }
22
+
23
+ /**
24
+ * Parses cookies.
25
+ *
26
+ * @param ctx Object with a `req` property, null or undefined.
27
+ * @param options Options that we pass down to `cookie` library.
28
+ */
29
+ declare function parseCookies(ctx?: {
30
+ req: NookiesRequest;
31
+ } | null | undefined, options?: cookie.ParseOptions): cookie.Cookies;
32
+ /**
33
+ * Sets a cookie.
34
+ *
35
+ * @param ctx Object with a `res` property, null or undefined.
36
+ * @param name The name of your cookie.
37
+ * @param value The value of your cookie.
38
+ * @param options Options that we pass down to `cookie` library.
39
+ */
40
+ declare function setCookie(ctx: {
41
+ res: NookiesResponse;
42
+ } | null | undefined, name: string, value: string, options?: cookie.SerializeOptions): {};
43
+ /**
44
+ * Destroys a cookie with a particular name.
45
+ *
46
+ * @param ctx Object with a `res` property, null or undefined.
47
+ * @param name Cookie name.
48
+ * @param options Options that we pass down to `cookie` library.
49
+ */
50
+ declare function destroyCookie(ctx: {
51
+ res: NookiesResponse;
52
+ } | null | undefined, name: string, options?: cookie.SerializeOptions): {};
53
+ declare const nookies: {
54
+ set: typeof setCookie;
55
+ get: typeof parseCookies;
56
+ destroy: typeof destroyCookie;
57
+ };
11
58
 
12
59
  /** @deprecated Use {@link ColumnsProps} from `BaseGrid` instead. */
13
60
  interface ColumnTitleProps {
@@ -442,6 +489,42 @@ declare const BaseDialog: {
442
489
  Body: (props: IBaseDialogBodyProps) => React__default.JSX.Element;
443
490
  };
444
491
 
492
+ type FormHelperContextProps = {
493
+ formatErrorMessage: (message: any) => string;
494
+ api: AxiosInstance;
495
+ };
496
+ declare const FormHelperContext: React__default.Context<FormHelperContextProps>;
497
+ type FormHelperProviderProps = {
498
+ formatErrorMessage: (message: any) => string;
499
+ children: ReactNode;
500
+ api: AxiosInstance;
501
+ };
502
+ declare const FormHelperProvider: ({ formatErrorMessage, api, children }: FormHelperProviderProps) => React__default.JSX.Element;
503
+
504
+ type AlertContextProps = {
505
+ createAlert(message: string, type: AlertColor): void;
506
+ };
507
+ declare const AlertContext: React__default.Context<AlertContextProps>;
508
+ type AlertProviderProps = {
509
+ children: ReactNode;
510
+ };
511
+ declare const AlertProvider: ({ children }: AlertProviderProps) => React__default.JSX.Element;
512
+
513
+ type AuthenticateStatus = 'autenticated' | 'unauthenticated' | 'loading';
514
+ interface AuthContextProps<T> {
515
+ user?: T;
516
+ status: AuthenticateStatus;
517
+ signIn(credentials: Record<string, any>): Promise<boolean>;
518
+ signOut: () => Promise<void>;
519
+ }
520
+ declare function createAuthContext<T>(): React__default.Context<AuthContextProps<T>>;
521
+ declare function CreateAuthProvider<T>({ api, children, sessionTokenName, Provider }: {
522
+ Provider: Provider<AuthContextProps<T>>;
523
+ children: ReactNode;
524
+ api: AxiosInstance;
525
+ sessionTokenName: string;
526
+ }): React__default.JSX.Element;
527
+
445
528
  declare class HttpError extends Error {
446
529
  status: number;
447
530
  constructor(status: number, message: any);
@@ -468,6 +551,7 @@ interface HelperResponse {
468
551
  finished?: boolean;
469
552
  status(code: number): HelperResponse;
470
553
  json(data: any): any;
554
+ send(data: any): any;
471
555
  end(data?: any): any;
472
556
  getHeader(name: string): string | string[] | number | undefined;
473
557
  setHeader(name: string, value: string | readonly string[]): any;
@@ -664,87 +748,4 @@ declare function useFormHelper(): {
664
748
  createAlert(message: string, type: _mui_material.AlertColor): void;
665
749
  };
666
750
 
667
- type FormHelperContextProps = {
668
- formatErrorMessage: (message: any) => string;
669
- api: AxiosInstance;
670
- };
671
- declare const FormHelperContext: React__default.Context<FormHelperContextProps>;
672
- type FormHelperProviderProps = {
673
- formatErrorMessage: (message: any) => string;
674
- children: ReactNode;
675
- api: AxiosInstance;
676
- };
677
- declare const FormHelperProvider: ({ formatErrorMessage, api, children }: FormHelperProviderProps) => React__default.JSX.Element;
678
-
679
- type AlertContextProps = {
680
- createAlert(message: string, type: AlertColor): void;
681
- };
682
- declare const AlertContext: React__default.Context<AlertContextProps>;
683
- type AlertProviderProps = {
684
- children: ReactNode;
685
- };
686
- declare const AlertProvider: ({ children }: AlertProviderProps) => React__default.JSX.Element;
687
-
688
- type AuthenticateStatus = 'autenticated' | 'unauthenticated' | 'loading';
689
- interface AuthContextProps<T> {
690
- user?: T;
691
- status: AuthenticateStatus;
692
- signIn(credentials: Record<string, any>): Promise<boolean>;
693
- signOut: () => Promise<void>;
694
- }
695
- declare function createAuthContext<T>(): React__default.Context<AuthContextProps<T>>;
696
- declare function CreateAuthProvider<T>({ api, children, sessionTokenName, Provider }: {
697
- Provider: Provider<AuthContextProps<T>>;
698
- children: ReactNode;
699
- api: AxiosInstance;
700
- sessionTokenName: string;
701
- }): React__default.JSX.Element;
702
-
703
- interface NookiesRequest {
704
- headers?: {
705
- cookie?: string;
706
- };
707
- }
708
- interface NookiesResponse {
709
- finished?: boolean;
710
- getHeader(name: string): string | string[] | number | undefined;
711
- setHeader(name: string, value: string | readonly string[]): any;
712
- }
713
-
714
- /**
715
- * Parses cookies.
716
- *
717
- * @param ctx Object with a `req` property, null or undefined.
718
- * @param options Options that we pass down to `cookie` library.
719
- */
720
- declare function parseCookies(ctx?: {
721
- req: NookiesRequest;
722
- } | null | undefined, options?: cookie.ParseOptions): cookie.Cookies;
723
- /**
724
- * Sets a cookie.
725
- *
726
- * @param ctx Object with a `res` property, null or undefined.
727
- * @param name The name of your cookie.
728
- * @param value The value of your cookie.
729
- * @param options Options that we pass down to `cookie` library.
730
- */
731
- declare function setCookie(ctx: {
732
- res: NookiesResponse;
733
- } | null | undefined, name: string, value: string, options?: cookie.SerializeOptions): {};
734
- /**
735
- * Destroys a cookie with a particular name.
736
- *
737
- * @param ctx Object with a `res` property, null or undefined.
738
- * @param name Cookie name.
739
- * @param options Options that we pass down to `cookie` library.
740
- */
741
- declare function destroyCookie(ctx: {
742
- res: NookiesResponse;
743
- } | null | undefined, name: string, options?: cookie.SerializeOptions): {};
744
- declare const nookies: {
745
- set: typeof setCookie;
746
- get: typeof parseCookies;
747
- destroy: typeof destroyCookie;
748
- };
749
-
750
- export { AlertContext, AlertProvider, ApiHelper, type AuthContextProps, AuthHelper, Autocomplete, BaseDialog, BaseDialogBody, BaseDialogContainer, BaseDialogCreate, BaseDialogTrigger, BaseGrid, BaseGridAutoRows, Checkbox, type ColumnTitleProps, type ColumnsProps, CreateAuthProvider, Dialog, DialogConfirm, DomainError, EditableTableCell, type FilterCompareType, type FilterProps, FormHelperContext, FormHelperProvider, GetInputLabel, Grid, type HandlerProps, HttpError, type IBaseDialogBodyProps, type IBaseDialogContainerProps, type IBaseDialogTriggerProps, type IDialogConfirmProps, type IFilter, Input, InputMask, LargeButton, type MethodProps, Modal, type NookiesRequest, type NookiesResponse, Radio, Select, type SortedByProps$1 as SortedByProps, Switch, type TApiOptions, type TUseDialogConfirm, TabPanel, type TabPanelProps, Td, Tr, UseDialogConfirm, createAuthContext, createFilter, destroyCookie, filterData, getTabProps, nookies, parseCookies, setCookie, useAlert, useAsyncGrid, useBaseDialog, useBaseDialogInstance, useEvent, useFilter, useFormHelper, useGrid, useLoading };
751
+ export { AlertContext, AlertProvider, ApiHelper, type AuthContextProps, AuthHelper, Autocomplete, BaseDialog, BaseDialogBody, BaseDialogContainer, BaseDialogCreate, BaseDialogTrigger, BaseGrid, BaseGridAutoRows, Checkbox, type ColumnTitleProps, type ColumnsProps, CreateAuthProvider, Dialog, DialogConfirm, DomainError, EditableTableCell, type FilterCompareType, type FilterProps, FormHelperContext, FormHelperProvider, GetInputLabel, Grid, type HandlerProps, type HelperRequest, type HelperResponse, HttpError, type IBaseDialogBodyProps, type IBaseDialogContainerProps, type IBaseDialogTriggerProps, type IDialogConfirmProps, type IFilter, Input, InputMask, LargeButton, type MethodProps, type MiddlewaresProps, Modal, type NextHandlerApiRequest, type NookiesRequest, type NookiesResponse, Radio, Select, type ServerSidePropsContext, type SortedByProps$1 as SortedByProps, Switch, type TApiOptions, type TUseDialogConfirm, TabPanel, type TabPanelProps, Td, Tr, UseDialogConfirm, createAuthContext, createFilter, destroyCookie, filterData, getTabProps, nookies, parseCookies, setCookie, useAlert, useAsyncGrid, useBaseDialog, useBaseDialogInstance, useEvent, useFilter, useFormHelper, useGrid, useLoading };