Watchers from vnLabelValue removed
This commit is contained in:
parent
c123207ac2
commit
6f07ae3c5c
|
@ -1,4 +1,4 @@
|
||||||
<section ng-class="{'ellipsize': $ctrl.__ellipsize}">
|
<section class="ellipsize">
|
||||||
<vn-label translate>{{$ctrl.label}}:</vn-label>
|
<vn-label></vn-label>
|
||||||
<span title="{{$ctrl.value}}">{{$ctrl.value ? $ctrl.value : '-'}}</span>
|
<span></span>
|
||||||
</section>
|
</section>
|
|
@ -2,23 +2,35 @@ import ngModule from '../../module';
|
||||||
import './style.scss';
|
import './style.scss';
|
||||||
|
|
||||||
export default class Controller {
|
export default class Controller {
|
||||||
constructor() {
|
constructor($element, $translate) {
|
||||||
this.__ellipsize = true;
|
this.element = $element[0];
|
||||||
|
this._ = $translate;
|
||||||
}
|
}
|
||||||
|
set label(value) {
|
||||||
set ellipsize(value) {
|
let label = this.element.querySelector('vn-label');
|
||||||
this.__ellipsize = value;
|
label.textContent = this._.instant(value) + ':';
|
||||||
|
this._label = value;
|
||||||
|
}
|
||||||
|
get label() {
|
||||||
|
return this._label;
|
||||||
|
}
|
||||||
|
set value(value) {
|
||||||
|
let span = this.element.querySelector('span');
|
||||||
|
span.title = value;
|
||||||
|
span.textContent = value ? value : '-';
|
||||||
|
this._value = value;
|
||||||
|
}
|
||||||
|
get value() {
|
||||||
|
return this._value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Controller.$inject = ['$element', '$translate'];
|
||||||
|
|
||||||
ngModule.component('vnLabelValue', {
|
ngModule.component('vnLabelValue', {
|
||||||
template: require('./label-value.html'),
|
|
||||||
controller: Controller,
|
controller: Controller,
|
||||||
replace: true,
|
template: require('./label-value.html'),
|
||||||
transclude: true,
|
|
||||||
bindings: {
|
bindings: {
|
||||||
label: '@',
|
label: '@',
|
||||||
value: '@',
|
value: '@'
|
||||||
ellipsize: '<?'
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,11 +1,10 @@
|
||||||
@import "colors";
|
@import "colors";
|
||||||
|
|
||||||
vn-label-value {
|
vn-label-value > section {
|
||||||
& vn-label {
|
& > vn-label {
|
||||||
color: $secondary-font-color;
|
color: $secondary-font-color;
|
||||||
}
|
}
|
||||||
|
& > span {
|
||||||
& span {
|
|
||||||
color: $main-font-color;
|
color: $main-font-color;
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -200,7 +200,11 @@ vn-main-block {
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
color: inherit;
|
color: inherit;
|
||||||
|
|
||||||
& > vn-horizontal > .buttons {
|
& > vn-horizontal {
|
||||||
|
& > vn-one {
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
& > .buttons {
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
vn-icon {
|
vn-icon {
|
||||||
|
@ -215,6 +219,7 @@ vn-main-block {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** START - FORM ELEMENTS DISABLED **/
|
/** START - FORM ELEMENTS DISABLED **/
|
||||||
|
@ -237,5 +242,4 @@ fieldset[disabled] .mdl-textfield .mdl-textfield__label,
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
max-width: 20em
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue