@antscorp/antsomi-ui 1.3.5-beta.884 → 1.3.5-beta.885
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.
|
@@ -2,6 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
2
2
|
// Libraries
|
|
3
3
|
import { memo, useContext, useEffect, useState } from 'react';
|
|
4
4
|
import { slice } from 'lodash';
|
|
5
|
+
import { translate, translations } from '@antscorp/antsomi-locales';
|
|
5
6
|
// Context
|
|
6
7
|
import { SelectAccountContext } from './context/SelectAccountContext';
|
|
7
8
|
// Components
|
|
@@ -39,7 +40,7 @@ const AccountList = () => {
|
|
|
39
40
|
setTempSelected(tempSelected.filter(id => id !== key));
|
|
40
41
|
}
|
|
41
42
|
};
|
|
42
|
-
return (_jsxs(AccountListWrapper, { children: [_jsx(AccountListBody, { children: _jsxs("form", { ref: formListRef, id: "form-account-list", children: [_jsx(Input, { value: searchText, placeholder:
|
|
43
|
+
return (_jsxs(AccountListWrapper, { children: [_jsx(AccountListBody, { children: _jsxs("form", { ref: formListRef, id: "form-account-list", children: [_jsx(Input, { value: searchText, placeholder: translate(translations._ACT_SEARCH), suffix: _jsx(Icon, { type: "icon-ants-search-2" }), onAfterChange: value => handleSearch(value), debounce: 500 }), state?.type === 'group' ? (_jsxs(_Fragment, { children: [_jsx(Dropdown, { open: openGroup, getPopupContainer: () => document.getElementById('account-group-list') || document.body, overlayStyle: { position: 'initial' }, trigger: ['click'], dropdownRender: () => (
|
|
43
44
|
// <AccountListContent>
|
|
44
45
|
_jsx(Scrollbars, { width: "100%", autoHeight: true, autoHeightMax: 160, onScrollFrame: values => {
|
|
45
46
|
if (values.top > POSITION_TOP &&
|
|
@@ -62,6 +63,6 @@ const AccountList = () => {
|
|
|
62
63
|
if (values.top > POSITION_TOP && limit * page < usersDisplay?.length) {
|
|
63
64
|
setPage(page + 1);
|
|
64
65
|
}
|
|
65
|
-
}, children: _jsx(AccountListContent, { children: slice(usersDisplay, 0, limit * page)?.map(item => (_jsx(AccountItem, { checked: tempSelected.includes(item?.[userIdKey]), label: item?.[nameKey], disabled: disabledAccount?.includes(item?.[userIdKey]), onChange: e => handleTempSelected(e.target.checked, item?.[userIdKey]) }, item?.[userIdKey]))) }) }))] }) }), _jsxs(AccountListFooter, { children: [_jsx(Button, { onClick: () => handleCancel(), children: state.cancelText ||
|
|
66
|
+
}, children: _jsx(AccountListContent, { children: slice(usersDisplay, 0, limit * page)?.map(item => (_jsx(AccountItem, { checked: tempSelected.includes(item?.[userIdKey]), label: item?.[nameKey], disabled: disabledAccount?.includes(item?.[userIdKey]), onChange: e => handleTempSelected(e.target.checked, item?.[userIdKey]) }, item?.[userIdKey]))) }) }))] }) }), _jsxs(AccountListFooter, { children: [_jsx(Button, { onClick: () => handleCancel(), children: state.cancelText || translate(translations._ACT_CANCEL) }), _jsx(Button, { type: "primary", onClick: () => handleApply(), children: state.applyText || translate(translations._ACT_APPLY) })] })] }));
|
|
66
67
|
};
|
|
67
68
|
export default memo(AccountList);
|
|
@@ -4,10 +4,11 @@ import { useContext } from 'react';
|
|
|
4
4
|
// Context
|
|
5
5
|
import { SelectAccountContext } from './context';
|
|
6
6
|
// Components
|
|
7
|
-
import {
|
|
7
|
+
import { translate, translations } from '@antscorp/antsomi-locales';
|
|
8
8
|
import { Icon, Popover } from '../../atoms';
|
|
9
9
|
import AccountList from './AccountList';
|
|
10
10
|
import AccountListOnlyOne from './AccountListOnlyOne';
|
|
11
|
+
import { ButtonAddStyled } from './styled';
|
|
11
12
|
const ButtonAdd = () => {
|
|
12
13
|
const { state, dispatch } = useContext(SelectAccountContext);
|
|
13
14
|
const { onlyOne } = state;
|
|
@@ -23,6 +24,6 @@ const ButtonAdd = () => {
|
|
|
23
24
|
};
|
|
24
25
|
return (_jsx(Popover, { open: state.openAccountList, content: onlyOne ? _jsx(AccountListOnlyOne, {}) : _jsx(AccountList, {}), trigger: "click", arrow: false, overlayInnerStyle: { padding: 0 }, destroyTooltipOnHide: true, onOpenChange: handleClose, afterOpenChange: handleAfterClose, placement: "bottomLeft", children: _jsxs(ButtonAddStyled, { className: "select-account-btn-add", style: { ...(state?.styles?.btnAdd || {}) }, disabled: state.disabled || !state.isInitDone, onClick: () => state.openAccountList
|
|
25
26
|
? dispatch({ type: 'CLOSE_ACCOUNT_LIST' })
|
|
26
|
-
: dispatch({ type: 'OPEN_ACCOUNT_LIST' }), children: [_jsx("div", { className: "icon", children: _jsx(Icon, { type: "icon-ants-add", size: 10 }) }), _jsx("div", { className: "name", children: state.addText ||
|
|
27
|
+
: dispatch({ type: 'OPEN_ACCOUNT_LIST' }), children: [_jsx("div", { className: "icon", children: _jsx(Icon, { type: "icon-ants-add", size: 10 }) }), _jsx("div", { className: "name", children: state.addText || translate(translations._ACT_ADD_ACCOUNT) })] }) }));
|
|
27
28
|
};
|
|
28
29
|
export default ButtonAdd;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
// Libraries
|
|
3
3
|
import { useContext, useState } from 'react';
|
|
4
|
+
import { translate, translations } from '@antscorp/antsomi-locales';
|
|
4
5
|
// Context
|
|
5
6
|
import { SelectAccountContext } from './context';
|
|
6
7
|
// Components
|
|
@@ -36,6 +37,6 @@ const ButtonViewAll = () => {
|
|
|
36
37
|
const user = users.find(u => u?.[userIdKey] === id);
|
|
37
38
|
return (_jsx(AccountChip, { user: user, value: user?.[userIdKey], label: user?.[nameKey], onRemove: () => handleRemove({ userId: user?.[userIdKey], index }) }, user?.[userIdKey]));
|
|
38
39
|
})] }));
|
|
39
|
-
return (_jsx(Popover, { content: () => contentViewAll(), trigger: "click", arrow: false, overlayInnerStyle: { padding: 0 }, destroyTooltipOnHide: true, children: _jsx(ButtonViewAllStyled, { className: "select-account-view-all", style: { ...(styles?.btnViewAll || {}) }, type: "text", children:
|
|
40
|
+
return (_jsx(Popover, { content: () => contentViewAll(), trigger: "click", arrow: false, overlayInnerStyle: { padding: 0 }, destroyTooltipOnHide: true, children: _jsx(ButtonViewAllStyled, { className: "select-account-view-all", style: { ...(styles?.btnViewAll || {}) }, type: "text", children: translate(translations._ACT_VIEW_ALL) }) }));
|
|
40
41
|
};
|
|
41
42
|
export default ButtonViewAll;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antscorp/antsomi-ui",
|
|
3
|
-
"version": "1.3.5-beta.
|
|
3
|
+
"version": "1.3.5-beta.885",
|
|
4
4
|
"description": "An enterprise-class UI design language and React UI library.",
|
|
5
5
|
"sideEffects": [
|
|
6
6
|
"dist/*",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"not op_mini all"
|
|
62
62
|
],
|
|
63
63
|
"dependencies": {
|
|
64
|
-
"@antscorp/antsomi-locales": "^1.0.
|
|
64
|
+
"@antscorp/antsomi-locales": "^1.0.13",
|
|
65
65
|
"@antscorp/icons": "0.27.54",
|
|
66
66
|
"@antscorp/image-editor": "1.0.2",
|
|
67
67
|
"@antscorp/processing-notification": "^1.0.3",
|