@vue-interface/select-field 1.0.0-beta.0 → 1.0.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,228 +0,0 @@
1
- <template>
2
- <div :class="formGroupClasses">
3
- <slot name="label">
4
- <label
5
- v-if="label"
6
- ref="label"
7
- :for="id"
8
- :class="labelClass"
9
- @click="focus"
10
- v-html="label" />
11
- </slot>
12
-
13
- <div class="form-group-inner">
14
- <slot name="control" :bind-events="bindEvents" :control-attributes="controlAttributes" :focus="focus">
15
- <div v-if="$slots.icon" class="form-group-inner-icon" @click="focus">
16
- <slot name="icon" />
17
- </div>
18
- <select
19
- ref="field"
20
- v-bind-events
21
- v-bind="Object.assign({
22
- ['disabled']: $attrs.readonly
23
- }, controlAttributes)">
24
- <slot />
25
- </select>
26
- </slot>
27
-
28
- <slot name="activity">
29
- <transition name="select-field-fade">
30
- <activity-indicator
31
- v-if="activity"
32
- key="activity"
33
- ref="activity"
34
- :type="indicator"
35
- :size="indicatorSize || size" />
36
- </transition>
37
- </slot>
38
- </div>
39
-
40
- <slot name="feedback">
41
- <div
42
- v-if="invalidFeedback"
43
- class="invalid-feedback"
44
- invalid
45
- v-html="invalidFeedback" />
46
- <div
47
- v-else-if="validFeedback"
48
- class="valid-feedback"
49
- valid
50
- v-html="validFeedback" />
51
- </slot>
52
-
53
- <slot name="help">
54
- <small v-if="helpText" ref="help">
55
- {{ helpText }}
56
- </small>
57
- </slot>
58
- </div>
59
- </template>
60
-
61
- <script>
62
- import { ActivityIndicator } from '@vue-interface/activity-indicator';
63
- import { FormControl } from '@vue-interface/form-control';
64
-
65
- export default {
66
-
67
- name: 'SelectField',
68
-
69
- components: {
70
- ActivityIndicator,
71
- },
72
-
73
- mixins: [
74
- FormControl
75
- ],
76
-
77
- props: {
78
- /**
79
- * The default class name assigned to the control element
80
- *
81
- * @param {String}
82
- * @default 'form-select'
83
- */
84
- defaultControlClass: {
85
- type: String,
86
- default: 'form-select'
87
- }
88
- },
89
-
90
- computed: {
91
-
92
- controlClass() {
93
- return this.plaintext ?
94
- `${this.defaultControlClass}-plaintext`
95
- : this.defaultControlClass;
96
- },
97
- },
98
-
99
- methods: {
100
- shouldChangeOnFocus() {
101
- return false;
102
- }
103
- }
104
-
105
- };
106
- </script>
107
-
108
- <style>
109
- .select-field,
110
- .select-field .form-group-inner {
111
- position: relative;
112
- transition: all .25s ease-in-out;
113
- }
114
-
115
- .select-field .activity-indicator {
116
- position: absolute;
117
- right: 1.25em;
118
- top: 50%;
119
- transform: translate(-1rem, -50%);
120
- transition: all .15s ease-in;
121
- }
122
-
123
- .select-field .activity-indicator-xs {
124
- font-size: .5em;
125
- right: 2em;
126
- }
127
-
128
- .select-field.has-activity .form-control-xs {
129
- padding-right: 3.75em;
130
- }
131
-
132
- .select-field .activity-indicator-sm {
133
- font-size: .5em;
134
- right: 2em;
135
- }
136
-
137
- .select-field.has-activity .form-control-sm {
138
- padding-right: 3em;
139
- }
140
-
141
- .select-field .activity-indicator-md {
142
- font-size: .666em;
143
- }
144
-
145
- .select-field.has-activity .form-control-md {
146
- padding-right: 3em;
147
- }
148
-
149
- .select-field .activity-indicator-lg {
150
- font-size: .75em;
151
- }
152
-
153
- .select-field.has-activity .form-control-lg {
154
- padding-right: 3em;
155
- }
156
-
157
- .select-field .activity-indicator-xl {
158
- font-size: 1em;
159
- }
160
-
161
- .select-field.has-activity .activity-indicator-xl ~ .form-control-xl {
162
- padding-right: 3.75em;
163
- }
164
-
165
- .select-field .activity-indicator {
166
- opacity: 1;
167
- }
168
-
169
- .select-field .select-field-fade-enter,
170
- .select-field .select-field-fade-leave-to {
171
- opacity: 0;
172
- }
173
-
174
- .select-field.is-valid .valid-feedback,
175
- .select-field.is-invalid .invalid-feedback {
176
- display: flex;
177
- }
178
-
179
- .select-field .form-control-icon {
180
- padding-left: 2em;
181
- }
182
-
183
- .select-field .form-group-inner-icon {
184
- position: absolute;
185
- top: 50%;
186
- left: .666em;
187
- width: 1rem;
188
- font-size: 1em;
189
- transform: translateY(-50%);
190
- display: flex;
191
- align-items: center;
192
- justify-content: center;
193
- }
194
-
195
- .select-field-sm .form-group-inner-icon {
196
- position: absolute;
197
- top: 50%;
198
- left: .666rem;
199
- width: .75em;
200
- font-size: 1.5em;
201
- transform: translateY(-50%);
202
- display: flex;
203
- align-items: center;
204
- justify-content: center;
205
- }
206
-
207
- .select-field-lg .form-group-inner-icon {
208
- position: absolute;
209
- top: 50%;
210
- left: .666rem;
211
- width: 1.25em;
212
- font-size: 1em;
213
- transform: translateY(-50%);
214
- display: flex;
215
- align-items: center;
216
- justify-content: center;
217
- }
218
-
219
- .select-field .activity-indicator {
220
- opacity: 1;
221
- }
222
-
223
- .select-field .select-field-fade-enter,
224
- .select-field .select-field-fade-leave-to {
225
- opacity: 0;
226
- }
227
- </style>
228
-