|
1 | 1 | <template lang="jade"> |
2 | 2 | multiselect( |
3 | | - :id="schema.selectOptions.id", |
| 3 | + :id="selectOptions.id", |
4 | 4 | :options="options", |
5 | 5 | :multiple="schema.multiSelect", |
6 | 6 | :selected="value", |
7 | | - :key="schema.selectOptions.key || null", |
8 | | - :label="schema.selectOptions.label || null", |
9 | | - :searchable="schema.selectOptions.searchable", |
10 | | - :local-search="schema.selectOptions.localSearch", |
11 | | - :clear-on-select="schema.selectOptions.clearOnSelect", |
12 | | - :hide-selected="schema.selectOptions.hideSelected", |
| 7 | + :key="selectOptions.key || null", |
| 8 | + :label="selectOptions.label || null", |
| 9 | + :searchable="selectOptions.searchable", |
| 10 | + :local-search="selectOptions.localSearch", |
| 11 | + :clear-on-select="selectOptions.clearOnSelect", |
| 12 | + :hide-selected="selectOptions.hideSelected", |
13 | 13 | :placeholder="schema.placeholder", |
14 | | - :max-height="schema.selectOptions.maxHeight", |
15 | | - :allow-empty="schema.selectOptions.allowEmpty", |
16 | | - :reset-after="schema.selectOptions.resetAfter", |
17 | | - :close-on-select="schema.selectOptions.closeOnSelect", |
18 | | - :custom-label="schema.selectOptions.customLabel || null", |
19 | | - :taggable="schema.selectOptions.taggable", |
20 | | - :tag-placeholder="schema.selectOptions.tagPlaceholder", |
| 14 | + :max-height="selectOptions.maxHeight", |
| 15 | + :allow-empty="selectOptions.allowEmpty", |
| 16 | + :reset-after="selectOptions.resetAfter", |
| 17 | + :close-on-select="selectOptions.closeOnSelect", |
| 18 | + :taggable="selectOptions.taggable", |
| 19 | + :tag-placeholder="selectOptions.tagPlaceholder", |
21 | 20 | :max="schema.max || null", |
22 | 21 | @update="updateSelected", |
23 | 22 | @tag="addTag", |
|
26 | 25 | @search-change="onSearchChange", |
27 | 26 | @open="onOpen", |
28 | 27 | @close="onClose", |
29 | | - :select-label="schema.selectOptions.selectLabel", |
30 | | - :selected-label="schema.selectOptions.selectedLabel", |
31 | | - :deselect-label="schema.selectOptions.deselectLabel", |
32 | | - :show-labels="schema.selectOptions.showLabels", |
33 | | - :limit="schema.selectOptions.limit", |
34 | | - :limit-text="schema.selectOptions.limitText", |
35 | | - :loading="schema.selectOptions.loading", |
| 28 | + :select-label="selectOptions.selectLabel", |
| 29 | + :selected-label="selectOptions.selectedLabel", |
| 30 | + :deselect-label="selectOptions.deselectLabel", |
| 31 | + :show-labels="selectOptions.showLabels", |
| 32 | + :limit="selectOptions.limit", |
| 33 | + :limit-text="selectOptions.limitText", |
| 34 | + :loading="selectOptions.loading", |
36 | 35 | :disabled="disabled", |
37 | | - :option-partial="schema.selectOptions.optionPartial", |
38 | | - :show-pointer="schema.selectOptions.showPointer", |
39 | | - :option-height="schema.selectOptions.optionHeight" |
| 36 | + :option-partial="selectOptions.optionPartial", |
| 37 | + :show-pointer="selectOptions.showPointer", |
| 38 | + :option-height="selectOptions.optionHeight" |
40 | 39 | ) |
41 | 40 | </template> |
42 | 41 | <script> |
|
46 | 45 | export default { |
47 | 46 | mixins: [abstractField], |
48 | 47 | computed: { |
| 48 | + selectOptions() { |
| 49 | + return this.schema.selectOptions || {} |
| 50 | + }, |
| 51 | +
|
49 | 52 | options() { |
50 | 53 | let values = this.schema.values; |
51 | 54 | if (typeof(values) == "function") { |
|
60 | 63 | this.value = value; |
61 | 64 | }, |
62 | 65 | addTag(newTag, id) { |
63 | | - let onNewTag = this.schema.selectOptions.onNewTag; |
| 66 | + let onNewTag = this.selectOptions.onNewTag; |
64 | 67 | if (typeof(onNewTag) == "function") { |
65 | 68 | onNewTag(newTag, id, this.options, this.value); |
66 | 69 | } |
67 | 70 | }, |
68 | 71 | onSearchChange(searchQuery, id) { |
69 | | - let onSearch = this.schema.selectOptions.onSearch; |
| 72 | + let onSearch = this.selectOptions.onSearch; |
70 | 73 | if (typeof(onSearch) == "function") { |
71 | 74 | onSearch(searchQuery, id, this.options); |
72 | 75 | } |
|
0 commit comments