Skip to content

Commit

Permalink
fix: 修复下钻 icon 不应该默认全部展示和标题样式问题 (#2925)
Browse files Browse the repository at this point in the history
* fix: 修复下钻 icon 不应该默认全部展示

* fix: 修复下钻面板标题不展示

* fix: 移除 extra dom 节点

* test: 更新快照

* test: 更新快照
  • Loading branch information
lijinke666 authored Oct 17, 2024
1 parent 5eed119 commit 55f1a40
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,6 @@ exports[`DrillDown Component Tests should render component 1`] = `
</span>
</span>
</span>
<div
class="antv-s2-drill-down-extra"
>
extra
</div>
<div
class="css-dev-only-do-not-override-3rel02 ant-empty antv-s2-drill-down-empty"
>
Expand Down Expand Up @@ -144,6 +139,7 @@ exports[`DrillDown Component Tests should render component 1`] = `
No data
</div>
</div>
extra
<ul
class="ant-menu ant-menu-root ant-menu-vertical ant-menu-light antv-s2-drill-down-menu css-dev-only-do-not-override-3rel02"
data-menu-list="true"
Expand Down
2 changes: 1 addition & 1 deletion packages/s2-react/playground/drill-down.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const partDrillDown: PartDrillDown = {
type: 'text',
},
],
extra: <div>test</div>,
extra: <div style={{ margin: '4px 16px' }}>test</div>,
},
// drillItemsNum: 1,
fetchData: (meta, drillFields) =>
Expand Down
2 changes: 1 addition & 1 deletion packages/s2-react/src/components/drill-down/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,13 @@ export const DrillDown: React.FC<DrillDownProps> = React.memo(
prefix={<SearchIcon />}
allowClear
/>
<div className={`${DRILL_DOWN_PRE_CLASS}-extra`}>{extra}</div>
{isEmpty(options) && (
<Empty
imageStyle={{ height: '64px' }}
className={`${DRILL_DOWN_PRE_CLASS}-empty`}
/>
)}
{extra}
<Menu
className={`${DRILL_DOWN_PRE_CLASS}-menu`}
selectedKeys={drillFields}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Object {
"headerActionIcons": Array [
Object {
"belongsCell": "rowCell",
"defaultHide": false,
"defaultHide": true,
"displayCondition": [Function],
"icons": Array [
Object {
Expand Down
6 changes: 1 addition & 5 deletions packages/s2-shared/src/styles/drill-down.less
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
width: 260px;
min-height: 20px;
position: relative;
color: var(--antv-s2-font-70, #fff);
color: var(--antv-s2-font-70, rgba(0, 0, 0, 0.9));

&-header {
display: flex;
Expand Down Expand Up @@ -42,10 +42,6 @@
}
}

&-extra {
margin: 4px 16px;
}

&-menu {
max-height: 314px;
overflow: hidden auto;
Expand Down
2 changes: 1 addition & 1 deletion packages/s2-shared/src/utils/drill-down.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ export const buildDrillDownOptions = <T extends Omit<S2Options, 'tooltip'>>(
},
],
belongsCell: 'rowCell',
defaultHide: false,
defaultHide: true,
displayCondition:
partDrillDown?.displayCondition || defaultPartDrillDownDisplayCondition,
};
Expand Down

0 comments on commit 55f1a40

Please sign in to comment.