@antscorp/antsomi-ui 1.3.5-beta.219 → 1.3.5-beta.220
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,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { PopoverProps } from 'antd';
|
|
2
3
|
export interface AccountSelectionProps {
|
|
3
4
|
show?: boolean;
|
|
4
5
|
className?: string;
|
|
@@ -15,5 +16,7 @@ export interface AccountSelectionProps {
|
|
|
15
16
|
inputStyle?: 'select' | 'input';
|
|
16
17
|
inputClassName?: string;
|
|
17
18
|
onChange?: (userId: number | 'ALL_ACCOUNT') => void;
|
|
19
|
+
getPopupContainer?: PopoverProps['getPopupContainer'];
|
|
20
|
+
zIndex?: PopoverProps['zIndex'];
|
|
18
21
|
}
|
|
19
22
|
export declare const AccountSelection: React.FC<AccountSelectionProps>;
|
|
@@ -8,7 +8,7 @@ import { Tooltip } from 'antd';
|
|
|
8
8
|
import { searchStringQuery } from '@antscorp/antsomi-ui/es/utils';
|
|
9
9
|
import { PORTALS_IDS } from '@antscorp/antsomi-ui/es/constants';
|
|
10
10
|
export const AccountSelection = props => {
|
|
11
|
-
const { show = true, className, apiConfig, showAllAccount = true, currentAccount, inputStyle = 'input', inputClassName, onChange, } = props;
|
|
11
|
+
const { show = true, className, apiConfig, showAllAccount = true, currentAccount, inputStyle = 'input', inputClassName, onChange, getPopupContainer, zIndex, } = props;
|
|
12
12
|
const { domain, token, userId, appCode, portalId } = apiConfig;
|
|
13
13
|
const { data } = useGetAccountList({
|
|
14
14
|
apiConfig,
|
|
@@ -66,7 +66,9 @@ export const AccountSelection = props => {
|
|
|
66
66
|
React.createElement("ul", { className: "scroll-content" }, accountData === null || accountData === void 0 ? void 0 : accountData.filter(account => !(recentData === null || recentData === void 0 ? void 0 : recentData.value.includes(account.userId)) &&
|
|
67
67
|
searchStringQuery(account.userName, searchValue)).map(account => (React.createElement(AccountItem, { key: account.userId, userName: account.userName, userId: account.userId, onClick: handleSelectAccount, isSelected: currentAccount === account.userId }))))),
|
|
68
68
|
showAllAccount ? (React.createElement(Text, { className: `all-account ${currentAccount === 'ALL_ACCOUNT' ? 'is-selected' : ''}`, onClick: () => handleSelectAccount('ALL_ACCOUNT') },
|
|
69
|
-
React.createElement("strong", null, "All account"))) : null), trigger: "click", overlayInnerStyle: { padding: 0 },
|
|
69
|
+
React.createElement("strong", null, "All account"))) : null), trigger: "click", overlayInnerStyle: { padding: 0 },
|
|
70
|
+
// getPopupContainer={triggerNode => triggerNode}
|
|
71
|
+
getPopupContainer: getPopupContainer, placement: "bottomLeft", arrow: false, open: open, onOpenChange: setOpen, zIndex: zIndex || 1300 },
|
|
70
72
|
React.createElement(PopoverFieldStyled, { className: `${inputStyle || ''} ${inputClassName || ''}` },
|
|
71
73
|
React.createElement(Tooltip, { title: inputLabel },
|
|
72
74
|
React.createElement("span", { className: !inputLabel ? 'is-placeholder' : '' }, inputLabel || 'Select an account')),
|