@antscorp/antsomi-ui 1.3.5-beta.313 → 1.3.5-beta.315
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.
|
@@ -23,15 +23,13 @@ export const EditorTab = props => {
|
|
|
23
23
|
const [isEditable, setIsEditable] = useState();
|
|
24
24
|
// Ref
|
|
25
25
|
const leftBlockRef = useRef(null);
|
|
26
|
-
const activeTabIdx = useMemo(() =>
|
|
27
|
-
return arrTabs.findIndex(tab => tab.id === activeId);
|
|
28
|
-
}, [activeId]);
|
|
26
|
+
const activeTabIdx = useMemo(() => arrTabs.findIndex(tab => tab.id === activeId), [activeId]);
|
|
29
27
|
useEffect(() => {
|
|
30
28
|
if (listTab.length - arrTabs.length === 1) {
|
|
31
29
|
setActiveTabId(listTab[listTab.length - 1].id);
|
|
32
30
|
}
|
|
33
31
|
setArrTabs(listTab);
|
|
34
|
-
}, [listTab]);
|
|
32
|
+
}, [listTab, arrTabs.length]);
|
|
35
33
|
useEffect(() => {
|
|
36
34
|
onActiveTab(activeTabId);
|
|
37
35
|
setTimeout(() => {
|
|
@@ -42,12 +40,12 @@ export const EditorTab = props => {
|
|
|
42
40
|
}
|
|
43
41
|
}
|
|
44
42
|
}, 500);
|
|
45
|
-
}, [activeTabId]);
|
|
43
|
+
}, [activeTabId, disabledScroll, onActiveTab]);
|
|
46
44
|
useEffect(() => {
|
|
47
45
|
if (activeId && activeTabId !== activeId) {
|
|
48
46
|
setActiveTabId(activeId);
|
|
49
47
|
}
|
|
50
|
-
}, [activeId]);
|
|
48
|
+
}, [activeId, activeTabId]);
|
|
51
49
|
const handleAddNew = () => {
|
|
52
50
|
handleAddTab();
|
|
53
51
|
};
|
|
@@ -105,6 +103,8 @@ export const EditorTab = props => {
|
|
|
105
103
|
}
|
|
106
104
|
setActiveTabId(arrTabs[idx + 1].id);
|
|
107
105
|
break;
|
|
106
|
+
default:
|
|
107
|
+
break;
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
110
|
};
|
|
@@ -134,7 +134,6 @@ export const EditorTab = props => {
|
|
|
134
134
|
onClick: ({ key, domEvent }) => {
|
|
135
135
|
switch (key) {
|
|
136
136
|
case 'configure':
|
|
137
|
-
console.log('click configure', domEvent);
|
|
138
137
|
setIsEditable(tab.id);
|
|
139
138
|
onConfigure === null || onConfigure === void 0 ? void 0 : onConfigure(tab.id);
|
|
140
139
|
break;
|
|
@@ -145,7 +144,7 @@ export const EditorTab = props => {
|
|
|
145
144
|
break;
|
|
146
145
|
}
|
|
147
146
|
},
|
|
148
|
-
}, placement: "bottomRight", trigger: ['click'] },
|
|
147
|
+
}, placement: "bottomRight", trigger: ['click'], destroyPopupOnHide: true },
|
|
149
148
|
React.createElement(Button, { icon: React.createElement(Icon, { type: "icon-ants-angle-left", overlayStyle: { fontSize: 12 } }), style: { transform: 'rotate(-90deg)' }, size: "small" }))) : closeable ? (React.createElement(Button, { icon: React.createElement(Icon, { type: "icon-ants-remove-slim", onClick: e => handleCloseTab(e, tab, idx), overlayStyle: { fontSize: 12 } }), size: "small" })) : null));
|
|
150
149
|
})
|
|
151
150
|
: null),
|
|
@@ -54,8 +54,15 @@ export const EditorTabStyled = styled.div `
|
|
|
54
54
|
max-width: 200px;
|
|
55
55
|
background-color: ${(_b = THEME.token) === null || _b === void 0 ? void 0 : _b.bw2};
|
|
56
56
|
|
|
57
|
+
& button {
|
|
58
|
+
display: none !important;
|
|
59
|
+
}
|
|
60
|
+
|
|
57
61
|
&:hover {
|
|
58
62
|
background-color: ${(_c = THEME.token) === null || _c === void 0 ? void 0 : _c.blue};
|
|
63
|
+
& button {
|
|
64
|
+
display: flex !important;
|
|
65
|
+
}
|
|
59
66
|
}
|
|
60
67
|
|
|
61
68
|
white-space: nowrap;
|
|
@@ -87,6 +94,9 @@ export const EditorTabStyled = styled.div `
|
|
|
87
94
|
transform: scaleX(1);
|
|
88
95
|
}
|
|
89
96
|
background-color: #fff;
|
|
97
|
+
& button {
|
|
98
|
+
display: flex !important;
|
|
99
|
+
}
|
|
90
100
|
}
|
|
91
101
|
}
|
|
92
102
|
|
package/es/constants/theme.js
CHANGED
|
@@ -177,9 +177,9 @@ THEME.components = {
|
|
|
177
177
|
titleFontSizeSM: 14,
|
|
178
178
|
horizontalMargin: '0px',
|
|
179
179
|
colorBorderSecondary: '#E5E5E5',
|
|
180
|
-
lineHeight: 1.
|
|
181
|
-
lineHeightLG: 1.
|
|
182
|
-
lineHeightSM: 1.
|
|
180
|
+
lineHeight: 1.143,
|
|
181
|
+
lineHeightLG: 1.143,
|
|
182
|
+
lineHeightSM: 1.143,
|
|
183
183
|
itemHoverColor: (_w = THEME.token) === null || _w === void 0 ? void 0 : _w.colorPrimary,
|
|
184
184
|
},
|
|
185
185
|
Collapse: {
|