diff --git a/client/core/src/components/label-value/label-value.html b/client/core/src/components/label-value/label-value.html index af85cfced..ab7cdbc28 100644 --- a/client/core/src/components/label-value/label-value.html +++ b/client/core/src/components/label-value/label-value.html @@ -1,4 +1,4 @@ -
- {{$ctrl.label}}: - {{$ctrl.value ? $ctrl.value : '-'}} +
+ +
\ No newline at end of file diff --git a/client/core/src/components/label-value/label-value.js b/client/core/src/components/label-value/label-value.js index 1c1b9ac28..73a241b4e 100644 --- a/client/core/src/components/label-value/label-value.js +++ b/client/core/src/components/label-value/label-value.js @@ -2,23 +2,35 @@ import ngModule from '../../module'; import './style.scss'; export default class Controller { - constructor() { - this.__ellipsize = true; + constructor($element, $translate) { + this.element = $element[0]; + this._ = $translate; } - - set ellipsize(value) { - this.__ellipsize = value; + set label(value) { + let label = this.element.querySelector('vn-label'); + 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', { - template: require('./label-value.html'), controller: Controller, - replace: true, - transclude: true, + template: require('./label-value.html'), bindings: { label: '@', - value: '@', - ellipsize: ' section { + & > vn-label { color: $secondary-font-color; } - - & span { + & > span { color: $main-font-color; } } \ No newline at end of file diff --git a/client/salix/src/styles/misc.scss b/client/salix/src/styles/misc.scss index cd285bd0e..4e311df21 100644 --- a/client/salix/src/styles/misc.scss +++ b/client/salix/src/styles/misc.scss @@ -200,21 +200,26 @@ vn-main-block { text-decoration: none; color: inherit; - & > vn-horizontal > .buttons { - align-items: center; + & > vn-horizontal { + & > vn-one { + overflow: hidden; + } + & > .buttons { + align-items: center; - vn-icon { - opacity: .4; - color: $main-01; - margin-left: .5em; - transition: opacity 250ms ease-out; - font-size: 2em; + vn-icon { + opacity: .4; + color: $main-01; + margin-left: .5em; + transition: opacity 250ms ease-out; + font-size: 2em; - &:hover { - opacity: 1; + &:hover { + opacity: 1; + } } } - } + } } /** START - FORM ELEMENTS DISABLED **/ @@ -237,5 +242,4 @@ fieldset[disabled] .mdl-textfield .mdl-textfield__label, text-overflow: ellipsis; white-space: nowrap; overflow: hidden; - max-width: 20em } \ No newline at end of file