2220 - Added clearDisabled param
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Joan Sanchez 2020-06-05 13:14:14 +02:00
parent e25b87213b
commit 048f01305d
5 changed files with 35 additions and 1 deletions

View File

@ -13,7 +13,7 @@
</label>
</div>
<div class="icons pre">
<vn-icon
<vn-icon ng-show="::$ctrl.clearDisabled != true"
icon="clear"
translate-attr="{title: 'Clear'}"
ng-click="$ctrl.onClear($event)">

View File

@ -203,6 +203,7 @@ ngModule.vnComponent('vnField', {
type: '@?',
autocomplete: '@?',
placeholder: '@?',
clearDisabled: '<?',
value: '=?',
info: '@?',
required: '<?',

View File

@ -0,0 +1,24 @@
describe('Component vnField', () => {
let $element;
let controller;
beforeEach(ngModule('vnCore'));
beforeEach(inject(($compile, $rootScope) => {
$element = $compile(`<vn-textfield></vn-textfield>`)($rootScope);
controller = $element.controller('vnTextfield');
}));
afterEach(() => {
$element.remove();
});
// Remove this block
describe('clearDisabled binding', () => {
it(`should enable the show property`, () => {
controller.clearDisabled = true;
expect(controller.clearDisabled).toEqual(true);
});
});
});

View File

@ -1,5 +1,6 @@
import ngModule from '../../module';
import Field from '../field';
import './style.scss';
export default class Textarea extends Field {
constructor($element, $scope, $compile) {

View File

@ -0,0 +1,8 @@
.vn-textarea {
& > .container {
& > .icons {
display: flex;
align-items: flex-start;
}
}
}