profinansy-ui-lib 3.6.30 → 3.6.31

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 (38) hide show
  1. package/dist/api/api.d.ts +1 -1
  2. package/dist/api/cart/cart.d.ts +11 -0
  3. package/dist/api/cart/cart.typed.d.ts +74 -0
  4. package/dist/api/favourites/favourites.d.ts +4 -4
  5. package/dist/api/instruments/instruments.d.ts +4 -4
  6. package/dist/api/notifications/notifications.api.d.ts +0 -6
  7. package/dist/api/quiz/quiz.d.ts +2 -2
  8. package/dist/api/search/search.d.ts +1 -1
  9. package/dist/common.types.d.ts +1 -0
  10. package/dist/components/blocks/footer/Footer.stories.d.ts +6 -1
  11. package/dist/components/blocks/footer/components/Navigation/Navigation.d.ts +1 -2
  12. package/dist/components/blocks/footer/constants.d.ts +1 -1
  13. package/dist/components/blocks/footer/footer.d.ts +0 -3
  14. package/dist/components/blocks/header/Header.stories.d.ts +1 -0
  15. package/dist/components/blocks/header/components/Cart/Cart.d.ts +2 -0
  16. package/dist/components/blocks/header/components/Cart/Cart.styled.d.ts +3 -0
  17. package/dist/components/blocks/header/components/Cart/components/CartItem/CartItem.d.ts +8 -0
  18. package/dist/components/blocks/header/components/Cart/components/CartItem/CartStyled.styled.d.ts +6 -0
  19. package/dist/components/blocks/header/components/Cart/components/Dropdown/DropdownCart.d.ts +10 -0
  20. package/dist/components/blocks/header/components/Cart/components/Dropdown/DropdownCart.styled.d.ts +9 -0
  21. package/dist/components/blocks/sideMenu/SideMenu.d.ts +1 -1
  22. package/dist/components/blocks/sideMenu/SideMenu.stories.d.ts +1 -1
  23. package/dist/components/blocks/sideMenu/SideModal.typed.d.ts +0 -2
  24. package/dist/components/uikit/Button/Button.typed.d.ts +2 -0
  25. package/dist/components/uikit/Dropdown/Dropdown.d.ts +1 -1
  26. package/dist/components/uikit/FilterButton/Drop/Drop.d.ts +1 -1
  27. package/dist/components/uikit/Hint/Hint.d.ts +1 -1
  28. package/dist/components/uikit/Popup/Popup.d.ts +1 -1
  29. package/dist/components/uikit/Table/utils.d.ts +1 -1
  30. package/dist/components/uikit/Tooltip/Tooltip.d.ts +1 -1
  31. package/dist/config.d.ts +3 -5
  32. package/dist/constants/common.d.ts +2 -0
  33. package/dist/index.d.ts +1 -0
  34. package/dist/index.js +154 -38
  35. package/dist/localization/translations/arias.d.ts +6 -0
  36. package/dist/urls/constant.d.ts +5 -4
  37. package/package.json +1 -1
  38. package/dist/utils.d.ts +0 -8
package/dist/api/api.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  export interface IApiSettings {
2
2
  token: string;
3
- baseUrl: string;
3
+ baseUrl?: string;
4
4
  }
@@ -0,0 +1,11 @@
1
+ import { IApiSettings } from '../api';
2
+ import { ICart } from './cart.typed';
3
+ export declare const getCart: (settings: IApiSettings) => Promise<{
4
+ data: ICart | null;
5
+ ok: boolean;
6
+ }>;
7
+ export declare const deleteCartItem: (settings: IApiSettings, payload: {
8
+ ids_tovar: number;
9
+ }) => Promise<{
10
+ ok: boolean;
11
+ }>;
@@ -0,0 +1,74 @@
1
+ export interface ICart {
2
+ tovar: ICartItem[];
3
+ tovar_pre: ICartItem[];
4
+ tovar_order?: ICartItem[];
5
+ }
6
+ export interface ICartItem {
7
+ tovar_id: number;
8
+ name: string;
9
+ info: string;
10
+ is_active: boolean;
11
+ product_id: number;
12
+ flow_ids: number[];
13
+ tariff_ids: TariffId[];
14
+ tovar_code: ItemCode;
15
+ date_trade_start: string;
16
+ date_trade_stop: string;
17
+ buy_count: number;
18
+ price_crossed: number;
19
+ price: number;
20
+ is_hit: boolean;
21
+ can_buy: boolean;
22
+ data: Course;
23
+ cover_file: string;
24
+ rate: number;
25
+ rate_count: number;
26
+ pre_order_id?: number;
27
+ legal_person_id: number;
28
+ is_showcase: boolean;
29
+ telegram_bot_url: string | null;
30
+ unique_id: string;
31
+ is_new: boolean;
32
+ is_sold_out: boolean;
33
+ comment_count: number;
34
+ list_cover: IListCover[];
35
+ }
36
+ export type ItemCode = 'course' | 'subscription' | 'material' | 'package';
37
+ export interface IListCover {
38
+ file_id?: number;
39
+ type?: TypesCover;
40
+ url_img?: string;
41
+ url_video?: string;
42
+ }
43
+ export interface TariffId {
44
+ tariff_id: number;
45
+ name: string;
46
+ info: string;
47
+ bitrix_id: number;
48
+ price_crossed: number;
49
+ price: number;
50
+ billing_id: number;
51
+ telegram_bot_url: string | null;
52
+ }
53
+ export declare enum TypesCover {
54
+ IMG = "img",
55
+ IMG_TOP = "img_top",
56
+ VIDEO = "video",
57
+ VIDEO_K = "video_k"
58
+ }
59
+ interface Course {
60
+ id: number;
61
+ unique_id: string;
62
+ info: string;
63
+ paid_link: string;
64
+ is_access_available: boolean;
65
+ has_subscription: boolean;
66
+ time_pass: number;
67
+ is_club: boolean;
68
+ is_club_p: boolean;
69
+ is_favorite: boolean;
70
+ has_printed_materials: boolean;
71
+ is_ended: boolean;
72
+ is_available: boolean;
73
+ }
74
+ export {};
@@ -1,22 +1,22 @@
1
1
  import { IApiSettings } from '../api';
2
2
  import { FavoriteInstrumentsGroup } from './favourites.typed';
3
- export declare const getFavourites: (apiSettings: IApiSettings) => Promise<{
3
+ export declare const getFavourites: (settings: IApiSettings) => Promise<{
4
4
  data: FavoriteInstrumentsGroup[] | null;
5
5
  ok: boolean;
6
6
  }>;
7
- export declare const addFavouritesInstrument: (apiSettings: IApiSettings, payload: {
7
+ export declare const addFavouritesInstrument: (settings: IApiSettings, payload: {
8
8
  instrument_id: number;
9
9
  user_fav_list_id: boolean;
10
10
  }) => Promise<{
11
11
  ok: boolean;
12
12
  }>;
13
- export declare const removeFavouritesInstrument: (apiSettings: IApiSettings, payload: {
13
+ export declare const removeFavouritesInstrument: (settings: IApiSettings, payload: {
14
14
  instrument_id: number;
15
15
  user_fav_list_id: boolean;
16
16
  }) => Promise<{
17
17
  ok: boolean;
18
18
  }>;
19
- export declare const createNewList: (apiSettings: IApiSettings, payload: {
19
+ export declare const createNewList: (settings: IApiSettings, payload: {
20
20
  name: string;
21
21
  sort_num: number;
22
22
  }) => Promise<{
@@ -1,15 +1,15 @@
1
1
  import { ILastSearch } from './instruments.typed';
2
2
  import { IApiSettings } from '../api';
3
- export declare const getLastUserSearch: (apiSettings: IApiSettings) => Promise<{
3
+ export declare const getLastUserSearch: (settings: IApiSettings) => Promise<{
4
4
  data: ILastSearch[] | null;
5
5
  ok: boolean;
6
6
  }>;
7
- export declare const deleteLastUserSearch: (apiSettings: IApiSettings) => Promise<any>;
8
- export declare const getTopUserSearch: (apiSettings: IApiSettings) => Promise<{
7
+ export declare const deleteLastUserSearch: (settings: IApiSettings) => Promise<any>;
8
+ export declare const getTopUserSearch: (settings: IApiSettings) => Promise<{
9
9
  data: ILastSearch[] | null;
10
10
  ok: boolean;
11
11
  }>;
12
- export declare const addTopSearch: (apiSettings: IApiSettings, payload: {
12
+ export declare const addTopSearch: (settings: IApiSettings, payload: {
13
13
  instrument_id: number;
14
14
  }) => Promise<{
15
15
  data: ILastSearch[] | null;
@@ -1,11 +1,5 @@
1
1
  import { IApiSettings } from '../api';
2
- import { INotification } from './notifications.typed';
3
2
  export declare const notificationsApi: {
4
- getNotificationsHistory: (apiSettings: IApiSettings) => Promise<{
5
- data: INotification[];
6
- next_notification_id: number;
7
- new_count: number;
8
- }>;
9
3
  getNotificationsCount: (apiSettings: IApiSettings) => Promise<{
10
4
  count: number;
11
5
  }>;
@@ -1,10 +1,10 @@
1
1
  import { IApiSettings } from '../api';
2
2
  import { IQuiz } from './quiz.tyled';
3
- export declare const getQuiz: (apiSettings: IApiSettings, code?: string) => Promise<{
3
+ export declare const getQuiz: (settings: IApiSettings, code?: string) => Promise<{
4
4
  data: IQuiz;
5
5
  ok: boolean;
6
6
  }>;
7
- export declare const setAnswerQuiz: (apiSettings: IApiSettings, payload: {
7
+ export declare const setAnswerQuiz: (settings: IApiSettings, payload: {
8
8
  code: string;
9
9
  answer: string;
10
10
  }) => Promise<{
@@ -1,7 +1,7 @@
1
1
  import { IApiSettings } from '../api';
2
2
  import { ISearch } from './search.typed';
3
3
  import { SearchCategories } from '../../components/blocks/search/Search.const';
4
- export declare const getSearch: (value: string, category: SearchCategories, apiSettings: IApiSettings) => Promise<{
4
+ export declare const getSearch: (value: string, category: SearchCategories, settings: IApiSettings) => Promise<{
5
5
  data: ISearch;
6
6
  ok: boolean;
7
7
  }>;
@@ -29,6 +29,7 @@ export interface IUser {
29
29
  is_partner: boolean;
30
30
  is_confirm_partner: boolean;
31
31
  authorized?: boolean;
32
+ token: string | null;
32
33
  }
33
34
  export type UserRole = 'guest' | 'authorized' | 'paid';
34
35
  export type HeaderLinkType = {
@@ -7,5 +7,10 @@ export default _default;
7
7
  export declare const FooterUnAuth: () => JSX.Element;
8
8
  export declare const FooterAuth: () => JSX.Element;
9
9
  export declare const FooterPaid: () => JSX.Element;
10
- export declare const FooterLMS: () => JSX.Element;
10
+ export declare const FooterLMS: {
11
+ (): JSX.Element;
12
+ parameters: {
13
+ project: string;
14
+ };
15
+ };
11
16
  export declare const FooterProfinansy: () => JSX.Element;
@@ -3,8 +3,7 @@ interface IProps {
3
3
  userRole: UserRole;
4
4
  leaderboardPermission: boolean;
5
5
  hostname: string;
6
- isTest: boolean;
7
6
  onRouteChange?: (url: string) => void;
8
7
  }
9
- declare const Navigation: ({ hostname, userRole, leaderboardPermission, onRouteChange, isTest }: IProps) => JSX.Element;
8
+ declare const Navigation: ({ hostname, userRole, leaderboardPermission, onRouteChange }: IProps) => JSX.Element;
10
9
  export { Navigation };
@@ -1,5 +1,5 @@
1
1
  import { UserRole } from '../../../common.types';
2
- export declare const getFooterNavRows: (userRole: UserRole, hostname: string, leaderboardPermission: boolean, isTest: boolean) => {
2
+ export declare const getFooterNavRows: (userRole: UserRole, hostname: string, leaderboardPermission: boolean) => {
3
3
  name: string;
4
4
  Icon: any;
5
5
  href: string;
@@ -2,10 +2,7 @@ import { FC } from 'react';
2
2
  import { UserRole } from '../../../common.types';
3
3
  export type FooterProps = {
4
4
  userRole: UserRole;
5
- isProfinansy?: boolean;
6
5
  onRouteChange?: (url: string) => void;
7
6
  leaderboardPermission?: boolean;
8
- isLMS?: boolean;
9
- isTest?: boolean;
10
7
  };
11
8
  export declare const Footer: FC<FooterProps>;
@@ -41,6 +41,7 @@ export declare const HeaderPaid: {
41
41
  ref_balance: number;
42
42
  is_confirm_partner: boolean;
43
43
  authorized?: boolean;
44
+ token: string;
44
45
  };
45
46
  };
46
47
  };
@@ -0,0 +1,2 @@
1
+ declare const Cart: () => JSX.Element;
2
+ export { Cart };
@@ -0,0 +1,3 @@
1
+ export declare const Container: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
2
+ export declare const CartButton: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {}, never>;
3
+ export declare const Amount: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
@@ -0,0 +1,8 @@
1
+ import { ICartItem } from '../../../../../../../api/cart/cart.typed';
2
+ interface IProps {
3
+ item: ICartItem;
4
+ isOpen: boolean;
5
+ removeItem: (id: number, product: ICartItem) => void;
6
+ }
7
+ declare const CartItem: ({ item, removeItem, isOpen }: IProps) => JSX.Element;
8
+ export { CartItem };
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ export declare const Container: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
3
+ export declare const Image: import("styled-components").StyledComponent<"img", import("styled-components").DefaultTheme, {}, never>;
4
+ export declare const NameProduct: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("../../../../../../uikit/Typography/Typography.typed").ITypographyProps & import("react").CSSProperties & import("react").RefAttributes<HTMLElement>>, import("styled-components").DefaultTheme, {}, never>;
5
+ export declare const PriceWrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
6
+ export declare const RemoveButton: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {}, never>;
@@ -0,0 +1,10 @@
1
+ import { ICartItem } from '../../../../../../../api/cart/cart.typed';
2
+ interface IProps {
3
+ isOpen: boolean;
4
+ count: number;
5
+ totalPrice: number;
6
+ items: ICartItem[];
7
+ removeItem: (id: number, product: ICartItem) => void;
8
+ }
9
+ declare const DropdownCart: ({ isOpen, count, items, totalPrice, removeItem }: IProps) => JSX.Element;
10
+ export { DropdownCart };
@@ -0,0 +1,9 @@
1
+ export declare const DropWrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
2
+ isOpen: boolean;
3
+ }, never>;
4
+ export declare const DropContent: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
5
+ $mode: string;
6
+ }, never>;
7
+ export declare const List: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
8
+ export declare const Bottom: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
9
+ export declare const TotalCount: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
@@ -5,5 +5,5 @@ export declare const SideMenuContext: React.Context<{
5
5
  setShowQuiz: any;
6
6
  LinkWrapper: any;
7
7
  }>;
8
- declare const SideMenu: ({ banners, category, isTest, isProfinansy, isLeaderboardPermission, userRole, apiSettings, footerSlot, LinkWrapper, isBurgerMode, excludePages, isHoverMode }: ISideModal) => JSX.Element;
8
+ declare const SideMenu: ({ banners, category, isLeaderboardPermission, userRole, apiSettings, footerSlot, LinkWrapper, isBurgerMode, excludePages, isHoverMode }: ISideModal) => JSX.Element;
9
9
  export { SideMenu };
@@ -1,6 +1,6 @@
1
1
  declare const _default: {
2
2
  title: string;
3
- component: ({ banners, category, isTest, isProfinansy, isLeaderboardPermission, userRole, apiSettings, footerSlot, LinkWrapper, isBurgerMode, excludePages, isHoverMode }: import("./SideModal.typed").ISideModal) => JSX.Element;
3
+ component: ({ banners, category, isLeaderboardPermission, userRole, apiSettings, footerSlot, LinkWrapper, isBurgerMode, excludePages, isHoverMode }: import("./SideModal.typed").ISideModal) => JSX.Element;
4
4
  };
5
5
  export default _default;
6
6
  export declare const SideMenu: () => JSX.Element;
@@ -9,8 +9,6 @@ export interface ISideModal {
9
9
  onClick?: () => void;
10
10
  }[];
11
11
  userRole: UserRole;
12
- isProfinansy: boolean;
13
- isTest: boolean;
14
12
  isLeaderboardPermission: boolean;
15
13
  category: TSideMenuCategory;
16
14
  apiSettings: IApiSettings;
@@ -6,6 +6,8 @@ export type ButtonForm = 'square' | 'circle';
6
6
  export interface IButton {
7
7
  /**Тип кнопки */
8
8
  mode?: TButtonMode;
9
+ /** Порядок перемещения */
10
+ tabIndex?: number;
9
11
  /**Размер кнопки */
10
12
  size?: ButtonSize;
11
13
  /** Форма кнопки. */
@@ -43,7 +43,7 @@ export declare function useDrop({ placement, onOpenList }: {
43
43
  };
44
44
  getReferenceProps: (userProps?: React.HTMLProps<Element>) => Record<string, unknown>;
45
45
  getFloatingProps: (userProps?: React.HTMLProps<HTMLElement>) => Record<string, unknown>;
46
- getItemProps: (userProps?: Omit<React.HTMLProps<HTMLElement>, "active" | "selected"> & {
46
+ getItemProps: (userProps?: Omit<React.HTMLProps<HTMLElement>, "selected" | "active"> & {
47
47
  active?: boolean;
48
48
  selected?: boolean;
49
49
  }) => Record<string, unknown>;
@@ -42,7 +42,7 @@ export declare function useDrop({ placement }: {
42
42
  };
43
43
  getReferenceProps: (userProps?: React.HTMLProps<Element>) => Record<string, unknown>;
44
44
  getFloatingProps: (userProps?: React.HTMLProps<HTMLElement>) => Record<string, unknown>;
45
- getItemProps: (userProps?: Omit<React.HTMLProps<HTMLElement>, "active" | "selected"> & {
45
+ getItemProps: (userProps?: Omit<React.HTMLProps<HTMLElement>, "selected" | "active"> & {
46
46
  active?: boolean;
47
47
  selected?: boolean;
48
48
  }) => Record<string, unknown>;
@@ -44,7 +44,7 @@ export declare function useHint({ placement, isClickMobile }?: HintOptions): {
44
44
  };
45
45
  getReferenceProps: (userProps?: React.HTMLProps<Element>) => Record<string, unknown>;
46
46
  getFloatingProps: (userProps?: React.HTMLProps<HTMLElement>) => Record<string, unknown>;
47
- getItemProps: (userProps?: Omit<React.HTMLProps<HTMLElement>, "active" | "selected"> & {
47
+ getItemProps: (userProps?: Omit<React.HTMLProps<HTMLElement>, "selected" | "active"> & {
48
48
  active?: boolean;
49
49
  selected?: boolean;
50
50
  }) => Record<string, unknown>;
@@ -47,7 +47,7 @@ export declare function usePopup({ placement, isHover }: {
47
47
  };
48
48
  getReferenceProps: (userProps?: React.HTMLProps<Element>) => Record<string, unknown>;
49
49
  getFloatingProps: (userProps?: React.HTMLProps<HTMLElement>) => Record<string, unknown>;
50
- getItemProps: (userProps?: Omit<React.HTMLProps<HTMLElement>, "active" | "selected"> & {
50
+ getItemProps: (userProps?: Omit<React.HTMLProps<HTMLElement>, "selected" | "active"> & {
51
51
  active?: boolean;
52
52
  selected?: boolean;
53
53
  }) => Record<string, unknown>;
@@ -1,5 +1,5 @@
1
1
  import { IColumnTable } from './Table.typed';
2
2
  export declare const getAlignment: (alignment: IColumnTable['alignment']) => {
3
3
  justifyContent: string;
4
- textAlign: "center" | "left" | "right";
4
+ textAlign: "center" | "right" | "left";
5
5
  };
@@ -44,7 +44,7 @@ export declare function useTooltip({ placement, isHover, showArrow }: {
44
44
  };
45
45
  getReferenceProps: (userProps?: React.HTMLProps<Element>) => Record<string, unknown>;
46
46
  getFloatingProps: (userProps?: React.HTMLProps<HTMLElement>) => Record<string, unknown>;
47
- getItemProps: (userProps?: Omit<React.HTMLProps<HTMLElement>, "active" | "selected"> & {
47
+ getItemProps: (userProps?: Omit<React.HTMLProps<HTMLElement>, "selected" | "active"> & {
48
48
  active?: boolean;
49
49
  selected?: boolean;
50
50
  }) => Record<string, unknown>;
package/dist/config.d.ts CHANGED
@@ -1,18 +1,16 @@
1
1
  import { ReactNode, ElementType } from 'react';
2
2
  import { IUser, UserRole } from './common.types';
3
- import { IApiSettings } from './api/api';
4
3
  import { StateTypeOpenMenu } from './hooks/sideMenu/useSaveOpenMode';
4
+ export type TProject = 'profinansy' | 'wallet' | 'lms' | 'lenta';
5
5
  interface IConfigProps {
6
6
  /** Тестовая или продовая версия собрана **/
7
7
  isTest: boolean;
8
- /** Профинансовский проект или нет **/
9
- isProfinansy: boolean;
8
+ /** Какой это проект **/
9
+ project: TProject;
10
10
  /** Текущий урл страницы в формате /market/instrument/PSA-S-NYSE?test=test **/
11
11
  pathname: string;
12
12
  /** объект пользователя **/
13
13
  user: IUser | null;
14
- /** Настройки для работы апи **/
15
- apiSettings: IApiSettings;
16
14
  /** Элемент ссылки. Нужен, чтобы прокидывать некстовый роутинг или роутинг библиотек **/
17
15
  LinkWrapper: ElementType;
18
16
  defaultSideMenuOpen?: StateTypeOpenMenu;
@@ -3,6 +3,8 @@ export declare const HEIGHT_HEADER = 64;
3
3
  export declare const TABLET_WIDTH = 960;
4
4
  export declare const MOBILE_WIDTH = 600;
5
5
  export declare const REQUEST_METHOD: Record<TMethod, TMethod>;
6
+ export declare const apiUrl: string;
7
+ export declare const lmsApiUrl: string;
6
8
  export declare const firebaseConfig: {
7
9
  apiKey: string;
8
10
  authDomain: string;
package/dist/index.d.ts CHANGED
@@ -73,6 +73,7 @@ export { ISelectOption } from './components/uikit/Select';
73
73
  export { SelectInput } from './components/uikit/Select';
74
74
  export { ConfigLibraryProvider } from './config';
75
75
  export { useConfigLibrary } from './config';
76
+ export { TProject } from './config';
76
77
  export { Locales } from './common.types';
77
78
  export { ThemeProvider } from './theme/ThemeProvider';
78
79
  export { useMode } from './theme/ThemeProvider';