Skip to content

Commit

Permalink
feat(props): added inputForTextClass prop
Browse files Browse the repository at this point in the history
custom "class" attribute for the input field. You can specify dynamic class.

re #90
  • Loading branch information
Ilya authored and Ilya committed Mar 17, 2019
1 parent b184378 commit ddb2c32
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 19 deletions.
1 change: 1 addition & 0 deletions src/component.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
:value="inputValue"
:placeholder="placeholder"
:style="inputForTextStyles"
:class="inputForTextClass"
:disabled="disableSearch || disabled"
:readonly="readonly"
type="text"
Expand Down
43 changes: 24 additions & 19 deletions src/props.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,33 @@ export default {
type: [Array, Object, String, Number, Boolean], // TODO set to null (any type) after issue fix
// required: true,
default: () => null,
note: 'value for v-model'
note: 'value for "v-model".'
},
items: {
type: [Array, String],
required: true,
note: 'array of suggestions (data fetched from backend, etc)'
note: 'array of suggestions (data fetched from backend, etc).'
},
itemText: {
type: String,
default: null, // 'text',
// required: true,
note: 'property in item for text'
note: 'property in item for text.'
},
itemValue: {
type: String,
default: null, // значит вернуть весь объект, 'value'
note: 'property in item for value'
note: 'property in item for value.'
},
placeholder: {
type: String,
default: null,
note: 'placeholder for input'
note: 'placeholder for input.'
},
loading: {
type: Boolean,
default: false,
note: 'display the loading indicator'
note: 'display the loading indicator.'
},
loadingIndicator: { // http://loadinggif.com/images/image-selection/3.gif
type: String,
Expand All @@ -46,12 +46,12 @@ export default {
disabled: {
type: Boolean,
default: false,
note: 'disable the select'
note: 'disable the select.'
},
readonly: {
type: Boolean,
default: false,
note: 'readonly state'
note: 'readonly state.'
},
filter: {
type: Function,
Expand All @@ -65,32 +65,32 @@ export default {
.toLowerCase()
.indexOf(query.toString().toLowerCase()) > -1
},
note: 'filter function for search'
note: 'filter function for search.'
},
searchText: {
type: String,
default: '',
note: 'search string for input, you can use this with ".sync" modifier'
note: 'search string for input, you can use this with ".sync" modifier.'
},
inputElCustomAttributes: {
type: Object,
default: () => ({}),
note: 'you can pass your attributes to the input element'
note: 'you can pass your attributes to the input element. Note: the attributes that are used by the component itself inside are not available, for example, "style".'
},
disableSearch: {
type: Boolean,
default: false,
note: 'disable search input element'
note: 'disable search input element.'
},
disableFilteringBySearch: {
type: Boolean,
default: false,
note: 'disable filtering by search (you can use search for manually getting items)'
note: 'disable filtering by search (you can use search for manually getting items).'
},
resetSearchOnBlur: {
type: Boolean,
default: true,
note: 'reset search on blur event'
note: 'reset search on blur event.'
},
allowMobileScroll: {
type: Boolean,
Expand All @@ -100,16 +100,16 @@ export default {
arrowsDisableInstantSelection: {
type: Boolean,
default: false,
note: 'disable auto select when up or down with key arrow'
note: 'disable auto select when up or down with key arrow.'
},
menuItemsMaxHeight: {
type: String,
default: '300px',
note: 'max menu height (any css value)'
note: 'max menu height (any css value).'
},
eventEmitter: {
type: Object,
note: 'Observer pattern, helps manage events from parent to child'
note: 'Observer pattern, helps manage events from parent to child.'
},
scrollItemsLimit: {
type: Number,
Expand All @@ -124,16 +124,21 @@ export default {
disableFirstItemSelectOnEnter: {
type: Boolean,
default: false,
note: 'disable the selection of the first item from the list of items in menu when to press enter (when no item is selected)'
note: 'disable the selection of the first item from the list of items in menu when to press enter (when no item is selected).'
},
scrollToItemIfNeeded: {
type: Boolean,
default: true,
note: 'to scroll to an item if it has moved beyond the scroll bar'
note: 'to scroll to an item if it has moved beyond the scroll bar.'
},
inputStyles: {
type: Object,
default: () => ({}),
note: 'custom styles for the input field. You can specify dynamic styles.'
},
inputForTextClass: {
type: [Array, String, Object],
default: () => '',
note: 'custom "class" attribute for the input field. You can specify dynamic class.'
}
}

0 comments on commit ddb2c32

Please sign in to comment.