@antscorp/antsomi-ui 1.3.5-beta.315 → 1.3.5-beta.317
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.
|
@@ -3,14 +3,9 @@ interface EditorTabItem {
|
|
|
3
3
|
showIcon?: boolean;
|
|
4
4
|
showDropdown?: boolean;
|
|
5
5
|
closeable?: boolean;
|
|
6
|
-
formatSelectedText: string;
|
|
7
|
-
formattedQuery: string;
|
|
8
6
|
id: string;
|
|
9
7
|
name: string;
|
|
10
|
-
|
|
11
|
-
type: string;
|
|
12
|
-
selectedTextOut: string;
|
|
13
|
-
queryResult: any;
|
|
8
|
+
type: 'query' | 'table-detail';
|
|
14
9
|
cursorSql?: string;
|
|
15
10
|
cursorSqlOut?: string;
|
|
16
11
|
refreshAndFocusId?: string;
|
|
@@ -9,12 +9,6 @@ import { EditorTabStyled } from './styled';
|
|
|
9
9
|
// Utils
|
|
10
10
|
import { handleError } from '@antscorp/antsomi-ui/es/utils';
|
|
11
11
|
const PATH = 'src/components/EditorTab/index.jsx';
|
|
12
|
-
const constants = {
|
|
13
|
-
TAB_TYPE: {
|
|
14
|
-
QUERY: 'query',
|
|
15
|
-
TABLE_DETAIL: 'table-detail',
|
|
16
|
-
},
|
|
17
|
-
};
|
|
18
12
|
export const EditorTab = props => {
|
|
19
13
|
var _a;
|
|
20
14
|
const { listTab = [], activeId = '', showArrow, showDropdown, disabledScroll, onCloseTab, onActiveTab, handleAddTab, onConfigure, onSaveName, showComposeNewQuery, className, leftBlockClassName, tabItemClassName, } = props;
|
|
@@ -23,7 +17,7 @@ export const EditorTab = props => {
|
|
|
23
17
|
const [isEditable, setIsEditable] = useState();
|
|
24
18
|
// Ref
|
|
25
19
|
const leftBlockRef = useRef(null);
|
|
26
|
-
const activeTabIdx = useMemo(() => arrTabs.findIndex(tab => tab.id === activeId), [activeId]);
|
|
20
|
+
const activeTabIdx = useMemo(() => arrTabs.findIndex(tab => tab.id === activeId), [activeId, arrTabs]);
|
|
27
21
|
useEffect(() => {
|
|
28
22
|
if (listTab.length - arrTabs.length === 1) {
|
|
29
23
|
setActiveTabId(listTab[listTab.length - 1].id);
|
|
@@ -121,7 +115,7 @@ export const EditorTab = props => {
|
|
|
121
115
|
active: tab.id === activeTabId,
|
|
122
116
|
}) },
|
|
123
117
|
showIcon &&
|
|
124
|
-
(tab.type ===
|
|
118
|
+
(tab.type === 'query' ? (React.createElement(Icon, { type: "icon-ants-material-outline-manage-search", overlayStyle: { fontSize: 21 } })) : (React.createElement(Icon, { type: "icon-ants-table-vertical", overlayStyle: { fontSize: 21 } }))),
|
|
125
119
|
isEditable === tab.id ? (React.createElement(ContentEditable, { value: tab.name, onSave: newValue => {
|
|
126
120
|
setIsEditable(undefined);
|
|
127
121
|
onSaveName === null || onSaveName === void 0 ? void 0 : onSaveName(tab.id, newValue);
|
|
@@ -3,6 +3,7 @@ import styled, { css } from 'styled-components';
|
|
|
3
3
|
import skeletonBackground from '../../../../../assets/images/background/skeleton-background.png';
|
|
4
4
|
// Constants
|
|
5
5
|
import { globalToken } from '@antscorp/antsomi-ui/es/constants';
|
|
6
|
+
import { MOBILE_VIEWPORT } from '@antscorp/antsomi-ui/es/components/atoms/MobileFrameV2/constants';
|
|
6
7
|
const THUMBNAIL_CARD_RADIUS = 5;
|
|
7
8
|
export const BannerWrapper = styled.div `
|
|
8
9
|
width: 100%;
|
|
@@ -19,9 +20,16 @@ export const BannerWrapper = styled.div `
|
|
|
19
20
|
#banner-mobile {
|
|
20
21
|
${props => {
|
|
21
22
|
const height = props.$height || 700;
|
|
22
|
-
const
|
|
23
|
+
const smallScale = (height - 10) / MOBILE_VIEWPORT.MD.height;
|
|
24
|
+
const largeScale = (height - 10) / MOBILE_VIEWPORT.LG.height;
|
|
23
25
|
return css `
|
|
24
|
-
|
|
26
|
+
@media screen and (max-height: 1000px) {
|
|
27
|
+
transform: scale(${smallScale});
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
@media screen and (min-height: 1001px) {
|
|
31
|
+
transform: scale(${largeScale});
|
|
32
|
+
}
|
|
25
33
|
`;
|
|
26
34
|
}}
|
|
27
35
|
}
|