label-value component Enable/disable ellipsize #364

This commit is contained in:
Joan Sanchez 2018-06-21 08:46:30 +02:00
parent 7f8ceb6d37
commit afe051883e
3 changed files with 17 additions and 5 deletions

View File

@ -22,7 +22,7 @@
<vn-label-value label="Mobile"
value="{{$ctrl.summary.mobile}}">
</vn-label-value>
<vn-label-value label="Email"
<vn-label-value label="Email" ellipsize="false"
value="{{$ctrl.summary.email}}">
</vn-label-value>
<vn-label-value label="Sales person"
@ -40,7 +40,7 @@
<vn-label-value label="NIF / CIF"
value="{{$ctrl.summary.fi}}">
</vn-label-value>
<vn-label-value label="Street"
<vn-label-value label="Street" ellipsize="false"
value="{{$ctrl.summary.street}}">
</vn-label-value>
<vn-label-value label="City"
@ -145,7 +145,7 @@
<vn-label-value label="Name"
value="{{$ctrl.summary.addresses[0].nickname}}">
</vn-label-value>
<vn-label-value label="Street"
<vn-label-value label="Street" ellipsize="false"
value="{{$ctrl.summary.addresses[0].street}}">
</vn-label-value>
<vn-label-value label="City"

View File

@ -1,4 +1,4 @@
<section class="ellipsize">
<section ng-class="{'ellipsize': $ctrl.__ellipsize}">
<vn-label translate>{{$ctrl.label}}:</vn-label>
<span title="{{$ctrl.value}}">{{$ctrl.value ? $ctrl.value : '-'}}</span>
</section>

View File

@ -1,12 +1,24 @@
import ngModule from '../../module';
import './style.scss';
export default class Controller {
constructor() {
this.__ellipsize = true;
}
set ellipsize(value) {
this.__ellipsize = value;
}
}
ngModule.component('vnLabelValue', {
template: require('./label-value.html'),
controller: Controller,
replace: true,
transclude: true,
bindings: {
label: '@',
value: '@'
value: '@',
ellipsize: '<?'
}
});