Skip to content

Commit

Permalink
fix(components): remove hashid empty
Browse files Browse the repository at this point in the history
  • Loading branch information
chenshuai2144 committed Jun 11, 2023
1 parent 2a61001 commit b46bb80
Show file tree
Hide file tree
Showing 60 changed files with 2,458 additions and 2,408 deletions.
8 changes: 4 additions & 4 deletions packages/card/src/components/Card/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ const Card = React.forwardRef((props: CardProps, ref: any) => {
) : (
<RightOutlined
rotate={!collapsed ? 90 : undefined}
className={`${prefixCls}-collapsible-icon ${hashId}`}
className={`${prefixCls}-collapsible-icon ${hashId}`.trim()}
/>
));

Expand All @@ -246,7 +246,7 @@ const Card = React.forwardRef((props: CardProps, ref: any) => {
if (collapsibleButton) setCollapsed(!collapsed);
}}
>
<div className={`${prefixCls}-title ${hashId}`}>
<div className={`${prefixCls}-title ${hashId}`.trim()}>
{collapsibleButton}
<LabelIconTip
label={title}
Expand All @@ -255,12 +255,12 @@ const Card = React.forwardRef((props: CardProps, ref: any) => {
/>
</div>
{extra && (
<div className={`${prefixCls}-extra ${hashId}`}>{extra}</div>
<div className={`${prefixCls}-extra ${hashId}`.trim()}>{extra}</div>
)}
</div>
)}
{tabs ? (
<div className={`${prefixCls}-tabs ${hashId}`}>
<div className={`${prefixCls}-tabs ${hashId}`.trim()}>
<Tabs
onChange={tabs.onChange}
{...tabs}
Expand Down
16 changes: 10 additions & 6 deletions packages/card/src/components/CheckCard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ const CheckCard: React.FC<CheckCardProps> & {
}

const avatarDom = avatar ? (
<div className={`${prefixCls}-avatar ${hashId}`}>
<div className={`${prefixCls}-avatar ${hashId}`.trim()}>
{typeof avatar === 'string' ? (
<Avatar size={48} shape="square" src={avatar} />
) : (
Expand All @@ -245,14 +245,18 @@ const CheckCard: React.FC<CheckCardProps> & {
) : null;

const headerDom = (title ?? extra) != null && (
<div className={`${prefixCls}-header ${hashId}`}>
<div className={`${prefixCls}-title ${hashId}`}>{title}</div>
{extra && <div className={`${prefixCls}-extra ${hashId}`}>{extra}</div>}
<div className={`${prefixCls}-header ${hashId}`.trim()}>
<div className={`${prefixCls}-title ${hashId}`.trim()}>{title}</div>
{extra && (
<div className={`${prefixCls}-extra ${hashId}`.trim()}>{extra}</div>
)}
</div>
);

const descriptionDom = description ? (
<div className={`${prefixCls}-description ${hashId}`}>{description}</div>
<div className={`${prefixCls}-description ${hashId}`.trim()}>
{description}
</div>
) : null;

const metaClass = classNames(`${prefixCls}-content`, hashId, {
Expand All @@ -263,7 +267,7 @@ const CheckCard: React.FC<CheckCardProps> & {
<div className={metaClass}>
{avatarDom}
{headerDom || descriptionDom ? (
<div className={`${prefixCls}-detail ${hashId}`}>
<div className={`${prefixCls}-detail ${hashId}`.trim()}>
{headerDom}
{descriptionDom}
</div>
Expand Down
4 changes: 2 additions & 2 deletions packages/card/src/components/Statistic/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ const Statistic: React.FC<StatisticProps> = (props) => {

const tipDom = tip && (
<Tooltip title={tip}>
<QuestionCircleOutlined className={`${prefixCls}-tip ${hashId}`} />
<QuestionCircleOutlined className={`${prefixCls}-tip ${hashId}`.trim()} />
</Tooltip>
);

Expand Down Expand Up @@ -116,7 +116,7 @@ const Statistic: React.FC<StatisticProps> = (props) => {
{...others}
/>
{description && (
<div className={`${prefixCls}-description ${hashId}`}>
<div className={`${prefixCls}-description ${hashId}`.trim()}>
{description as React.ReactNode}
</div>
)}
Expand Down
2 changes: 1 addition & 1 deletion packages/card/src/components/StatisticCard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ const StatisticCard: React.FC<StatisticCardProps> & {
));

const footerDom = footer && (
<div className={`${prefixCls}-footer ${hashId}`}>{footer}</div>
<div className={`${prefixCls}-footer ${hashId}`.trim()}>{footer}</div>
);

return wrapSSR(
Expand Down
2 changes: 1 addition & 1 deletion packages/form/src/components/Group/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ const Group: React.FC<GroupProps> = React.forwardRef((props, ref: any) => {
{hiddenDoms}
{(title || tooltip || extra) && (
<div
className={`${className}-title ${hashId}`}
className={`${className}-title ${hashId}`.trim()}
style={titleStyle}
onClick={() => {
setCollapsed(!collapsed);
Expand Down
2 changes: 1 addition & 1 deletion packages/form/src/components/List/ListContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ const ProFormListContainer: React.FC<ProFormListItemProps> = (props) => {
} = creatorButtonProps || {};
return (
<Button
className={`${prefixCls}-creator-button-${position} ${hashId}`}
className={`${prefixCls}-creator-button-${position} ${hashId}`.trim()}
type="dashed"
loading={loading}
block
Expand Down
10 changes: 5 additions & 5 deletions packages/form/src/components/List/ListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ const ProFormListItem: React.FC<
<Tooltip title={tooltipText} key="copy">
<Spin spinning={loadingCopy}>
<Icon
className={`${prefixCls}-action-icon action-copy ${hashId}`}
className={`${prefixCls}-action-icon action-copy ${hashId}`.trim()}
onClick={async () => {
setLoadingCopy(true);
const row = formInstance?.getFieldValue(
Expand Down Expand Up @@ -395,7 +395,7 @@ const ProFormListItem: React.FC<
<Tooltip title={tooltipText} key="delete">
<Spin spinning={loadingRemove}>
<Icon
className={`${prefixCls}-action-icon action-remove ${hashId}`}
className={`${prefixCls}-action-icon action-remove ${hashId}`.trim()}
onClick={async () => {
setLoadingRemove(true);
await action.remove(field.name);
Expand Down Expand Up @@ -431,7 +431,7 @@ const ProFormListItem: React.FC<

const dom =
actions.length > 0 ? (
<div className={`${prefixCls}-action ${hashId}`}>{actions}</div>
<div className={`${prefixCls}-action ${hashId}`.trim()}>{actions}</div>
) : null;

const options = {
Expand All @@ -457,7 +457,7 @@ const ProFormListItem: React.FC<
{
listDom: (
<div
className={`${prefixCls}-container ${containerClassName} ${hashId}`}
className={`${prefixCls}-container ${containerClassName} ${hashId}`.trim()}
style={{
width: grid ? '100%' : undefined,
...containerStyle,
Expand All @@ -480,7 +480,7 @@ const ProFormListItem: React.FC<
}}
>
<div
className={`${prefixCls}-container ${containerClassName} ${hashId}`}
className={`${prefixCls}-container ${containerClassName} ${hashId}`.trim()}
style={{
width: grid ? '100%' : undefined,
...containerStyle,
Expand Down
13 changes: 8 additions & 5 deletions packages/form/src/layouts/LightFilter/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ const LightFilterContainer: React.FC<{
if (collapse) {
return (
<FilterOutlined
className={`${lightFilterClassName}-collapse-icon ${hashId}`}
className={`${lightFilterClassName}-collapse-icon ${hashId}`.trim()}
/>
);
}
Expand All @@ -145,7 +145,7 @@ const LightFilterContainer: React.FC<{
},
)}
>
<div className={`${lightFilterClassName}-container ${hashId}`}>
<div className={`${lightFilterClassName}-container ${hashId}`.trim()}>
{outsideItems.map((child: any, index) => {
const { key } = child;
const { fieldProps } = child.props;
Expand All @@ -154,7 +154,7 @@ const LightFilterContainer: React.FC<{
: placement;
return (
<div
className={`${lightFilterClassName}-item ${hashId}`}
className={`${lightFilterClassName}-item ${hashId}`.trim()}
key={key || index}
>
{React.cloneElement(child, {
Expand All @@ -175,7 +175,10 @@ const LightFilterContainer: React.FC<{
);
})}
{collapseItems.length ? (
<div className={`${lightFilterClassName}-item ${hashId}`} key="more">
<div
className={`${lightFilterClassName}-item ${hashId}`.trim()}
key="more"
>
<FilterDropdown
padding={24}
open={open}
Expand Down Expand Up @@ -224,7 +227,7 @@ const LightFilterContainer: React.FC<{
: placement;
return (
<div
className={`${lightFilterClassName}-line ${hashId}`}
className={`${lightFilterClassName}-line ${hashId}`.trim()}
key={key}
>
{React.cloneElement(child, {
Expand Down
2 changes: 1 addition & 1 deletion packages/form/src/layouts/LoginForm/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ function LoginForm<T = Record<string, any>>(props: Partial<LoginFormProps<T>>) {

return wrapSSR(
<div className={classNames(getCls('container'), hashId)}>
<div className={`${getCls('top')} ${hashId}`}>
<div className={`${getCls('top')} ${hashId}`.trim()}>
{title || logoDom ? (
<div className={`${getCls('header')}`}>
{logoDom ? <span className={getCls('logo')}>{logoDom}</span> : null}
Expand Down
2 changes: 1 addition & 1 deletion packages/form/src/layouts/QueryFilter/Actions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ const Actions: React.FC<ActionsProps> = (props) => {
<a
className={`${getPrefixCls(
'pro-query-filter-collapse-button',
)} ${hashId}`}
)} ${hashId}`.trim()}
onClick={() => setCollapsed(!collapsed)}
>
{collapseRender?.(collapsed, props, intl, hiddenNum)}
Expand Down
6 changes: 3 additions & 3 deletions packages/form/src/layouts/QueryFilter/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ const QueryFilterContent: React.FC<{
<Col
key={itemKey}
span={colSpan}
className={`${props.baseClassName}-row-split-line ${props.baseClassName}-row-split ${hashId}`}
className={`${props.baseClassName}-row-split-line ${props.baseClassName}-row-split ${hashId}`.trim()}
>
{itemDom}
</Col>
Expand All @@ -409,7 +409,7 @@ const QueryFilterContent: React.FC<{
return (
<Col
key={itemKey}
className={`${props.baseClassName}-row-split ${hashId}`}
className={`${props.baseClassName}-row-split ${hashId}`.trim()}
span={colSpan}
>
{itemDom}
Expand Down Expand Up @@ -465,7 +465,7 @@ const QueryFilterContent: React.FC<{
<Form.Item
label=" "
colon={false}
className={`${baseClassName}-actions ${hashId}`}
className={`${baseClassName}-actions ${hashId}`.trim()}
>
<Actions
hiddenNum={hiddenNum}
Expand Down
4 changes: 2 additions & 2 deletions packages/form/src/layouts/StepsForm/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ function StepsForm<T = Record<string, any>>(

return (
<div
className={`${prefixCls}-steps-container ${hashId}`}
className={`${prefixCls}-steps-container ${hashId}`.trim()}
style={{
maxWidth: Math.min(formArray.length * 320, 1160),
}}
Expand Down Expand Up @@ -467,7 +467,7 @@ function StepsForm<T = Record<string, any>>(
const formContainer = useMemo(
() => (
<div
className={`${prefixCls}-container ${hashId}`}
className={`${prefixCls}-container ${hashId}`.trim()}
style={containerStyle}
>
{formDom}
Expand Down
2 changes: 1 addition & 1 deletion packages/layout/src/ProLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -816,7 +816,7 @@ const BaseProLayout: React.FC<ProLayoutProps> = (props) => {
</ConfigProvider>
<div
style={genLayoutStyle}
className={`${proLayoutClassName}-container ${hashId}`}
className={`${proLayoutClassName}-container ${hashId}`.trim()}
>
<ConfigProvider
// @ts-ignore
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ export const DefaultContent: React.FC<{
}> = (props) => {
const { appList, baseClassName, hashId, itemClick } = props;
return (
<div className={`${baseClassName}-content ${hashId}`}>
<ul className={`${baseClassName}-content-list ${hashId}`}>
<div className={`${baseClassName}-content ${hashId}`.trim()}>
<ul className={`${baseClassName}-content-list ${hashId}`.trim()}>
{appList?.map((app, index) => {
if (app?.children?.length) {
return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,18 @@ export const SimpleContent: React.FC<{
}> = (props) => {
const { appList, baseClassName, hashId, itemClick } = props;
return (
<div className={`${baseClassName}-content ${hashId}`}>
<ul className={`${baseClassName}-content-list ${hashId}`}>
<div className={`${baseClassName}-content ${hashId}`.trim()}>
<ul className={`${baseClassName}-content-list ${hashId}`.trim()}>
{appList?.map((app, index) => {
if (app?.children?.length) {
return (
<div
// eslint-disable-next-line react/no-array-index-key
key={index}
className={`${baseClassName}-content-list-item-group ${hashId}`}
className={`${baseClassName}-content-list-item-group ${hashId}`.trim()}
>
<div
className={`${baseClassName}-content-list-item-group-title ${hashId}`}
className={`${baseClassName}-content-list-item-group-title ${hashId}`.trim()}
>
{app.title}
</div>
Expand All @@ -68,7 +68,7 @@ export const SimpleContent: React.FC<{
<li
// eslint-disable-next-line react/no-array-index-key
key={index}
className={`${baseClassName}-content-list-item ${hashId}`}
className={`${baseClassName}-content-list-item ${hashId}`.trim()}
>
<a
href={itemClick ? 'javascript:;' : app.url}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export const AppsLogoComponents: React.FC<{
zIndex={9999}
arrow={false}
{...popoverOpenProps}
overlayClassName={`${baseClassName}-popover ${hashId}`}
overlayClassName={`${baseClassName}-popover ${hashId}`.trim()}
content={popoverContent}
getPopupContainer={() => ref.current || document.body}
>
Expand Down
6 changes: 4 additions & 2 deletions packages/layout/src/components/FooterToolbar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,10 @@ const FooterToolbar: React.FC<FooterToolbarProps> = (props) => {
});
const dom = (
<>
<div className={`${baseClassName}-left ${hashId}`}>{extra}</div>
<div className={`${baseClassName}-right ${hashId}`}>{children}</div>
<div className={`${baseClassName}-left ${hashId}`.trim()}>{extra}</div>
<div className={`${baseClassName}-right ${hashId}`.trim()}>
{children}
</div>
</>
);

Expand Down
6 changes: 3 additions & 3 deletions packages/layout/src/components/GlobalFooter/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ const GlobalFooter = ({
return wrapSSR(
<div className={classNames(baseClassName, hashId, className)} style={style}>
{links && (
<div className={`${baseClassName}-list ${hashId}`}>
<div className={`${baseClassName}-list ${hashId}`.trim()}>
{links.map((link) => (
<a
className={`${baseClassName}-list-link ${hashId}`}
className={`${baseClassName}-list-link ${hashId}`.trim()}
key={link.key}
title={link.key}
target={link.blankTarget ? '_blank' : '_self'}
Expand All @@ -59,7 +59,7 @@ const GlobalFooter = ({
</div>
)}
{copyright && (
<div className={`${baseClassName}-copyright ${hashId}`}>
<div className={`${baseClassName}-copyright ${hashId}`.trim()}>
{copyright}
</div>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export const ActionsContent: React.FC<GlobalHeaderProps> = ({
if (!doms && !avatarDom) return null;
if (!Array.isArray(doms)) doms = [doms];
return wrapSSR(
<div className={`${prefixCls}-header-actions ${hashId}`}>
<div className={`${prefixCls}-header-actions ${hashId}`.trim()}>
{doms.filter(Boolean).map((dom, index) => {
let hideHover = false;
// 如果配置了 hideHover 就不展示 hover 效果了
Expand All @@ -79,7 +79,7 @@ export const ActionsContent: React.FC<GlobalHeaderProps> = ({
})}
{avatarDom && (
<span
className={`${prefixCls}-header-actions-avatar ${hashId}`}
className={`${prefixCls}-header-actions-avatar ${hashId}`.trim()}
>
{avatarDom}
</span>
Expand All @@ -96,7 +96,7 @@ export const ActionsContent: React.FC<GlobalHeaderProps> = ({
const contentRender = rightActionsRender || rightContentRender;
return (
<div
className={`${prefixCls}-right-content ${hashId}`}
className={`${prefixCls}-right-content ${hashId}`.trim()}
style={{
minWidth: rightSize,
height: '100%',
Expand Down
Loading

0 comments on commit b46bb80

Please sign in to comment.