Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 修复下钻 icon 不应该默认全部展示和标题样式问题 #2925

Merged
merged 5 commits into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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));
wjgogogo marked this conversation as resolved.
Show resolved Hide resolved

&-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,
wjgogogo marked this conversation as resolved.
Show resolved Hide resolved
displayCondition:
partDrillDown?.displayCondition || defaultPartDrillDownDisplayCondition,
};
Expand Down
Loading