@tak-ps/vue-tabler 3.71.0 → 3.72.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.
- package/CHANGELOG.md +8 -0
- package/components/input/FileInput.vue +103 -0
- package/components/input/Input.vue +0 -4
- package/lib.js +1 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class='row'>
|
|
3
|
+
<TablerLabel
|
|
4
|
+
v-if='label'
|
|
5
|
+
:label='label'
|
|
6
|
+
:description='description'
|
|
7
|
+
:required='required'
|
|
8
|
+
>
|
|
9
|
+
<slot />
|
|
10
|
+
</TablerLabel>
|
|
11
|
+
<div class='col-12'>
|
|
12
|
+
<input
|
|
13
|
+
ref='text-input'
|
|
14
|
+
@change='$emit("change", $event)'
|
|
15
|
+
:disabled='disabled'
|
|
16
|
+
:autofocus='autofocus'
|
|
17
|
+
:accept='accept'
|
|
18
|
+
type='file'
|
|
19
|
+
:class='{
|
|
20
|
+
"is-invalid": errorstr
|
|
21
|
+
}'
|
|
22
|
+
class='form-control'
|
|
23
|
+
:placeholder='placeholder||label||""'
|
|
24
|
+
@blur='$emit("blur")'
|
|
25
|
+
/>
|
|
26
|
+
<span
|
|
27
|
+
v-if='loading'
|
|
28
|
+
class='input-icon-addon'
|
|
29
|
+
>
|
|
30
|
+
<div
|
|
31
|
+
class='spinner-border spinner-border-sm text-secondary'
|
|
32
|
+
role='status'
|
|
33
|
+
/>
|
|
34
|
+
</span>
|
|
35
|
+
<div
|
|
36
|
+
v-if='errorstr'
|
|
37
|
+
class='invalid-feedback'
|
|
38
|
+
v-text='errorstr'
|
|
39
|
+
/>
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
</template>
|
|
43
|
+
|
|
44
|
+
<script>
|
|
45
|
+
import TablerLabel from '../internal/Label.vue';
|
|
46
|
+
|
|
47
|
+
export default {
|
|
48
|
+
name: 'TablerFileInput',
|
|
49
|
+
components: {
|
|
50
|
+
TablerLabel
|
|
51
|
+
},
|
|
52
|
+
props: {
|
|
53
|
+
modelValue: {
|
|
54
|
+
type: [String, Number],
|
|
55
|
+
required: true
|
|
56
|
+
},
|
|
57
|
+
autofocus: {
|
|
58
|
+
type: Boolean,
|
|
59
|
+
default: false
|
|
60
|
+
},
|
|
61
|
+
loading: {
|
|
62
|
+
type: Boolean,
|
|
63
|
+
default: false
|
|
64
|
+
},
|
|
65
|
+
required: {
|
|
66
|
+
type: Boolean,
|
|
67
|
+
default: false,
|
|
68
|
+
},
|
|
69
|
+
disabled: {
|
|
70
|
+
type: Boolean,
|
|
71
|
+
default: false,
|
|
72
|
+
},
|
|
73
|
+
accept: {
|
|
74
|
+
type: String,
|
|
75
|
+
},
|
|
76
|
+
description: {
|
|
77
|
+
type: String,
|
|
78
|
+
default: '',
|
|
79
|
+
},
|
|
80
|
+
label: String,
|
|
81
|
+
placeholder: String,
|
|
82
|
+
error: String,
|
|
83
|
+
},
|
|
84
|
+
emits: ['blur', 'change'],
|
|
85
|
+
data: function() {
|
|
86
|
+
return {
|
|
87
|
+
help: false,
|
|
88
|
+
internal_error: '',
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
computed: {
|
|
92
|
+
errorstr: function() {
|
|
93
|
+
if (this.error) return this.error;
|
|
94
|
+
return this.internal_error;
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
mounted: function() {
|
|
98
|
+
if (this.autofocus) {
|
|
99
|
+
this.$refs['text-input'].focus();
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
</script>
|
|
@@ -41,7 +41,6 @@
|
|
|
41
41
|
:disabled='disabled'
|
|
42
42
|
:autocomplete='autocomplete'
|
|
43
43
|
:autofocus='autofocus'
|
|
44
|
-
:accept='accept'
|
|
45
44
|
:type='computed_type'
|
|
46
45
|
:class='{
|
|
47
46
|
"is-invalid": errorstr
|
|
@@ -139,9 +138,6 @@ export default {
|
|
|
139
138
|
type: Boolean,
|
|
140
139
|
default: false,
|
|
141
140
|
},
|
|
142
|
-
accept: {
|
|
143
|
-
type: String,
|
|
144
|
-
},
|
|
145
141
|
description: {
|
|
146
142
|
type: String,
|
|
147
143
|
default: '',
|
package/lib.js
CHANGED
|
@@ -6,6 +6,7 @@ export { default as TablerColour } from './components/input/Colour.vue'
|
|
|
6
6
|
export { default as TablerSelect } from './components/input/Select.vue'
|
|
7
7
|
export { default as TablerToggle } from './components/input/Toggle.vue'
|
|
8
8
|
export { default as TablerInput } from './components/input/Input.vue'
|
|
9
|
+
export { default as TablerFileInput } from './components/input/FileInput.vue'
|
|
9
10
|
export { default as TablerEnum } from './components/input/Enum.vue';
|
|
10
11
|
|
|
11
12
|
export { default as TablerButton } from './components/Button.vue'
|