File tree Expand file tree Collapse file tree 2 files changed +101
-14
lines changed Expand file tree Collapse file tree 2 files changed +101
-14
lines changed Original file line number Diff line number Diff line change 1+ <template >
2+ <div
3+ class =" control"
4+ :class =" { 'is-expanded': expanded }"
5+ >
6+ <span
7+ class =" select"
8+ :class =" spanClasses"
9+ >
10+ <select
11+ ref =" select"
12+ v-model =" computedValue"
13+ v-bind =" $attrs"
14+ @blur =" $emit('blur', $event)"
15+ @focus =" $emit('focus', $event)"
16+ >
17+ <template v-if =" placeholder " >
18+ <option
19+ v-if =" computedValue == null"
20+ :value =" null"
21+ disabled
22+ hidden
23+ >
24+ {{ placeholder }}
25+ </option >
26+ </template >
27+ <slot />
28+ </select >
29+ </span >
30+ <slot name =" left-icon" />
31+ </div >
32+ </template >
33+
34+ <script >
35+ export default {
36+ name: ' VSelect' ,
37+ inheritAttrs: false ,
38+ props: {
39+ value: {
40+ type: [String , Number ],
41+ default: null
42+ },
43+ placeholder: String ,
44+ expanded: Boolean
45+ },
46+ data () {
47+ return {
48+ selected: this .value ,
49+ elementRef: ' select'
50+ }
51+ },
52+ computed: {
53+ computedValue: {
54+ get () {
55+ return this .selected
56+ },
57+ set (value ) {
58+ this .selected = value
59+ this .$emit (' input' , value)
60+ }
61+ },
62+ spanClasses () {
63+ return [this .size , this .statusType , {
64+ ' is-fullwidth' : this .expanded ,
65+ ' is-empty' : this .selected === null
66+ }]
67+ }
68+ },
69+ watch: {
70+ /**
71+ * When v-model is changed:
72+ * 1. Set the selected option.
73+ * 2. If it's invalid, validate again.
74+ */
75+ value (value ) {
76+ this .selected = value
77+ }
78+ }
79+ }
80+ </script >
Original file line number Diff line number Diff line change 11<template >
22 <div class =" step-actions" >
3- <b-field class =" license-dropdown" >
4- <b-select
5- :placeholder =" $t('stepper.DD.placeholder')"
6- :value =" shortName"
7- @input =" setCurrentLicense"
3+ <v-select
4+ class =" license-dropdown"
5+ :placeholder =" $t('stepper.DD.placeholder')"
6+ :value =" shortName"
7+ @input =" setCurrentLicense"
8+ >
9+ <option
10+ v-for =" license in licenseList"
11+ :key =" license"
12+ :value =" license"
813 >
9- <option
10- v-for =" license in licenseList"
11- :key =" license"
12- :value =" license"
13- >
14- {{ license }}
15- </option >
16- </b-select >
17- </b-field >
14+ {{ license }}
15+ </option >
16+ </v-select >
1817 </div >
1918</template >
2019<script >
2120import { mapGetters } from ' vuex'
21+ import VSelect from ' @/Vocabulary/VSelect'
2222export default {
2323 name: ' DropdownStep' ,
24+ components: { VSelect },
2425 inheritAttrs: false ,
2526 props: {
27+ status: {
28+ type: String ,
29+ validator (value ) {
30+ return [' active' , ' previous' , ' inactive' ].includes (value)
31+ }
32+ },
2633 id: Number
2734 },
2835 data () {
You can’t perform that action at this time.
0 commit comments