beca-ui 2.0.11-beta.2 → 2.0.11-beta.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.
@@ -1,4 +1,4 @@
1
- import { FC } from "react";
2
- import { ExtraHeaderProps, HeaderProps } from "./Header.types";
3
- declare const TopMenu: FC<HeaderProps & ExtraHeaderProps>;
4
- export default TopMenu;
1
+ /// <reference types="react" />
2
+ import { ExtraHeaderProps, HeaderProps, NotificationRef } from "./Header.types";
3
+ declare const _default: import("react").ForwardRefExoticComponent<HeaderProps & ExtraHeaderProps & import("react").RefAttributes<NotificationRef>>;
4
+ export default _default;
@@ -3,7 +3,9 @@ import { IPersonalProfileModel, ISupportContactModel } from "../../../models";
3
3
  import { ApplicationsCardProps } from "../../ApplicationsCard";
4
4
  import { MenuItemType } from "../../Menu";
5
5
  import { LANGUAGE } from "../../ConfigProvider";
6
- export type ExtraTabKey = "Chat";
6
+ import { MainLayoutConfig } from "../MainLayout.types";
7
+ export type NotiType = "All" | "Unseen";
8
+ export type NotiStatus = "Read" | "Unread";
7
9
  export type Theme = "Light" | "Dark";
8
10
  export interface ExtraHeaderProps {
9
11
  onChangeTheme: (theme: any) => void;
@@ -21,7 +23,7 @@ export interface HeaderProps extends ApplicationsCardProps {
21
23
  homePageUrl: string;
22
24
  customHeader?: React.ReactNode;
23
25
  supportContactData: ISupportContactModel[];
24
- notification?: NotificationType;
26
+ notification?: NotificationProps;
25
27
  LinkComponent: any;
26
28
  isSwitchTheme?: boolean;
27
29
  onSwitchedTheme?: (theme: Theme) => void;
@@ -30,6 +32,7 @@ export interface HeaderProps extends ApplicationsCardProps {
30
32
  lang: LANGUAGE;
31
33
  scrolled?: boolean;
32
34
  personalProfile: IPersonalProfileModel;
35
+ config?: MainLayoutConfig;
33
36
  }
34
37
  export type ThemeType = {
35
38
  getApi: string;
@@ -38,14 +41,19 @@ export type ThemeType = {
38
41
  };
39
42
  export interface NotificationType {
40
43
  title?: string;
44
+ notifications: NotificationItemType[];
45
+ unseenNotifications: NotificationItemType[];
46
+ onReadAll?: () => void;
47
+ onChangeStatus?: (ids: number[], status: NotiStatus) => void;
48
+ onClickNotificationItem?: (item: NotificationItemType) => void;
49
+ onLoadData: (type: NotiType, page: number, pageSize: number) => Promise<void>;
50
+ totalNumber: number;
51
+ unseenTotal: number;
52
+ }
53
+ export interface NotificationProps extends NotificationType {
41
54
  visible?: boolean;
42
55
  number?: number;
43
- data: NotificationItemType[];
44
56
  onClick?: () => void;
45
- onClickNotificationItem?: (item: NotificationItemType) => void;
46
- onReadAll?: () => void;
47
- onChangeStatus?: (status: "Read" | "Unread") => void;
48
- extraTabs?: ExtraTabKey[];
49
57
  }
50
58
  export interface NotiItemProps {
51
59
  }
@@ -59,3 +67,7 @@ export interface NotificationItemType {
59
67
  isSeen: boolean;
60
68
  url: string;
61
69
  }
70
+ export interface NotificationRef {
71
+ fetchNotifications: (type: NotiType, isReload?: boolean) => void;
72
+ }
73
+ export type HeaderRef = NotificationRef;
@@ -1,15 +1,12 @@
1
- import { FC } from "react";
2
- import { ExtraTabKey, NotificationItemType } from "./Header.types";
1
+ /// <reference types="react" />
2
+ import { NotificationRef, NotificationType } from "./Header.types";
3
3
  import { ApplicationsCardItem } from "../../ApplicationsCard/ApplicationsCard.types";
4
- interface NotificationProps {
5
- data: NotificationItemType[];
4
+ interface NotificationProps extends NotificationType {
6
5
  applicationsCardData: ApplicationsCardItem[];
7
- title?: string;
8
6
  LinkComponent: any;
9
- onClickNotificationItem?: (item: NotificationItemType) => void;
10
- onReadAll?: () => void;
11
- extraTabs?: ExtraTabKey[];
12
- onChangeStatus?: (status: "Read" | "Unread") => void;
13
7
  }
14
- export declare const Notification: FC<NotificationProps>;
8
+ export interface NotiRef extends NotificationRef {
9
+ setShowSelect: (visible: boolean) => void;
10
+ }
11
+ export declare const Notification: import("react").ForwardRefExoticComponent<NotificationProps & import("react").RefAttributes<NotiRef>>;
15
12
  export {};
@@ -1,8 +1,9 @@
1
1
  import React from "react";
2
2
  import { MainLayoutProps } from ".";
3
+ import { NotificationRef } from "./Header";
3
4
  interface AppContextProps {
4
5
  LinkComponent?: any;
5
6
  }
6
7
  export declare const AppContext: React.Context<AppContextProps>;
7
- export declare const MainLayout: React.FunctionComponent<MainLayoutProps>;
8
+ export declare const MainLayout: React.ForwardRefExoticComponent<MainLayoutProps & React.RefAttributes<NotificationRef>>;
8
9
  export {};
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
2
  import { SideBarMenuProps } from "./SideBarMenu";
3
- import { HeaderProps } from "./Header";
3
+ import { HeaderProps, NotificationRef } from "./Header";
4
4
  import { ISideBarMenuModel } from "../../models";
5
5
  export interface MainLayoutProps extends Omit<SideBarMenuProps, "sideBarMenus">, HeaderProps {
6
6
  children?: React.ReactNode;
@@ -11,3 +11,31 @@ export interface MainLayoutProps extends Omit<SideBarMenuProps, "sideBarMenus">,
11
11
  className?: string;
12
12
  customSideBar?: React.ReactNode;
13
13
  }
14
+ export * from "./Header/Header.types";
15
+ export type MainLayoutRef = NotificationRef;
16
+ export interface MainLayoutConfig {
17
+ header?: {
18
+ theme?: {
19
+ visible?: boolean;
20
+ };
21
+ notification?: {
22
+ visible: boolean;
23
+ };
24
+ language?: {
25
+ visible?: boolean;
26
+ };
27
+ app?: {
28
+ visible?: boolean;
29
+ };
30
+ support?: {
31
+ visible: boolean;
32
+ };
33
+ profile?: {
34
+ visible?: boolean;
35
+ customizeTheme?: {
36
+ visible?: boolean;
37
+ };
38
+ };
39
+ };
40
+ }
41
+ export declare const defaultMainLayoutConfig: MainLayoutConfig;
@@ -1,4 +1,4 @@
1
1
  import { NotificationItemType, Theme } from "./Header";
2
- import { MainLayoutProps } from "./MainLayout.types";
3
2
  export * from "./MainLayout";
4
- export type { MainLayoutProps, NotificationItemType, Theme };
3
+ export type { NotificationItemType, Theme };
4
+ export * from "./MainLayout.types";
@@ -1,9 +1,8 @@
1
1
  import { Editor, Node } from "@tiptap/react";
2
- import { Node as ProseMirrorNode } from "prosemirror-model";
3
2
  import { Decoration } from "@tiptap/pm/view";
4
3
  interface NodeViewProps {
5
4
  editor: Editor;
6
- node: ProseMirrorNode;
5
+ node: any;
7
6
  decorations: Decoration;
8
7
  selected: boolean;
9
8
  extension: Node<any, any>;
@@ -14,5 +14,8 @@ declare const _default: {
14
14
  font: string;
15
15
  enterLink: string;
16
16
  enterImageLink: string;
17
+ pasteWithTextStylesConfirm: string;
18
+ paste: string;
19
+ format: string;
17
20
  };
18
21
  export default _default;
@@ -14,5 +14,8 @@ declare const _default: {
14
14
  font: string;
15
15
  enterLink: string;
16
16
  enterImageLink: string;
17
+ pasteWithTextStylesConfirm: string;
18
+ paste: string;
19
+ format: string;
17
20
  };
18
21
  export default _default;
@@ -16,5 +16,8 @@ export declare function useTranslation(): {
16
16
  font: string;
17
17
  enterLink: string;
18
18
  enterImageLink: string;
19
+ pasteWithTextStylesConfirm: string;
20
+ paste: string;
21
+ format: string;
19
22
  };
20
23
  export {};