elipses
This commit is contained in:
1 parent
819a76f8e3
commit
f8f6d74d6a
4 files changed
+24
-14
No files matched your search
@@ -39,6 +39,10 @@ const { make, componentMeta } = makeStory({
|
||||
export default componentMeta;
|
||||
|
||||
export const Basic = make({});
|
||||
export const LongDescription = make({
|
||||
description:
|
||||
"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.",
|
||||
});
|
||||
export const IsSelected = make({ isSelected: true });
|
||||
export const InvalidState = make({ state: "unavailable" });
|
||||
export const WithIssue = make({ issue: "look at me" });
|
||||
|
||||
@@ -2,16 +2,6 @@
|
||||
max-height: 2em;
|
||||
}
|
||||
|
||||
.input-text-view.view span {
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
word-break: break-all;
|
||||
word-wrap: break-word;
|
||||
line-break: loose;
|
||||
overflow-wrap: break-word;
|
||||
}
|
||||
|
||||
.input-text-view.edit .MuiFilledInput-input {
|
||||
padding-top: 0.5em;
|
||||
padding-bottom: 0.5em;
|
||||
|
||||
@@ -32,11 +32,13 @@ export const InputTextView: FC<PropsWithChildren<InputTextViewProps>> = (
|
||||
onClick={() => !props.disabled && setViewMode(false)}
|
||||
>
|
||||
{!!props.value ? (
|
||||
<span>{props.value}</span>
|
||||
<div className="input-text-view--text text-ellipsis">
|
||||
<span>{props.value}</span>
|
||||
</div>
|
||||
) : (
|
||||
<span className="input-text-view--placeholder">
|
||||
{props.placeholder}
|
||||
</span>
|
||||
<div className="input-text-view--text input-text-view--placeholder text-ellipsis">
|
||||
<span>{props.placeholder}</span>
|
||||
</div>
|
||||
)}
|
||||
{!props.disabled && (
|
||||
<ModeEditOutlineOutlinedIcon className="input-text-view--edit" />
|
||||
|
||||
@@ -60,4 +60,18 @@ body,
|
||||
.row {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
}
|
||||
|
||||
|
||||
.text-ellipsis {
|
||||
display: table;
|
||||
table-layout: fixed;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.text-ellipsis span, a, h1, h2, h3, h4, h5, h6 {
|
||||
display: table-cell;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
}
|
||||
Reference in new issue
Block a user