Skip to content
Open
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
8 changes: 8 additions & 0 deletions packages/semi-foundation/navigation/navigation.scss
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,14 @@ $module: #{$prefix}-navigation;
.#{$module}-collapse-btn {
text-overflow: ellipsis;
white-space: nowrap;
width: 100%;
display: flex;
&-inner {
flex: 1;
span{
margin-right: auto;
}
}
}
}
}
Expand Down
43 changes: 38 additions & 5 deletions packages/semi-ui/form/_story/Hook/hookDemo.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,11 @@ const UseFormApiDemo = () => {
};

const CustomStringify = values => {
return JSON.stringify(values, (k, v) => (v === undefined ? '__undefined' : v)).replace(
return JSON.stringify(
values,
(k, v) => (v === undefined ? '__undefined' : v),
2
).replace(
'"__undefined"',
'undefined'
);
Expand Down Expand Up @@ -97,15 +101,44 @@ const ComponentUsingFormApi = () => {
);
};



// const ComponentUsingFormState = () => {
// const formState = useFormState();
// return (
// <pre>
// <code style={{ wordBreak: 'break-all', width: 600, whiteSpace: 'normal' }}>{JSON.stringify(formState)}</code>
// {/* <code style={{wordBreak:'break-all', width: 600, whiteSpace: 'normal'}}>{CustomStringify(formState)}</code> */}
// </pre>
// );
// };
/** */
const ComponentUsingFormState = () => {
const formState = useFormState();
return (
<pre>
<code style={{ wordBreak: 'break-all', width: 600, whiteSpace: 'normal' }}>{JSON.stringify(formState)}</code>
{/* <code style={{wordBreak:'break-all', width: 600, whiteSpace: 'normal'}}>{CustomStringify(formState)}</code> */}
</pre>
<div
style={{
backgroundColor: '#f4f4f4',
borderRadius: '8px',
padding: '16px',
border: '1px solid #e0e0e0',
margin: '16px 0',
}}
>
<pre>
<code
style={{
fontSize: '14px',
lineHeight: '1.5',
color: '#333',
whiteSpace: 'pre-wrap',
wordBreak: 'break-all'
}}
>
{JSON.stringify(formState, null, 2)}
</code>
</pre>
</div>
);
};

Expand Down
2 changes: 1 addition & 1 deletion packages/semi-ui/navigation/CollapseButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export default function CollapseButton({ prefixCls, locale, collapseText, isColl
<Button {...(btnProps as any)} />
</Tooltip>
) : (
<Button {...(btnProps as any)}>{finalCollapseText}</Button>
<Button className={`${prefixCls}-collapse-btn-inner`} {...(btnProps as any)}>{finalCollapseText}</Button>
)}
</div>
);
Expand Down