Skip to content

Commit afbdea8

Browse files
authored
Merge pull request #1561 from easyops-cn/steve/actions-opened-keys
Steve/actions-opened-keys
2 parents d05ad66 + 9f36b18 commit afbdea8

File tree

4 files changed

+18
-3
lines changed

4 files changed

+18
-3
lines changed

bricks/basic/src/actions/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ function SubMenuItemCom({
5353
const popoverRef = useRef<Popover>(null);
5454
const [checked, opened] = useMemo(() => {
5555
let keyIndex = -1;
56-
if (activeKeys && action.key) {
56+
if (activeKeys && action.key != null) {
5757
for (let i = 0; i < activeKeys.length; i++) {
5858
if (activeKeys[i] === action.key) {
5959
keyIndex = i;
@@ -245,7 +245,7 @@ class EoActions extends ReactNextElement implements ActionsProps {
245245
accessor checkedKeys: (string | number)[] = [];
246246

247247
/**
248-
* actions 激活项配置,用于菜单项的选择和展开,因按菜单层级顺序依次列出当前激活的菜单项
248+
* actions 激活项配置,用于菜单项的选择和展开,需按菜单层级顺序依次列出当前激活的菜单项
249249
*/
250250
@property({
251251
attribute: false,

bricks/basic/src/button/button.shadow.css

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,19 @@ button:active {
281281
border: 1px solid var(--antd-btn-default-border);
282282
}
283283

284+
/* flat [不带任何品牌色,单纯浅色背景,不带边框] */
285+
286+
.flat {
287+
color: var(--antd-btn-default-color);
288+
background: rgba(0, 0, 0, 0.04);
289+
border: 1px solid transparent;
290+
}
291+
292+
.flat:hover {
293+
background-color: rgba(0, 0, 0, 0.06);
294+
border: 1px solid transparent;
295+
}
296+
284297
.icon {
285298
background: var(--palette-gray-3);
286299
border: 1px solid transparent;

bricks/basic/src/constants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export const ALLOWED_BUTTON_TYPES = [
77
"text",
88
"icon",
99
"neutral",
10+
"flat",
1011
] as const;
1112

1213
export const ALLOWED_COMPONENT_SIZES = [

bricks/basic/src/interface.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ export type ButtonType =
2424
| "link"
2525
| "text"
2626
| "icon"
27-
| "neutral";
27+
| "neutral"
28+
| "flat";
2829

2930
export type ComponentSize = "large" | "medium" | "small" | "xs";
3031

0 commit comments

Comments
 (0)