diff --git a/client/client/src/address-edit/address-edit.html b/client/client/src/address-edit/address-edit.html index 0497570af..c1b9cb20d 100644 --- a/client/client/src/address-edit/address-edit.html +++ b/client/client/src/address-edit/address-edit.html @@ -41,7 +41,7 @@ @@ -61,6 +61,7 @@ - - + diff --git a/client/core/src/components/icon-button/icon-button.html b/client/core/src/components/icon-button/icon-button.html index fdd022710..4bd8ad78a 100644 --- a/client/core/src/components/icon-button/icon-button.html +++ b/client/core/src/components/icon-button/icon-button.html @@ -1,5 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/client/core/src/components/icon-button/icon-button.js b/client/core/src/components/icon-button/icon-button.js index c257b9da9..5765fb249 100644 --- a/client/core/src/components/icon-button/icon-button.js +++ b/client/core/src/components/icon-button/icon-button.js @@ -1,6 +1,24 @@ import ngModule from '../../module'; +import './style.scss'; +export default class IconButton { + constructor($element) { + $element[0].tabIndex = 0; + $element.on("keyup", event => this.onKeyDown(event, $element)); + } + + onKeyDown(event, $element) { + if (event.defaultPrevented) return; + if (event.keyCode == 13) { + event.preventDefault(); + $element.triggerHandler('click'); + } + } +} + +IconButton.$inject = ['$element']; ngModule.component('vnIconButton', { + controller: IconButton, template: require('./icon-button.html'), bindings: { icon: '@', diff --git a/client/core/src/components/icon-button/style.scss b/client/core/src/components/icon-button/style.scss new file mode 100644 index 000000000..7754c871a --- /dev/null +++ b/client/core/src/components/icon-button/style.scss @@ -0,0 +1,17 @@ +vn-icon-button { + display: inline-block; + text-align: center; + color: rgba(#f7931e, 0.7); + transition: color 200ms ease-in-out; + cursor: pointer; + + & > i, + & > i.material-icons { + display: block; + font-size: inherit; + color: inherit; + } + &:hover { + color: #f7931e; + } +} diff --git a/client/item/src/barcode/barcode.html b/client/item/src/barcode/barcode.html index 6a77eacd0..f741c96f6 100644 --- a/client/item/src/barcode/barcode.html +++ b/client/item/src/barcode/barcode.html @@ -6,26 +6,27 @@ vn-three label="Code" model="barcode.code" - vn-acl="buyer, replenisher"> + vn-acl="buyer, replenisher" + vn-focus> - - + diff --git a/client/item/src/niche/niche.html b/client/item/src/niche/niche.html index 0d296a30f..8c4b4b5ee 100644 --- a/client/item/src/niche/niche.html +++ b/client/item/src/niche/niche.html @@ -10,6 +10,7 @@ - - + diff --git a/client/ticket/src/note/ticket-observation.html b/client/ticket/src/note/ticket-observation.html index 7ca256760..5c683ba09 100644 --- a/client/ticket/src/note/ticket-observation.html +++ b/client/ticket/src/note/ticket-observation.html @@ -14,6 +14,7 @@ - - + diff --git a/client/ticket/src/package/index/package.html b/client/ticket/src/package/index/package.html index d1838924e..3f3130f62 100644 --- a/client/ticket/src/package/index/package.html +++ b/client/ticket/src/package/index/package.html @@ -16,6 +16,7 @@ - - +