@antscorp/antsomi-ui 1.3.5-beta.667 → 1.3.5-beta.669
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/es/components/molecules/DatePicker/components/AdvancedPicker/AdvancedPicker.js +1 -1
- package/es/components/molecules/SearchPopover/SearchPopover.js +3 -2
- package/es/components/molecules/SearchPopover/components/PopoverAddField/PopoverAddField.js +11 -4
- package/es/components/molecules/SearchPopover/components/PopoverSelect/PopoverSelect.js +13 -12
- package/es/components/molecules/SearchPopover/components/PopoverSelect/styled.d.ts +4 -0
- package/es/components/molecules/SearchPopover/components/PopoverSelect/styled.js +53 -0
- package/es/components/molecules/SearchPopover/components/PopoverSelect/styles.scss +0 -52
- package/es/components/molecules/SearchPopover/styled.d.ts +2 -0
- package/es/components/molecules/SearchPopover/styled.js +27 -0
- package/es/components/molecules/SearchPopover/styles.scss +0 -24
- package/es/components/molecules/SearchPopover/types.d.ts +3 -1
- package/es/components/molecules/VirtualizedMenu/components/Item/Item.js +1 -1
- package/es/components/molecules/VirtualizedMenu/components/MenuInline/MenuInline.js +11 -2
- package/es/components/molecules/VirtualizedMenu/styled.js +11 -6
- package/es/components/organism/Login/Login.js +2 -2
- package/es/components/organism/Login/components/ForgotPassword/ForgotPassword.js +3 -3
- package/es/components/organism/Login/components/LoginSelectPortal/Item/styled.js +2 -2
- package/es/components/organism/Login/components/LoginStep2/LoginStep2.js +9 -8
- package/es/components/organism/Login/components/SetupGGAuthenticator/SetupGGAuthenticator.js +1 -1
- package/es/components/organism/Login/components/SignIn/SignIn.js +1 -1
- package/es/components/organism/Login/styled.js +15 -5
- package/package.json +1 -1
|
@@ -380,7 +380,7 @@ export const AdvancedPicker = props => {
|
|
|
380
380
|
return (React.createElement(Space, { direction: "vertical", size: 5, className: "antsomi-advanced-picker-container", ref: ref },
|
|
381
381
|
!!label && typeof label === 'string' ? (React.createElement(Text, { style: { color: '#666666' } }, label)) : (label),
|
|
382
382
|
React.createElement("span", { className: "date-picker__title--view-mode" }, selectedDateTitle)));
|
|
383
|
-
return (React.createElement(Space, { direction: "vertical", size: 5, className: "antsomi-advanced-picker-container", ref: ref },
|
|
383
|
+
return (React.createElement(Space, { direction: "vertical", size: 5, className: "antsomi-advanced-picker-container", ref: onlyShowFixed ? undefined : ref },
|
|
384
384
|
!!label && typeof label === 'string' ? (React.createElement(Text, { style: { color: '#666666' } }, label)) : (label),
|
|
385
385
|
isShowFixed && !['WEEK', 'DAY_OF_WEEK', 'MONTH_DAY', 'DAY'].includes(valueType) ? (React.createElement(Tooltip, { title: selectedDateTitle },
|
|
386
386
|
React.createElement(DatePicker, { disabled: disabled, open: !disabled && isOpen, popupStyle: popupStyle, allowClear: false, inputReadOnly: true, style: Object.assign({ textOverflow: 'ellipsis' }, inputStyle), status: errorMessage ? 'error' : '', inputRender: () => (React.createElement(DatePickerCustomInput, { readOnly: true, placeholder: "Select Date", value: selectedDateTitle, onClick: () => toggleOpenDropdown() })), value: currDate,
|
|
@@ -11,13 +11,14 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
11
11
|
};
|
|
12
12
|
import React from 'react';
|
|
13
13
|
import { Popover } from 'antd';
|
|
14
|
-
import {
|
|
14
|
+
import { Icon } from '../../atoms';
|
|
15
15
|
import './styles.scss';
|
|
16
16
|
import clsx from 'clsx';
|
|
17
|
+
import { StyledInput } from './styled';
|
|
17
18
|
export const SearchPopover = (props) => {
|
|
18
19
|
const { inputSearchProps = {} } = props, popoverProps = __rest(props, ["inputSearchProps"]);
|
|
19
20
|
const { overlayClassName, arrow = false, children, content, trigger = ['click'] } = popoverProps, restPopoverProps = __rest(popoverProps, ["overlayClassName", "arrow", "children", "content", "trigger"]);
|
|
20
21
|
return (React.createElement(Popover, Object.assign({ trigger: trigger, arrow: arrow }, restPopoverProps, { overlayClassName: clsx('search-popover-overlay', overlayClassName), overlay: true, content: React.createElement(React.Fragment, null,
|
|
21
|
-
React.createElement(
|
|
22
|
+
React.createElement(StyledInput, Object.assign({ placeholder: (inputSearchProps === null || inputSearchProps === void 0 ? void 0 : inputSearchProps.placeholder) || 'Search...', bordered: false }, inputSearchProps, { addonAfter: React.createElement(Icon, { type: "icon-ants-search-2" }), withWrapper: false })),
|
|
22
23
|
content) }), children));
|
|
23
24
|
};
|
|
@@ -9,16 +9,14 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
9
9
|
}
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
|
-
import React, { useMemo } from 'react';
|
|
12
|
+
import React, { useCallback, useMemo } from 'react';
|
|
13
13
|
import clsx from 'clsx';
|
|
14
14
|
import { renderIconField } from '../../utils';
|
|
15
15
|
import { PopoverSelect } from '../PopoverSelect';
|
|
16
|
+
import { Typography } from 'antd';
|
|
16
17
|
export const PopoverAddField = (props) => {
|
|
17
18
|
const { fields, onSearchPredicate, className } = props, rest = __rest(props, ["fields", "onSearchPredicate", "className"]);
|
|
18
19
|
const originalFieldByKey = useMemo(() => new Map(fields.map(field => [field.key, field])), [fields]);
|
|
19
|
-
const options = useMemo(() => fields.map(field => (Object.assign(Object.assign({}, field), { label: (React.createElement(React.Fragment, null,
|
|
20
|
-
field.dataType && renderIconField(field.dataType),
|
|
21
|
-
field.label)) }))), [fields]);
|
|
22
20
|
const handleOnSearchPredicate = (field) => {
|
|
23
21
|
const originalField = originalFieldByKey.get(field.key);
|
|
24
22
|
if (!originalField)
|
|
@@ -28,5 +26,14 @@ export const PopoverAddField = (props) => {
|
|
|
28
26
|
}
|
|
29
27
|
return true;
|
|
30
28
|
};
|
|
29
|
+
const options = useCallback((params) => fields.map(field => (Object.assign(Object.assign({}, field), { label: (React.createElement(React.Fragment, null,
|
|
30
|
+
field.dataType && renderIconField(field.dataType),
|
|
31
|
+
typeof field.label === 'string' && (React.createElement(Typography.Text, { ellipsis: {
|
|
32
|
+
tooltip: true,
|
|
33
|
+
} }, field.label)),
|
|
34
|
+
typeof field.label === 'function' &&
|
|
35
|
+
field.label({
|
|
36
|
+
selected: params.selected.includes(field.key),
|
|
37
|
+
}))) }))), [fields]);
|
|
31
38
|
return (React.createElement(PopoverSelect, Object.assign({}, rest, { options: options, onSearchPredicate: handleOnSearchPredicate, className: clsx(className, 'ants-popover-add-fields') })));
|
|
32
39
|
};
|
|
@@ -12,14 +12,14 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
12
12
|
import React, { useEffect, useMemo, useRef, useState } from 'react';
|
|
13
13
|
import { THEME } from '@antscorp/antsomi-ui/es/constants';
|
|
14
14
|
import { SearchPopover } from '../../SearchPopover';
|
|
15
|
-
import { Button, Checkbox, Menu } from 'antd';
|
|
16
15
|
import './styles.scss';
|
|
17
16
|
import { searchStringQuery } from '@antscorp/antsomi-ui/es/utils';
|
|
18
|
-
import { Icon } from '../../../../atoms';
|
|
19
|
-
import
|
|
17
|
+
import { Button, Checkbox, Icon } from '../../../../atoms';
|
|
18
|
+
import { StyledAction, StyledFooter, StyledListFieldsWrapper } from './styled';
|
|
19
|
+
import { List } from 'antd';
|
|
20
20
|
export const PopoverSelect = (props) => {
|
|
21
21
|
var _a, _b;
|
|
22
|
-
const { open: openProp, selected, options = [], onCancel, onApply, inputSearchProps = {}, children, showAllLabel = 'Show all', showSelectedLabel = 'Show selected', selectAllLabel = 'Select all', deselectAllLabel = 'Unselect all', onSearchPredicate } = props, rest = __rest(props, ["open", "selected", "options", "onCancel", "onApply", "inputSearchProps", "children", "showAllLabel", "showSelectedLabel", "selectAllLabel", "deselectAllLabel", "onSearchPredicate"]);
|
|
22
|
+
const { open: openProp, selected, options: optionsProp = [], onCancel, onApply, inputSearchProps = {}, children, showAllLabel = 'Show all', showSelectedLabel = 'Show selected', selectAllLabel = 'Select all', deselectAllLabel = 'Unselect all', onSearchPredicate } = props, rest = __rest(props, ["open", "selected", "options", "onCancel", "onApply", "inputSearchProps", "children", "showAllLabel", "showSelectedLabel", "selectAllLabel", "deselectAllLabel", "onSearchPredicate"]);
|
|
23
23
|
const { value: searchValue } = inputSearchProps, restInputSearchProps = __rest(inputSearchProps, ["value"]);
|
|
24
24
|
const refOnSearchPredicate = useRef(onSearchPredicate);
|
|
25
25
|
useEffect(() => {
|
|
@@ -30,6 +30,9 @@ export const PopoverSelect = (props) => {
|
|
|
30
30
|
const [search, setSearch] = useState('');
|
|
31
31
|
const [showSelected, setShowSelected] = useState(false);
|
|
32
32
|
const applyDisabled = selectedKeys.size === 0;
|
|
33
|
+
const options = useMemo(() => typeof optionsProp === 'function'
|
|
34
|
+
? optionsProp({ selected: [...selectedKeys] })
|
|
35
|
+
: optionsProp, [optionsProp, selectedKeys]);
|
|
33
36
|
useEffect(() => {
|
|
34
37
|
if (openProp !== undefined) {
|
|
35
38
|
setOpen(openProp);
|
|
@@ -114,15 +117,13 @@ export const PopoverSelect = (props) => {
|
|
|
114
117
|
return option.label;
|
|
115
118
|
};
|
|
116
119
|
return (React.createElement(SearchPopover, Object.assign({}, rest, { content: React.createElement(React.Fragment, null,
|
|
117
|
-
!!
|
|
120
|
+
!!optionsProp.length && (React.createElement(StyledAction, null,
|
|
118
121
|
React.createElement(Button, { type: "link", size: "small", onClick: () => setShowSelected(current => !current) }, showSelected ? showAllLabel : showSelectedLabel),
|
|
119
|
-
selectedKeys.size ===
|
|
120
|
-
!!filteredField.length && (React.createElement(
|
|
121
|
-
React.createElement(
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
})) }))),
|
|
125
|
-
React.createElement("div", { className: "footer" },
|
|
122
|
+
selectedKeys.size === optionsProp.length ? (React.createElement(Button, { type: "link", onClick: handleDeselectAll }, deselectAllLabel)) : (React.createElement(Button, { type: "link", onClick: handleSelectAll }, selectAllLabel)))),
|
|
123
|
+
!!filteredField.length && (React.createElement(StyledListFieldsWrapper, { autoHeight: true, autoHeightMax: 260 },
|
|
124
|
+
React.createElement(List, { bordered: false, dataSource: filteredField, renderItem: option => (React.createElement(List.Item, null,
|
|
125
|
+
React.createElement(Checkbox, { onChange: e => handleToggleField(option, e.target.checked), checked: selectedKeys.has(option.key) }, renderCheckBoxLabel(option)))) }))),
|
|
126
|
+
React.createElement(StyledFooter, null,
|
|
126
127
|
React.createElement(Button, { onClick: handleCancel }, "Cancel"),
|
|
127
128
|
React.createElement(Button, { onClick: handleApply, disabled: applyDisabled, type: "primary" }, "Apply"))), overlayInnerStyle: {
|
|
128
129
|
'--item-padding': `${((_b = (_a = THEME.components) === null || _a === void 0 ? void 0 : _a.Menu) === null || _b === void 0 ? void 0 : _b.itemPaddingInline) || 10}px`,
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import Scrollbars from 'react-custom-scrollbars';
|
|
2
|
+
export declare const StyledFooter: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
3
|
+
export declare const StyledAction: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
4
|
+
export declare const StyledListFieldsWrapper: import("styled-components").StyledComponent<typeof Scrollbars, any, {}, never>;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
var _a, _b;
|
|
2
|
+
import { THEME } from '@antscorp/antsomi-ui/es/constants';
|
|
3
|
+
import Scrollbars from 'react-custom-scrollbars';
|
|
4
|
+
import styled from 'styled-components';
|
|
5
|
+
export const StyledFooter = styled.div `
|
|
6
|
+
gap: 10px;
|
|
7
|
+
padding: 10px;
|
|
8
|
+
display: flex;
|
|
9
|
+
align-items: center;
|
|
10
|
+
justify-content: flex-end;
|
|
11
|
+
`;
|
|
12
|
+
export const StyledAction = styled.div `
|
|
13
|
+
display: flex;
|
|
14
|
+
align-items: center;
|
|
15
|
+
justify-content: space-between;
|
|
16
|
+
gap: 10px;
|
|
17
|
+
padding: 5px 0px;
|
|
18
|
+
|
|
19
|
+
> button {
|
|
20
|
+
height: 30px;
|
|
21
|
+
padding: 0 10px;
|
|
22
|
+
}
|
|
23
|
+
`;
|
|
24
|
+
export const StyledListFieldsWrapper = styled(Scrollbars) `
|
|
25
|
+
.antsomi-list-items {
|
|
26
|
+
border-bottom: 1px solid var(--divider-1);
|
|
27
|
+
|
|
28
|
+
> .antsomi-list-item {
|
|
29
|
+
padding: 0;
|
|
30
|
+
border-bottom: 0;
|
|
31
|
+
height: ${((_b = (_a = THEME.components) === null || _a === void 0 ? void 0 : _a.Menu) === null || _b === void 0 ? void 0 : _b.itemHeight) || 35}px;
|
|
32
|
+
|
|
33
|
+
> .antsomi-checkbox-wrapper {
|
|
34
|
+
padding: 0 var(--item-padding);
|
|
35
|
+
display: flex;
|
|
36
|
+
align-items: center;
|
|
37
|
+
width: 100%;
|
|
38
|
+
height: 100%;
|
|
39
|
+
|
|
40
|
+
span:nth-child(2) {
|
|
41
|
+
> i {
|
|
42
|
+
min-width: 20px;
|
|
43
|
+
text-align: center;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
display: flex;
|
|
47
|
+
align-items: center;
|
|
48
|
+
gap: 6px;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
`;
|
|
@@ -2,58 +2,6 @@
|
|
|
2
2
|
&.antsomi-popover {
|
|
3
3
|
.antsomi-popover-inner {
|
|
4
4
|
min-width: 300px;
|
|
5
|
-
|
|
6
|
-
.antsomi-popover-inner-content {
|
|
7
|
-
.antsomi-menu.list-fields {
|
|
8
|
-
border-bottom: 1px solid var(--divider-1);
|
|
9
|
-
|
|
10
|
-
> .antsomi-menu-item {
|
|
11
|
-
padding: 0;
|
|
12
|
-
|
|
13
|
-
> .antsomi-menu-title-content {
|
|
14
|
-
> .antsomi-checkbox-wrapper {
|
|
15
|
-
padding: 0 var(--item-padding);
|
|
16
|
-
display: flex;
|
|
17
|
-
align-items: center;
|
|
18
|
-
width: 100%;
|
|
19
|
-
height: 100%;
|
|
20
|
-
|
|
21
|
-
span:nth-child(2) {
|
|
22
|
-
> i {
|
|
23
|
-
min-width: 20px;
|
|
24
|
-
text-align: center;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
display: flex;
|
|
28
|
-
align-items: center;
|
|
29
|
-
gap: 6px;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
> .actions {
|
|
37
|
-
display: flex;
|
|
38
|
-
align-items: center;
|
|
39
|
-
justify-content: space-between;
|
|
40
|
-
gap: 10px;
|
|
41
|
-
padding: 5px 0px;
|
|
42
|
-
|
|
43
|
-
> button {
|
|
44
|
-
height: 30px;
|
|
45
|
-
padding: 0 10px;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
> .footer {
|
|
50
|
-
gap: 10px;
|
|
51
|
-
padding: 10px;
|
|
52
|
-
display: flex;
|
|
53
|
-
align-items: center;
|
|
54
|
-
justify-content: flex-end;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
5
|
}
|
|
58
6
|
}
|
|
59
7
|
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
import { Input } from '../../atoms';
|
|
3
|
+
export const StyledInput = styled(Input) `
|
|
4
|
+
&.antsomi-input-group-wrapper {
|
|
5
|
+
padding: 8px 10px;
|
|
6
|
+
border-bottom: 1px solid var(--divider-1);
|
|
7
|
+
|
|
8
|
+
.antsomi-input {
|
|
9
|
+
padding-left: 0;
|
|
10
|
+
padding-right: 0;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.antsomi-input-group-addon {
|
|
14
|
+
border: none;
|
|
15
|
+
background: transparent;
|
|
16
|
+
font-size: 20px;
|
|
17
|
+
padding: 0;
|
|
18
|
+
min-width: 25px;
|
|
19
|
+
|
|
20
|
+
> i {
|
|
21
|
+
font-size: 24px;
|
|
22
|
+
color: #595959;
|
|
23
|
+
cursor: pointer;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
`;
|
|
@@ -2,30 +2,6 @@
|
|
|
2
2
|
&.antsomi-popover {
|
|
3
3
|
.antsomi-popover-inner {
|
|
4
4
|
padding: 0;
|
|
5
|
-
|
|
6
|
-
.antsomi-input-group-wrapper {
|
|
7
|
-
padding: 8px 10px;
|
|
8
|
-
border-bottom: 1px solid var(--divider-1);
|
|
9
|
-
|
|
10
|
-
.antsomi-input {
|
|
11
|
-
padding-left: 0;
|
|
12
|
-
padding-right: 0;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.antsomi-input-group-addon {
|
|
16
|
-
border: none;
|
|
17
|
-
background: transparent;
|
|
18
|
-
font-size: 20px;
|
|
19
|
-
padding: 0;
|
|
20
|
-
min-width: 25px;
|
|
21
|
-
|
|
22
|
-
> i {
|
|
23
|
-
font-size: 24px;
|
|
24
|
-
color: #595959;
|
|
25
|
-
cursor: pointer;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
5
|
}
|
|
30
6
|
}
|
|
31
7
|
}
|
|
@@ -14,7 +14,9 @@ export type Field = Option & {
|
|
|
14
14
|
dataType?: string | number;
|
|
15
15
|
};
|
|
16
16
|
export type PopoverSelectProps<TOption extends Option = Option> = SearchPopoverProps & Partial<{
|
|
17
|
-
options: TOption[]
|
|
17
|
+
options: TOption[] | ((info: {
|
|
18
|
+
selected: string[];
|
|
19
|
+
}) => TOption[]);
|
|
18
20
|
selected: string[];
|
|
19
21
|
onCancel: () => void;
|
|
20
22
|
onApply: (selected: string[]) => void;
|
|
@@ -21,5 +21,5 @@ export const Item = memo((props) => {
|
|
|
21
21
|
'item-disabled': item === null || item === void 0 ? void 0 : item.disabled,
|
|
22
22
|
}, className), style: style, onClick: handleOnClick },
|
|
23
23
|
React.createElement("div", { className: "item-label" }, renderLabel()),
|
|
24
|
-
!!((_a = item === null || item === void 0 ? void 0 : item.children) === null || _a === void 0 ? void 0 : _a.length) && (React.createElement("div", { className: "
|
|
24
|
+
!!((_a = item === null || item === void 0 ? void 0 : item.children) === null || _a === void 0 ? void 0 : _a.length) && (React.createElement("div", { className: "item-actions" }, expandIcon || React.createElement(Icon, { type: "icon-ants-expand-more" })))));
|
|
25
25
|
});
|
|
@@ -96,8 +96,17 @@ export const MenuInline = (props) => {
|
|
|
96
96
|
const itemStyle = Object.assign(Object.assign({}, style), { paddingLeft: indentSize + inlinePadding, paddingRight: inlinePadding, top: Number(style.top) + itemSpacing, height: Number(style.height) - itemSpacing });
|
|
97
97
|
return (React.createElement(Item, { className: clsx({
|
|
98
98
|
'item-selected': selectedKeys.has(item.key),
|
|
99
|
+
'item-expanded': openKeys.has(item.key),
|
|
99
100
|
}, item.className), onClick: handleClickItem(item, index), style: itemStyle, item: item }));
|
|
100
|
-
}, [
|
|
101
|
+
}, [
|
|
102
|
+
flattenItems,
|
|
103
|
+
handleClickItem,
|
|
104
|
+
inlinePadding,
|
|
105
|
+
inlineIndent,
|
|
106
|
+
itemSpacing,
|
|
107
|
+
selectedKeys,
|
|
108
|
+
openKeys,
|
|
109
|
+
]);
|
|
101
110
|
// console.log('render');
|
|
102
|
-
return (React.createElement(AutoSizer, null, autoSize => (React.createElement(VirtualizedMenuContainer, { className: clsx(`menu-${MODE.Inline}`, className), itemSize: () => itemSize + itemSpacing, itemCount: flattenItems.length, height: autoSize.
|
|
111
|
+
return (React.createElement(AutoSizer, null, autoSize => (React.createElement(VirtualizedMenuContainer, { className: clsx(`menu-${MODE.Inline}`, className), itemSize: () => itemSize + itemSpacing, itemCount: flattenItems.length, height: autoSize.height, width: autoSize.width, innerElementType: innerElementType, useIsScrolling: true }, renderItem))));
|
|
103
112
|
};
|
|
@@ -35,7 +35,7 @@ export const MenuItemRoot = styled.div `
|
|
|
35
35
|
overflow: hidden;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
> .
|
|
38
|
+
> .item-actions {
|
|
39
39
|
display: flex;
|
|
40
40
|
align-items: center;
|
|
41
41
|
justify-content: center;
|
|
@@ -50,15 +50,20 @@ export const MenuItemRoot = styled.div `
|
|
|
50
50
|
background-color: ${(_f = (_e = THEME.components) === null || _e === void 0 ? void 0 : _e.Menu) === null || _f === void 0 ? void 0 : _f.itemActiveBg};
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
+
&.item-expanded {
|
|
54
|
+
> .item-actions {
|
|
55
|
+
> i[type='icon-ants-expand-more'] {
|
|
56
|
+
rotate: 180deg;
|
|
57
|
+
transition: rotate 2s;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
53
62
|
&:hover:not(.item-disabled, .item-selected) {
|
|
54
63
|
background-color: ${(_h = (_g = THEME.components) === null || _g === void 0 ? void 0 : _g.Menu) === null || _h === void 0 ? void 0 : _h.itemHoverBg};
|
|
55
64
|
}
|
|
56
65
|
`;
|
|
57
66
|
export const VirtualizedMenuContainer = styled(VariableSizeList) `
|
|
58
67
|
font-size: ${globalToken === null || globalToken === void 0 ? void 0 : globalToken.fontSize}px;
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
&:hover {
|
|
62
|
-
overflow: auto !important;
|
|
63
|
-
}
|
|
68
|
+
scrollbar-gutter: stable;
|
|
64
69
|
`;
|
|
@@ -694,7 +694,7 @@ export const Login = props => {
|
|
|
694
694
|
}
|
|
695
695
|
};
|
|
696
696
|
return (React.createElement(CookiesProvider, null,
|
|
697
|
-
React.createElement(LoginMain, { justify: isMobile ? 'center' : 'start' },
|
|
698
|
-
React.createElement(WrapperLogin, { isMobile: isMobile, vertical: true, align: "center", gap: 40, flex: 1, ref: loginRef }, renderMain()),
|
|
697
|
+
React.createElement(LoginMain, { justify: isMobile ? 'center' : 'start', id: "login_container" },
|
|
698
|
+
React.createElement(WrapperLogin, { isMobile: isMobile, vertical: true, align: "center", gap: 40, flex: 1, ref: loginRef, id: "login_main" }, renderMain()),
|
|
699
699
|
!isMobile && React.createElement(LoginBannerZone, { className: "login-banner-zone", id: "login_banner_zone" }))));
|
|
700
700
|
};
|
|
@@ -177,16 +177,16 @@ const ForgotPassword = props => {
|
|
|
177
177
|
});
|
|
178
178
|
errorRef.current.email = false;
|
|
179
179
|
setLoginError('');
|
|
180
|
-
} }),
|
|
180
|
+
}, status: errorRef.current.email && state.errors.email ? 'error' : undefined }),
|
|
181
181
|
errorRef.current.email && state.errors.email ? (React.createElement(Text, { type: "danger", style: { marginTop: 5 } }, state.errors.email)) : null,
|
|
182
182
|
state.loginError && (React.createElement(Text, { type: "danger", style: { marginTop: 5 } }, state.loginError))),
|
|
183
|
-
React.createElement(Flex, { vertical: true, gap:
|
|
183
|
+
React.createElement(Flex, { vertical: true, gap: 5 },
|
|
184
184
|
React.createElement(Flex, { justify: "center", style: {
|
|
185
185
|
transform: isMobile ? 'scale(1)' : `scale(${scaleCaptcha})`,
|
|
186
186
|
transformOrigin: !isMobile ? '' : '0 0',
|
|
187
187
|
} },
|
|
188
188
|
React.createElement(ReCAPTCHA, { sitekey: reCaptchaKey, onChange: onCaptchaChange, onExpired: onExpiredCaptcha, size: "normal" })),
|
|
189
|
-
state.errors.captcha &&
|
|
189
|
+
state.errors.captcha && React.createElement(Text, { type: "danger" }, "Please verify you are human")),
|
|
190
190
|
React.createElement(Flex, { vertical: true, gap: isMobile ? 30 : 15, style: { paddingBottom: 40 } },
|
|
191
191
|
React.createElement(StyleButton, { isMobile: isMobile, onClick: signIn, type: "primary" }, "Continue"),
|
|
192
192
|
React.createElement(StyleButton, { isMobile: isMobile, type: "text", onClick: handleBack }, "Back to login"))))), isShowLogo: false, footer: null }));
|
|
@@ -125,14 +125,15 @@ export const LoginStep2 = props => {
|
|
|
125
125
|
React.createElement(Text, { isMobile: isMobile },
|
|
126
126
|
"Open Google Authenticator and enter the code from ",
|
|
127
127
|
React.createElement("b", null, "antsomi.com"))) })),
|
|
128
|
-
React.createElement(Flex, { vertical: true, gap: isMobile ? 20 :
|
|
129
|
-
React.createElement(
|
|
130
|
-
|
|
131
|
-
draft
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
128
|
+
React.createElement(Flex, { vertical: true, gap: isMobile ? 20 : 11 },
|
|
129
|
+
React.createElement(Flex, { vertical: true, gap: 10 },
|
|
130
|
+
React.createElement(StyleInput, { isMobile: isMobile, maxLength: 6, placeholder: "Input your code", value: state.code, onChange: e => {
|
|
131
|
+
setState(draft => {
|
|
132
|
+
draft.code = e.target.value;
|
|
133
|
+
});
|
|
134
|
+
errorRef.current = true;
|
|
135
|
+
}, status: errorRef.current && state.codeError ? 'error' : undefined }),
|
|
136
|
+
errorRef.current && state.codeError ? (React.createElement(TextAntsomiUI, { type: "danger" }, "Invalid code, please try again")) : null),
|
|
136
137
|
React.createElement(Checkbox, { checked: state.isTrust, onChange: e => {
|
|
137
138
|
setState(draft => {
|
|
138
139
|
draft.isTrust = e.target.checked;
|
package/es/components/organism/Login/components/SetupGGAuthenticator/SetupGGAuthenticator.js
CHANGED
|
@@ -114,7 +114,7 @@ const SetupGGAuthenticator = props => {
|
|
|
114
114
|
if (e.target.value.trim().length) {
|
|
115
115
|
setCodeError(false);
|
|
116
116
|
}
|
|
117
|
-
} }),
|
|
117
|
+
}, status: errorRef.current && codeError ? 'error' : '' }),
|
|
118
118
|
errorRef.current && codeError ? (React.createElement(TextAntsomiUI, { type: "danger" }, "Invalid code, please try again")) : null)), footer: React.createElement(Flex, { vertical: true, gap: 92 },
|
|
119
119
|
React.createElement(Flex, { vertical: true, gap: isMobile ? 30 : 15 },
|
|
120
120
|
React.createElement(StyleButton, { isMobile: isMobile, loading: isLoading, type: "primary", onClick: updateG2FA }, "Complete"),
|
|
@@ -86,7 +86,7 @@ export const SignIn = props => {
|
|
|
86
86
|
} })) : (React.createElement(Icon, { type: "icon-ants-invisible", style: {
|
|
87
87
|
color: '#595959',
|
|
88
88
|
} })) })),
|
|
89
|
-
loginError && React.createElement("span", { style: { color: 'red' } }, "Email or password is invalid"),
|
|
89
|
+
loginError && (React.createElement("span", { style: { color: 'red', fontSize: 11 } }, "Email or password is invalid")),
|
|
90
90
|
React.createElement(Flex, { style: { width: '100%', marginTop: '40px' }, vertical: true, className: "" },
|
|
91
91
|
React.createElement(Form.Item, null,
|
|
92
92
|
React.createElement(StyleButton, { isMobile: isMobile, type: "primary", htmlType: "submit", style: { width: '100%', marginBottom: isMobile ? 15 : 0 }, loading: isLoading }, "Sign in")),
|
|
@@ -2,21 +2,31 @@ import { Button, Flex, Form, Input } from 'antd';
|
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
export const LoginMain = styled(Flex) `
|
|
4
4
|
background: #eaf1fb;
|
|
5
|
+
|
|
5
6
|
height: 100vh;
|
|
7
|
+
max-height: 100vh;
|
|
8
|
+
|
|
6
9
|
width: 100%;
|
|
10
|
+
|
|
11
|
+
overflow: hidden;
|
|
7
12
|
`;
|
|
8
13
|
export const LoginBannerZone = styled.div `
|
|
9
14
|
display: flex;
|
|
10
15
|
flex: 2;
|
|
16
|
+
z-index: 1;
|
|
17
|
+
|
|
18
|
+
min-width: calc(100vw - 404px);
|
|
19
|
+
max-width: calc(100vw - 300px);
|
|
11
20
|
`;
|
|
12
21
|
export const WrapperLogin = styled(Flex) `
|
|
13
22
|
height: 100%;
|
|
14
23
|
overflow-y: auto;
|
|
15
24
|
background-color: white;
|
|
25
|
+
z-index: 5;
|
|
16
26
|
|
|
17
27
|
width: ${props => (props.isMobile ? '100%' : '')};
|
|
18
28
|
min-width: ${props => (props.isMobile ? '100%' : '300px')};
|
|
19
|
-
max-width: ${props => (props.isMobile ? '100%' : '
|
|
29
|
+
max-width: ${props => (props.isMobile ? '100%' : '404px')};
|
|
20
30
|
|
|
21
31
|
${(props) => !props.isMobile ? 'box-shadow: 3px 0px 9px 0px #002e5926' : ''}
|
|
22
32
|
`;
|
|
@@ -63,8 +73,8 @@ export const AvatarImage = styled.img `
|
|
|
63
73
|
`;
|
|
64
74
|
export const StyledForm = styled(Form) `
|
|
65
75
|
input {
|
|
66
|
-
height: ${(props) => (props.isMobile ? ' 44px' : '
|
|
67
|
-
font-size: ${(props) =>
|
|
76
|
+
height: ${(props) => (props.isMobile ? ' 44px' : '36px')};
|
|
77
|
+
font-size: ${(props) => props.isMobile ? ' 16px !important' : '14px !important'};
|
|
68
78
|
}
|
|
69
79
|
|
|
70
80
|
input:-webkit-autofill,
|
|
@@ -76,12 +86,12 @@ export const StyledForm = styled(Form) `
|
|
|
76
86
|
}
|
|
77
87
|
|
|
78
88
|
.antsomi-input-password-icon {
|
|
79
|
-
font-size: ${(props) => (props.isMobile ? ' 24px' : '
|
|
89
|
+
font-size: ${(props) => (props.isMobile ? ' 24px' : '14px')};
|
|
80
90
|
}
|
|
81
91
|
|
|
82
92
|
.antsomi-input-affix-wrapper {
|
|
83
93
|
padding: 0 10px !important;
|
|
84
|
-
font-size: ${(props) =>
|
|
94
|
+
font-size: ${(props) => props.isMobile ? ' 16px !important' : '14px !important'};
|
|
85
95
|
}
|
|
86
96
|
|
|
87
97
|
.antsomi-form-item-explain-error {
|