@ukpc-lib/react 0.1.20 → 0.1.21

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.
Files changed (59) hide show
  1. package/dist/components/GlobalMenu/components/Dropdown.d.ts +8 -0
  2. package/dist/components/GlobalMenu/components/MenuItem.d.ts +15 -0
  3. package/dist/components/GlobalMenu/helpers/index.d.ts +0 -0
  4. package/dist/components/GlobalMenu/icons/IconCollapsed.d.ts +2 -0
  5. package/dist/components/GlobalMenu/icons/IconDown.d.ts +3 -0
  6. package/dist/components/GlobalMenu/icons/IconExpand.d.ts +2 -0
  7. package/dist/components/GlobalMenu/icons/IconLogout.d.ts +2 -0
  8. package/dist/components/GlobalMenu/index.d.ts +7 -0
  9. package/dist/components/GlobalMenu/models/MenuItemDto.d.ts +8 -0
  10. package/dist/components/GlobalMenu/models/index.d.ts +1 -0
  11. package/dist/components/LanguageSwitcher/index.d.ts +1 -0
  12. package/dist/components/LogoutConfirmModal/index.d.ts +7 -0
  13. package/dist/components/NoData/index.d.ts +2 -0
  14. package/dist/components/NotFoundPage/index.d.ts +4 -0
  15. package/dist/components/PopUp/index.d.ts +8 -0
  16. package/dist/components/PopUp/types.d.ts +26 -0
  17. package/dist/components/ShadownDom/index.d.ts +8 -0
  18. package/dist/components/StyledAutocomplete/AutocompleteOption.d.ts +11 -0
  19. package/dist/components/StyledAutocomplete/StyledAutocomplete.d.ts +29 -0
  20. package/dist/components/StyledAutocomplete/helpers.d.ts +1 -0
  21. package/dist/components/StyledAutocomplete/index.d.ts +3 -0
  22. package/dist/components/StyledAutocomplete/types.d.ts +46 -0
  23. package/dist/components/StyledAutocomplete/useStyledAutocomplete.d.ts +28 -0
  24. package/dist/components/StyledDateRangePicker/BlockIcon.d.ts +4 -0
  25. package/dist/components/StyledDateRangePicker/index.d.ts +13 -0
  26. package/dist/components/Toast/ToastConfig.d.ts +2 -0
  27. package/dist/components/Toast/icons/ErrorIcon.d.ts +1 -0
  28. package/dist/components/Toast/icons/SuccessIcon.d.ts +1 -0
  29. package/dist/components/Toast/icons/WarningIcon.d.ts +1 -0
  30. package/dist/components/Toast/index.d.ts +5 -0
  31. package/dist/components/Topbar/icons/MessageIcon.d.ts +4 -0
  32. package/dist/components/Topbar/icons/NotificationIcon.d.ts +3 -0
  33. package/dist/components/Topbar/index.d.ts +29 -0
  34. package/dist/components/UnauthorizedPage/index.d.ts +1 -0
  35. package/dist/components/index.cjs +65 -0
  36. package/dist/components/index.d.ts +9 -0
  37. package/dist/components/index.js +10047 -0
  38. package/dist/index.css +1 -0
  39. package/dist/index.es-52d1ebeb.cjs +173 -0
  40. package/dist/index.es-da1b88a3.js +19562 -0
  41. package/dist/share/AuthProvider/index.d.ts +20 -0
  42. package/dist/share/helpers/index.d.ts +1 -0
  43. package/dist/share/hooks/index.d.ts +1 -0
  44. package/dist/share/hooks/useGetPermission.d.ts +1 -0
  45. package/dist/share/index.cjs +1 -0
  46. package/dist/share/index.d.ts +5 -0
  47. package/dist/share/index.js +70 -0
  48. package/dist/share/interceptor/index.d.ts +7 -0
  49. package/dist/share/interceptor/interceptor.const.d.ts +6 -0
  50. package/dist/share/permissions/HasPermission.d.ts +9 -0
  51. package/dist/share/permissions/PermissionRoute.d.ts +9 -0
  52. package/dist/share/permissions/index.d.ts +2 -0
  53. package/package.json +1 -1
  54. package/web-components-bundle/global-menu/index.cjs +91 -0
  55. package/web-components-bundle/global-menu/index.js +18098 -0
  56. package/web-components-bundle/global-topbar/index.cjs +3 -0
  57. package/web-components-bundle/global-topbar/index.js +228 -0
  58. package/web-components-bundle/index-3a3447c8.cjs +69 -0
  59. package/web-components-bundle/index-688657b9.js +9352 -0
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ type DropdownProps = {
3
+ children: React.ReactNode;
4
+ parentRef: React.RefObject<HTMLDivElement>;
5
+ onlyChild?: boolean;
6
+ };
7
+ export default function Dropdown(props: DropdownProps): import("react").ReactNode;
8
+ export {};
@@ -0,0 +1,15 @@
1
+ import { MenuItemDto } from '../models';
2
+ export type OwnMenuItemProps = {
3
+ replacePath?(path: string): string;
4
+ ssr?: boolean;
5
+ };
6
+ type MenuItemProps = {
7
+ item: MenuItemDto;
8
+ level?: number;
9
+ isActive(id: number): boolean;
10
+ isCollapsed: boolean;
11
+ expanded(id: number): boolean;
12
+ toggleExpand: (id: number) => void;
13
+ } & OwnMenuItemProps;
14
+ export default function MenuItem({ item, level, ...props }: MenuItemProps): import("react/jsx-runtime").JSX.Element;
15
+ export {};
File without changes
@@ -0,0 +1,2 @@
1
+ declare function IconCollapsed(): import("react/jsx-runtime").JSX.Element;
2
+ export default IconCollapsed;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ declare function IconDown(props: React.SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
3
+ export default IconDown;
@@ -0,0 +1,2 @@
1
+ declare function IconExpand(): import("react/jsx-runtime").JSX.Element;
2
+ export default IconExpand;
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export default function IconLogout(props: React.SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,7 @@
1
+ import { OwnMenuItemProps } from './components/MenuItem';
2
+ export type GlobalMenuProps = {
3
+ baseUrl: string;
4
+ menuPath?: string;
5
+ logout?(): void;
6
+ } & OwnMenuItemProps;
7
+ export declare function GlobalMenu(props: GlobalMenuProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ export interface MenuItemDto {
2
+ id: number;
3
+ name: string;
4
+ path?: string;
5
+ icon?: string;
6
+ parentKey: number | null;
7
+ children?: MenuItemDto[];
8
+ }
@@ -0,0 +1 @@
1
+ export * from './MenuItemDto';
@@ -0,0 +1 @@
1
+ export default function LanguageSwitcher(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,7 @@
1
+ type LogoutConfirmModalProps = {
2
+ isOpen: boolean;
3
+ onClose: () => void;
4
+ onConfirm: () => void;
5
+ };
6
+ declare function LogoutConfirmModal({ isOpen, onClose, onConfirm, }: LogoutConfirmModalProps): import("react/jsx-runtime").JSX.Element | null;
7
+ export default LogoutConfirmModal;
@@ -0,0 +1,2 @@
1
+ import { FC, PropsWithChildren } from 'react';
2
+ export declare const NoData: FC<PropsWithChildren>;
@@ -0,0 +1,4 @@
1
+ declare const NotFoundPage: ({ rootPath }: {
2
+ rootPath: string;
3
+ }) => import("react/jsx-runtime").JSX.Element;
4
+ export default NotFoundPage;
@@ -0,0 +1,8 @@
1
+ import { PopUpBaseProps, usePopUpProps } from './types';
2
+ export declare function PopUpBase(props: PopUpBaseProps): import("react/jsx-runtime").JSX.Element;
3
+ export declare function usePopUp(props?: boolean | usePopUpProps): {
4
+ setTrue: () => void;
5
+ open: boolean;
6
+ onClose: () => void;
7
+ onConfirm: (() => void) | undefined;
8
+ };
@@ -0,0 +1,26 @@
1
+ import { SxProps, TypographyProps, Theme, DialogProps, DialogActionsProps } from "@mui/material";
2
+ import { ReactNode } from "react";
3
+ export type PopUpBaseProps = IPopUp & {
4
+ title?: ReactNode;
5
+ subTitle?: ReactNode;
6
+ desc: ReactNode;
7
+ fixOverflow?: boolean;
8
+ minWidthButton?: number;
9
+ subTitleProps?: TypographyProps;
10
+ contentProps?: SxProps<Theme>;
11
+ titleProps?: SxProps<Theme>;
12
+ hideTitle?: boolean;
13
+ };
14
+ export type IPopUp = {
15
+ open: boolean;
16
+ onClose?(): void;
17
+ onConfirm?: () => void;
18
+ dialogProps?: Omit<DialogProps, 'open' | 'onClose'>;
19
+ dialogActionsProps?: DialogActionsProps;
20
+ customActions?: ReactNode;
21
+ hideConfirm?: boolean;
22
+ hideClose?: boolean;
23
+ };
24
+ export type usePopUpProps = {
25
+ onConfirm?(): void;
26
+ };
@@ -0,0 +1,8 @@
1
+ import React, { PropsWithChildren } from 'react';
2
+ type OwnProps = {
3
+ styles?: string[];
4
+ };
5
+ type ElementProps = React.HTMLProps<HTMLElement>;
6
+ type Props = PropsWithChildren<OwnProps & ElementProps>;
7
+ export declare function ShadowDomWrapper({ children, styles, ...props }: Props): import("react/jsx-runtime").JSX.Element;
8
+ export {};
@@ -0,0 +1,11 @@
1
+ import { StackProps } from '@mui/material';
2
+ import { ReactNode } from 'react';
3
+ type Props<T> = {
4
+ option: T;
5
+ renderOption(option: T): ReactNode;
6
+ onClick?(option: T): any;
7
+ stackProps?: StackProps;
8
+ select?: boolean;
9
+ };
10
+ export declare function AutocompleteOption<T>(props: Props<T>): import("react/jsx-runtime").JSX.Element;
11
+ export {};
@@ -0,0 +1,29 @@
1
+ import { ReactNode } from 'react';
2
+ import { Paging } from './types';
3
+ export type StyledAutocompleteProps<T> = {
4
+ disabledAllOption?: boolean;
5
+ readOnly?: boolean;
6
+ disabled?: boolean;
7
+ isSync?: boolean;
8
+ label?: React.ReactNode;
9
+ value?: T;
10
+ placeholder?: string;
11
+ onChange?(value?: T): any;
12
+ isEqual?(option?: T, value?: T): boolean;
13
+ getOptionLabel(option: T): string;
14
+ renderOptionTooltip?(option: T): ReactNode;
15
+ handleChangeSearch?(text: string): void;
16
+ searchLoading: boolean;
17
+ loading?: boolean;
18
+ paging: Paging<T>;
19
+ error?: boolean;
20
+ helperText?: ReactNode;
21
+ hasNextPage: boolean;
22
+ isNextPageLoading: boolean;
23
+ loadNextPage(searchText: string): void;
24
+ wrapperWidth?: string | number;
25
+ isRequired?: boolean;
26
+ itemsNumber?: number;
27
+ placeHolderColor?: string;
28
+ };
29
+ export declare function StyledAutocomplete<T>(props: StyledAutocompleteProps<T>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function activeStyles<T>(props: T, active?: boolean): T | undefined;
@@ -0,0 +1,3 @@
1
+ export * from './StyledAutocomplete';
2
+ export * from './AutocompleteOption';
3
+ export * from './useStyledAutocomplete';
@@ -0,0 +1,46 @@
1
+ type Normal<S extends string> = S;
2
+ type AsTypeSort<T> = {
3
+ [P in keyof T as `-${Normal<string & P>}`]: T[P];
4
+ };
5
+ type Filter<T> = {
6
+ [P in keyof T]?: T[P] | T[P][] | Partial<Record<keyof typeof Op, T[P] | T[P][]>>;
7
+ };
8
+ interface Query<T> {
9
+ search?: Search<T>;
10
+ filter?: Filter<T>;
11
+ }
12
+ type NestedKeys<T> = {
13
+ [K in keyof T]: K extends string | number ? T[K] extends object ? `${(K & string) | number}.${NestedKeys<T[K]>}` : (K & string) | number : never;
14
+ }[keyof T];
15
+ interface Search<T> {
16
+ content: string;
17
+ fields?: (keyof T | NestedKeys<T>)[];
18
+ }
19
+ type Sort<T> = keyof T | keyof AsTypeSort<T>;
20
+ declare const Op: {
21
+ $eq: symbol;
22
+ $ne: symbol;
23
+ $gte: symbol;
24
+ $gt: symbol;
25
+ $lte: symbol;
26
+ $lt: symbol;
27
+ $not: symbol;
28
+ $notIn: symbol;
29
+ $notLike: symbol;
30
+ $notILike: symbol;
31
+ $regexp: symbol;
32
+ $bt: symbol;
33
+ };
34
+ export interface ListProps<T> extends Query<T> {
35
+ page?: number;
36
+ pageSize?: number;
37
+ sorts?: Sort<T>[];
38
+ }
39
+ export declare class Paging<T> {
40
+ rows: T[];
41
+ total: number;
42
+ page: number;
43
+ pageSize: number;
44
+ totalPages: number;
45
+ }
46
+ export {};
@@ -0,0 +1,28 @@
1
+ import { DependencyList } from 'react';
2
+ import { ListProps, Paging } from './types';
3
+ import { StyledAutocompleteProps } from './StyledAutocomplete';
4
+ export declare function useStyledAutocomplete<T, P extends ListProps<T>>(props: UseAutocomplete<T, P>): TypeReturn<T, P>;
5
+ type SearchList<T> = {
6
+ searchFields: (keyof T)[];
7
+ searchOption?: never;
8
+ } | {
9
+ searchFields?: never;
10
+ searchOption: (option: T, searchText: string) => boolean;
11
+ };
12
+ export type UseAutocomplete<T, P extends ListProps<T>> = {
13
+ readOnly?: boolean;
14
+ loading?: boolean;
15
+ disabled?: boolean;
16
+ list?: {
17
+ options: T[];
18
+ } & SearchList<T>;
19
+ getList?(props: P): Promise<Paging<T>>;
20
+ listProps?: Partial<P>;
21
+ dependencyList?: DependencyList;
22
+ };
23
+ export type TypeReturn<T, P> = Pick<StyledAutocompleteProps<T>, 'loadNextPage' | 'handleChangeSearch' | 'paging' | 'hasNextPage' | 'isNextPageLoading' | 'searchLoading' | 'loading' | 'value' | 'onChange' | 'isSync' | 'readOnly'> & {
24
+ getList(props?: P): Promise<void>;
25
+ reset(): void;
26
+ toggleLoading: VoidFunction;
27
+ };
28
+ export {};
@@ -0,0 +1,4 @@
1
+ import { SVGProps } from 'react';
2
+ type BlockIconProps = SVGProps<SVGSVGElement>;
3
+ export declare function BlockIcon(props: BlockIconProps): import("react/jsx-runtime").JSX.Element;
4
+ export {};
@@ -0,0 +1,13 @@
1
+ interface DateRangeValue {
2
+ startDate?: Date;
3
+ endDate?: Date;
4
+ }
5
+ type Props = {
6
+ value?: DateRangeValue;
7
+ onChange?(value: DateRangeValue): void;
8
+ initialSettings?: any;
9
+ label?: string;
10
+ dateReset?: DateRangeValue;
11
+ };
12
+ export declare function StyledDateRangePicker(props: Props): import("react/jsx-runtime").JSX.Element;
13
+ export {};
@@ -0,0 +1,2 @@
1
+ import { ToastContainerProps } from 'react-toastify';
2
+ export declare const ToastConfig: (props: ToastContainerProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function ErrorIcon(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function SuccessIcon(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function WarningIcon(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ declare const pushSuccess: (message: string) => void;
2
+ declare const pushError: (message: string) => void;
3
+ declare const pushWarning: (message: string) => void;
4
+ export * from './ToastConfig';
5
+ export { pushError, pushSuccess, pushWarning };
@@ -0,0 +1,4 @@
1
+ declare function MessageIcon({ primaryColor }: {
2
+ primaryColor?: string;
3
+ }): import("react/jsx-runtime").JSX.Element;
4
+ export default MessageIcon;
@@ -0,0 +1,3 @@
1
+ export default function NotificationIcon({ primaryColor, }: {
2
+ primaryColor?: string;
3
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,29 @@
1
+ import { CSSProperties } from 'react';
2
+ type CustomColors = {
3
+ primaryColor?: string;
4
+ bgColor?: string;
5
+ color?: string;
6
+ };
7
+ type User = {
8
+ id?: number;
9
+ firstName: string;
10
+ lastName: string;
11
+ countryCode?: string;
12
+ status?: string;
13
+ email?: string;
14
+ phoneNumber?: string | null;
15
+ avatarUrl?: string;
16
+ languageCode?: string;
17
+ isActive?: boolean;
18
+ isEnable?: boolean;
19
+ lastLogin?: Date;
20
+ };
21
+ export declare function TopBar({ logo, user, baseUrl, style, classNames, customColors, }: {
22
+ logo: string;
23
+ user: User;
24
+ baseUrl: string;
25
+ style?: CSSProperties;
26
+ classNames?: string;
27
+ customColors?: CustomColors;
28
+ }): import("react/jsx-runtime").JSX.Element;
29
+ export {};
@@ -0,0 +1 @@
1
+ export declare const UnauthorizedPage: () => import("react/jsx-runtime").JSX.Element;