addon/components/bsy-input.js in bootstrap-bookingsync-sass-1.0.4 vs addon/components/bsy-input.js in bootstrap-bookingsync-sass-1.0.5
- old
+ new
@@ -1,13 +1,31 @@
import Ember from 'ember';
import layout from '../templates/components/bsy-input';
-const BsyInputComponent = Ember.Component.extend({
+const { Component, computed } = Ember;
+
+const BsyInputComponent = Component.extend({
layout,
tagName: "div",
classNames: "form-group",
type: "text",
- classNameBindings: ["value:filled"]
+ classNameBindings: ["value:filled", "icon:has-icon"],
+ size: null, // sm, lg
+
+ inputClassNames: computed('size', function () {
+ const size = this.get('size');
+ if (size) {
+ return `form-control input-${size}`;
+ }
+ return "form-control";
+ }),
+
+ iconSize: computed('size', function () {
+ const size = this.get('size');
+ if (size) {
+ return `icon--${size}`;
+ }
+ })
});
BsyInputComponent.reopenClass({
positionalParams: ['value']
});