adata-ui 0.1.31 → 0.1.34
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/dist/adata-ui.common.js +597 -177
- package/dist/adata-ui.common.js.map +1 -1
- package/dist/adata-ui.css +1 -1
- package/dist/adata-ui.umd.js +597 -177
- package/dist/adata-ui.umd.js.map +1 -1
- package/dist/adata-ui.umd.min.js +2 -2
- package/dist/adata-ui.umd.min.js.map +1 -1
- package/package-lock.json +11 -1
- package/package.json +3 -1
- package/src/App.vue +24 -1
- package/src/assets/_text_field.scss +8 -6
- package/src/components/Alert/Alert.vue +1 -1
- package/src/components/Button/{BaseButton.vue → AButton.vue} +40 -74
- package/src/components/Button/Button.stories.js +1 -1
- package/src/components/SearchTextField/SearchTextField.stories.js +1 -6
- package/src/components/SearchTextField/SearchTextField.vue +26 -74
- package/src/components/TextField/TextField.stories.js +1 -6
- package/src/components/TextField/TextField.vue +19 -36
- package/src/components/index.js +1 -1
- package/src/main.js +12 -9
|
@@ -1,35 +1,22 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="adt-text-block">
|
|
3
|
-
<div class="adt-text-block__field">
|
|
3
|
+
<div :class="['adt-text-block__field', { error: !!errorText }]">
|
|
4
4
|
<input
|
|
5
|
-
v-if="!mask"
|
|
6
5
|
ref="input"
|
|
6
|
+
v-mask="mask"
|
|
7
7
|
:type="type"
|
|
8
|
-
|
|
8
|
+
v-model="value"
|
|
9
9
|
:placeholder="placeholder"
|
|
10
10
|
required
|
|
11
|
-
@
|
|
12
|
-
@keyup.enter="enterPressed"
|
|
11
|
+
@keyup.enter="pressedEnter"
|
|
13
12
|
class="adt-text-block__input"
|
|
14
13
|
:class="{ error: !!errorText }"
|
|
14
|
+
@input="() => {$emit('input', value)}"
|
|
15
15
|
/>
|
|
16
|
-
<
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
:mask="mask"
|
|
21
|
-
:type="type"
|
|
22
|
-
:masked="false"
|
|
23
|
-
:placeholder="inputPlaceholder"
|
|
24
|
-
required
|
|
25
|
-
@input.native="$emit('input', $event.target.value)"
|
|
26
|
-
@focus.native="showPlaceholder = true"
|
|
27
|
-
@blur.native="showPlaceholder = false"
|
|
28
|
-
class="adt-text-block__input"
|
|
29
|
-
:class="{ error: !!errorText }"
|
|
30
|
-
/>
|
|
31
|
-
<label class="adt-text-block__label">{{ label }}<span v-if="required"
|
|
32
|
-
class="adt-text-block__required">*</span></label>
|
|
16
|
+
<label class="adt-text-block__label">
|
|
17
|
+
{{ label }}
|
|
18
|
+
<span v-if="required" class="adt-text-block__required">*</span>
|
|
19
|
+
</label>
|
|
33
20
|
<div class="adt-text-block__icon desktop" v-if="clearable && value && value.length > 0"
|
|
34
21
|
@click="$emit('input', '')">
|
|
35
22
|
<svg width="12" height="12" fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" id="clearIcon">
|
|
@@ -49,10 +36,13 @@
|
|
|
49
36
|
</template>
|
|
50
37
|
<script>
|
|
51
38
|
import '../../assets/style.scss';
|
|
52
|
-
import {
|
|
39
|
+
import { VueMaskDirective } from "v-mask";
|
|
53
40
|
|
|
54
41
|
export default {
|
|
55
42
|
name: "TextField",
|
|
43
|
+
directives: {
|
|
44
|
+
mask: VueMaskDirective
|
|
45
|
+
},
|
|
56
46
|
props: {
|
|
57
47
|
errorText: {
|
|
58
48
|
type: String,
|
|
@@ -70,10 +60,6 @@ export default {
|
|
|
70
60
|
type: String,
|
|
71
61
|
default: ""
|
|
72
62
|
},
|
|
73
|
-
value: {
|
|
74
|
-
type: String,
|
|
75
|
-
required: true,
|
|
76
|
-
},
|
|
77
63
|
placeholder: {
|
|
78
64
|
type: String,
|
|
79
65
|
default: ""
|
|
@@ -87,12 +73,10 @@ export default {
|
|
|
87
73
|
default: false
|
|
88
74
|
}
|
|
89
75
|
},
|
|
90
|
-
components: {
|
|
91
|
-
TheMask
|
|
92
|
-
},
|
|
93
76
|
data() {
|
|
94
77
|
return {
|
|
95
|
-
showPlaceholder: false
|
|
78
|
+
showPlaceholder: false,
|
|
79
|
+
value: ""
|
|
96
80
|
}
|
|
97
81
|
},
|
|
98
82
|
computed: {
|
|
@@ -101,10 +85,9 @@ export default {
|
|
|
101
85
|
}
|
|
102
86
|
},
|
|
103
87
|
methods: {
|
|
104
|
-
|
|
105
|
-
this.$emit('enterPressed')
|
|
106
|
-
}
|
|
107
|
-
|
|
88
|
+
pressedEnter() {
|
|
89
|
+
this.$emit('enterPressed', this.value);
|
|
90
|
+
}
|
|
108
91
|
}
|
|
109
92
|
}
|
|
110
|
-
</script>
|
|
93
|
+
</script>
|
package/src/components/index.js
CHANGED
package/src/main.js
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import Vue from 'vue'
|
|
2
|
-
import App from './App.vue'
|
|
3
|
-
import '
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import Vue from 'vue'
|
|
2
|
+
import App from './App.vue'
|
|
3
|
+
import VueMask from 'v-mask'
|
|
4
|
+
import './components'
|
|
5
|
+
|
|
6
|
+
Vue.use(VueMask)
|
|
7
|
+
|
|
8
|
+
Vue.config.productionTip = false
|
|
9
|
+
|
|
10
|
+
new Vue({
|
|
11
|
+
render: h => h(App),
|
|
12
|
+
}).$mount('#app')
|