@inceptionbg/iui 2.0.10 → 2.0.11
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 +35 -22
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/iui.css +1 -1
- package/package.json +1 -1
- package/src/assets/icons/light/faPen.ts +15 -15
- package/src/components/Dialog/Dialog.tsx +6 -8
- package/src/components/Header/Components/UserMenu.tsx +2 -4
- package/src/components/Inputs/DateInput/DateInput.tsx +1 -2
- package/src/components/Inputs/PasswordInput.tsx +2 -1
- package/src/components/Inputs/Select2/Select.tsx +0 -1
- package/src/components/Menu/hooks/useMenuPosition.tsx +26 -8
- package/src/components/Pullover/Pullover.tsx +28 -12
- package/src/components/Table/components/filters/TableFilters.tsx +3 -3
- package/src/components/Wrappers/PageLayout.tsx +1 -1
- package/src/hooks/useLocalPopoverControl.ts +11 -17
- package/src/hooks/usePopupControl.ts +11 -7
- package/src/index.ts +3 -0
- package/src/styles/common/_typography.scss +1 -1
- package/src/types/IHeader.ts +13 -7
- package/src/types/IPopup.ts +17 -0
|
@@ -1,13 +1,17 @@
|
|
|
1
|
-
import { useRef } from 'react';
|
|
2
|
-
import { PopupControlRef } from '
|
|
1
|
+
import { useCallback, useRef, useState } from 'react';
|
|
2
|
+
import { IPopupControl, PopupControlRef } from '../types/IPopup';
|
|
3
|
+
|
|
4
|
+
export const usePopupControl: () => IPopupControl = () => {
|
|
5
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
3
6
|
|
|
4
|
-
export const usePopupControl = () => {
|
|
5
7
|
const controlRef = useRef<PopupControlRef>(null);
|
|
6
8
|
|
|
9
|
+
const onOpen = useCallback(() => controlRef.current?.onOpen(), []);
|
|
10
|
+
const onClose = useCallback(() => controlRef.current?.onClose(), []);
|
|
11
|
+
|
|
7
12
|
return {
|
|
8
|
-
controlRef,
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
onClose: () => controlRef.current?.onClose(),
|
|
13
|
+
control: { controlRef, isOpen, setIsOpen },
|
|
14
|
+
onOpen,
|
|
15
|
+
onClose,
|
|
12
16
|
};
|
|
13
17
|
};
|
package/src/index.ts
CHANGED
|
@@ -17,6 +17,7 @@ import type {
|
|
|
17
17
|
} from './types/IBasic';
|
|
18
18
|
import type { IKeyboardAction } from './types/IKeyboard';
|
|
19
19
|
import type { IMenuItem, IMenuPlacement } from './types/IMenu';
|
|
20
|
+
import type { PopupControlRef, IPopupControl } from './types/IPopup';
|
|
20
21
|
import type { IError } from './types/IError';
|
|
21
22
|
import type { ISelectData } from './types/ISelect';
|
|
22
23
|
import type { ITab } from './types/ITab';
|
|
@@ -244,6 +245,8 @@ export type {
|
|
|
244
245
|
IKeyboardAction,
|
|
245
246
|
IMenuItem,
|
|
246
247
|
IMenuPlacement,
|
|
248
|
+
PopupControlRef,
|
|
249
|
+
IPopupControl as IPopupControl,
|
|
247
250
|
IError,
|
|
248
251
|
IFormWrapper,
|
|
249
252
|
IHeaderAction,
|
package/src/types/IHeader.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { IconDefinition, RotateProp } from '@fortawesome/fontawesome-svg-core';
|
|
|
2
2
|
import { IButtonColor } from '../components/Button/Button';
|
|
3
3
|
import { IMenuItem } from './IMenu';
|
|
4
4
|
import { FC } from 'react';
|
|
5
|
+
import { IPopupControl } from './IPopup';
|
|
5
6
|
|
|
6
7
|
export interface IHeaderAction {
|
|
7
8
|
label: string;
|
|
@@ -20,15 +21,20 @@ export type IHeaderUserMenuProps = {
|
|
|
20
21
|
setIsOpen: (isOpen: boolean) => void;
|
|
21
22
|
userName?: string;
|
|
22
23
|
organizationName?: string;
|
|
24
|
+
menuItems: IMenuItem[];
|
|
23
25
|
showBadge?: boolean;
|
|
24
|
-
|
|
25
|
-
|
|
26
|
+
controls: {
|
|
27
|
+
myAccountControl: IPopupControl;
|
|
28
|
+
changeOrgControl: IPopupControl;
|
|
29
|
+
orgInvitesControl: IPopupControl;
|
|
30
|
+
};
|
|
31
|
+
refetchOrganizationInvites?: () => void;
|
|
26
32
|
HeaderUserMenuDialogs: FC<{
|
|
27
|
-
|
|
28
|
-
|
|
33
|
+
controls: {
|
|
34
|
+
myAccountControl: IPopupControl;
|
|
35
|
+
changeOrgControl: IPopupControl;
|
|
36
|
+
orgInvitesControl: IPopupControl;
|
|
37
|
+
};
|
|
29
38
|
refetchOrganizationInvites?: () => void;
|
|
30
39
|
}>;
|
|
31
|
-
openedDialog: string | null;
|
|
32
|
-
setOpenedDialog: (dialog: string | null) => void;
|
|
33
|
-
refetchOrganizationInvites?: () => void;
|
|
34
40
|
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface PopupControlRef {
|
|
4
|
+
onOpen: () => void;
|
|
5
|
+
onClose: () => void;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface ILocalPopupControl {
|
|
9
|
+
controlRef: RefObject<PopupControlRef | null>;
|
|
10
|
+
isOpen: boolean;
|
|
11
|
+
setIsOpen: (isOpen: boolean) => void;
|
|
12
|
+
}
|
|
13
|
+
export interface IPopupControl {
|
|
14
|
+
control: ILocalPopupControl;
|
|
15
|
+
onOpen: () => void;
|
|
16
|
+
onClose: () => void;
|
|
17
|
+
}
|