Skip to content

Commit 872ab0e

Browse files
committed
button overflow
1 parent d7ca5c5 commit 872ab0e

File tree

6 files changed

+39
-6
lines changed

6 files changed

+39
-6
lines changed

shesha-reactjs/src/components/mainLayout/styles/indexStyles.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,6 @@ export const GlobalSheshaStyles = createGlobalStyle`
147147
.sha-toolbar-btn-configurable {
148148
display: flex;
149149
align-items: center;
150-
max-width: 100%;
151150
span {
152151
max-width: 100%;
153152
overflow: hidden;

shesha-reactjs/src/components/mainLayout/styles/styles.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ export const useStyles = createStyles(({ css, cx, responsive, token, prefixCls }
156156
157157
.${prefixCls}-layout-sider-children {
158158
width: ${shaSiderExpandedWidth} !important;
159-
159+
z
160160
.logo {
161161
margin-top: ${layoutTriggerHeight} !important; // It should use a config
162162
}

shesha-reactjs/src/designer-components/button/configurableButton/index.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { useConfigurableActionDispatcher } from '@/providers/configurableActions
88
import { useAvailableConstantsData } from '@/providers/form/utils';
99
import { isNavigationActionConfiguration, useShaRouting, useTheme } from '@/index';
1010
import { useAsyncMemo } from '@/hooks/useAsyncMemo';
11+
import { useStyles } from './style';
1112
export interface IConfigurableButtonProps extends Omit<IButtonItem, 'style' | 'itemSubType'> {
1213
style?: CSSProperties;
1314
form: FormInstance<any>;
@@ -22,6 +23,7 @@ export const ConfigurableButton: FC<IConfigurableButtonProps> = props => {
2223
const dynamicContext = useActionDynamicContext(actionConfiguration);
2324

2425
const { theme } = useTheme();
26+
const { styles } = useStyles();
2527
const [loading, setLoading] = useState(false);
2628
const [isModal, setModal] = useState(false);
2729

@@ -73,7 +75,7 @@ export const ConfigurableButton: FC<IConfigurableButtonProps> = props => {
7375
danger={props.danger}
7476
icon={props.icon ? <ShaIcon iconName={props.icon as IconType} /> : undefined}
7577
iconPosition={props.iconPosition}
76-
className={classNames('sha-toolbar-btn sha-toolbar-btn-configurable')}
78+
className={classNames('sha-toolbar-btn sha-toolbar-btn-configurable', styles.configurableButton)}
7779
size={props?.size}
7880
disabled={buttonDisabled}
7981
style={{ ...props?.style, ...(isSameUrl && { background: theme.application.primaryColor, color: theme.text.default }) }}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { createStyles } from "@/styles";
2+
3+
export const useStyles = createStyles(({ css, cx }) => {
4+
const configurableButton = cx("flex-container", css`
5+
.sha-toolbar-btn-configurable {
6+
display: flex;
7+
align-items: center;
8+
max-width: 100%;
9+
span {
10+
max-width: 100%;
11+
overflow: hidden;
12+
text-overflow: ellipsis;
13+
white-space: nowrap;
14+
}
15+
16+
}
17+
`);
18+
return {
19+
configurableButton,
20+
};
21+
});

shesha-reactjs/src/designer-components/button/util.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,7 @@ export const defaultStyles = (prev): IStyleType => {
4444
blurRadius: 0,
4545
spreadRadius: 0,
4646
},
47-
// stylingBox: '{"paddingLeft":"15","paddingBottom":"4","paddingTop":"4","paddingRight":"15"}',
48-
dimensions: { width: prev.block ? '100%' : 'auto', height: '32px', minHeight: '0px', maxHeight: 'auto', minWidth: '0px', maxWidth: 'auto' }
47+
dimensions: { width: prev.block ? '100%' : 'auto', height: '32px', minHeight: '0px', maxHeight: 'auto', minWidth: '0px', maxWidth: '100%' }
4948
};
5049
};
5150

shesha-reactjs/src/designer-components/propertiesTabs/style.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,26 @@ export const useStyles = createStyles(({ css, cx, }) => {
88
`);
99

1010
const content = cx(css`
11-
1211
.ant-tabs-tab, .ant-tabs-nav-operations {
1312
height: 24px;
1413
}
1514
1615
.ant-tabs-tab {
1716
--ant-tabs-card-padding-sm: 0 8px;
1817
}
18+
19+
.sha-toolbar-btn-configurable, .ant-btn {
20+
display: flex;
21+
align-items: center;
22+
max-width: 100%;
23+
span {
24+
max-width: 100%;
25+
overflow: hidden;
26+
text-overflow: ellipsis;
27+
white-space: nowrap;
28+
}
29+
30+
}
1931
`);
2032

2133
return {

0 commit comments

Comments
 (0)