Skip to content

Commit

Permalink
wrap editable list values (#212)
Browse files Browse the repository at this point in the history
  • Loading branch information
lghiur authored Dec 8, 2021
1 parent b8470dd commit f58ade2
Show file tree
Hide file tree
Showing 17 changed files with 29 additions and 15 deletions.
2 changes: 1 addition & 1 deletion lib/index.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/index.js.map

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,15 @@

&-cell {
border-left: 1px solid theme-color('default', 'light');
overflow: hidden;
padding: 0 10px;

.tyk-form-control--readonly {
overflow: hidden;
text-overflow: ellipsis;
word-break: break-all;
}

&:first-child {
border-left: none;
padding-left: 15px;
Expand Down
2 changes: 1 addition & 1 deletion lib/tyk-ui.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/tyk-ui.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/tyk-ui.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tyk-technologies/tyk-ui",
"version": "2.2.10",
"version": "2.2.11",
"description": "Tyk UI - ui reusable components",
"main": "lib/index.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion src/form/components/Combobox2/js/Value.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ function Value(props) {
}, [focus]);

if (readOnly) {
return <div>{textValue(value.map(v => v.name).join(', '))}</div>;
return <div className="tyk-form-control--readonly">{textValue(value.map(v => v.name).join(', '))}</div>;
}

if (tags) return getTags();
Expand Down
2 changes: 1 addition & 1 deletion src/form/components/DatePicker/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ const DatePicker = (props) => {
</div>
)
}
<div>
<div className="tyk-form-control--readonly">
{readOnly && !value && '-'}
{readOnly && value && format(value, config.dateFormat || 'd/m/Y')}
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/form/components/EditableList2/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@
]
],
[
"aaaaa",
"407408718192.apps.googleusercontent.com",
[
{
"id": "333",
Expand Down
7 changes: 7 additions & 0 deletions src/form/components/EditableList2/sass/EditableList2.scss
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,15 @@

&-cell {
border-left: 1px solid theme-color('default', 'light');
overflow: hidden;
padding: 0 10px;

.tyk-form-control--readonly {
overflow: hidden;
text-overflow: ellipsis;
word-break: break-all;
}

&:first-child {
border-left: none;
padding-left: 15px;
Expand Down
2 changes: 1 addition & 1 deletion src/form/components/Input/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ export default class Input extends Component {
</div>
)}
{
readOnly && <div>{value || '-'}</div>
readOnly && <div className="tyk-form-control--readonly">{value || '-'}</div>
}
</div>
);
Expand Down
2 changes: 1 addition & 1 deletion src/form/components/Input2/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ const Input2 = ({
)}
{
readOnly && (
<div>
<div className="tyk-form-control--readonly">
{value || '-'}
</div>
)
Expand Down
2 changes: 1 addition & 1 deletion src/form/components/Select/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ export default class Select extends Component {
{ this.getSelectError() }
</div>
)}
{readOnly && <div>{value || '-'}</div>}
{readOnly && <div className="tyk-form-control--readonly">{value || '-'}</div>}
</div>
</Fragment>
);
Expand Down
2 changes: 1 addition & 1 deletion src/form/components/StringBuilder/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ const StringBuilder = (props) => {
</div>
)}
{
readOnly && <div>{value || '-'}</div>
readOnly && <div className="tyk-form-control--readonly">{value || '-'}</div>
}
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/form/components/Textarea/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export default class Textarea extends Component {
{this.getTextareaError()}
</div>
)}
{readOnly && <div>{value || '-'}</div>}
{readOnly && <div className="tyk-form-control--readonly">{value || '-'}</div>}
</div>
</Fragment>
);
Expand Down

0 comments on commit f58ade2

Please sign in to comment.