adata-ui 0.1.33 → 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 +559 -81
- package/dist/adata-ui.common.js.map +1 -1
- package/dist/adata-ui.umd.js +559 -81
- 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/components/SearchTextField/SearchTextField.stories.js +1 -6
- package/src/components/SearchTextField/SearchTextField.vue +14 -34
- package/src/components/TextField/TextField.stories.js +1 -6
- package/src/components/TextField/TextField.vue +15 -28
- package/src/main.js +12 -9
package/package-lock.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "adata-ui",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.33",
|
|
4
4
|
"lockfileVersion": 1,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"dependencies": {
|
|
@@ -13152,6 +13152,11 @@
|
|
|
13152
13152
|
"integrity": "sha512-X1DFb6wxXpZLLqM9NX0Wm+4xoN6xAyJn8OwuiHsV0JJvLfD18Z+wbgJ1lM7ykTVINdu8v7Mu0gIzWMvnhKWBkA==",
|
|
13153
13153
|
"dev": true
|
|
13154
13154
|
},
|
|
13155
|
+
"flush-promises": {
|
|
13156
|
+
"version": "1.0.2",
|
|
13157
|
+
"resolved": "https://registry.npmjs.org/flush-promises/-/flush-promises-1.0.2.tgz",
|
|
13158
|
+
"integrity": "sha512-G0sYfLQERwKz4+4iOZYQEZVpOt9zQrlItIxQAAYAWpfby3gbHrx0osCHz5RLl/XoXevXk0xoN4hDFky/VV9TrA=="
|
|
13159
|
+
},
|
|
13155
13160
|
"flush-write-stream": {
|
|
13156
13161
|
"version": "1.1.1",
|
|
13157
13162
|
"resolved": "https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-1.1.1.tgz",
|
|
@@ -25234,6 +25239,11 @@
|
|
|
25234
25239
|
"resolved": "https://registry.npmjs.org/v-click-outside/-/v-click-outside-3.1.2.tgz",
|
|
25235
25240
|
"integrity": "sha512-gMdRqfRE6m6XU6SiFi3dyBlFB2MWogiXpof8Aa3LQysrl9pzTndqp/iEaAphLoadaQUFnQ0ec6fLLaxr7LiY6A=="
|
|
25236
25241
|
},
|
|
25242
|
+
"v-mask": {
|
|
25243
|
+
"version": "2.3.0",
|
|
25244
|
+
"resolved": "https://registry.npmjs.org/v-mask/-/v-mask-2.3.0.tgz",
|
|
25245
|
+
"integrity": "sha512-ap7pTtCTvj25CqX4VYXqudCBd0+XvYyhiiLbzWQQR7AMQosJ2+DPu0a94P9stk0EGmGcmYxJaPkFkfjD8hquWQ=="
|
|
25246
|
+
},
|
|
25237
25247
|
"v8-compile-cache": {
|
|
25238
25248
|
"version": "2.3.0",
|
|
25239
25249
|
"resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "adata-ui",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.34",
|
|
4
4
|
"private": false,
|
|
5
5
|
"scripts": {
|
|
6
6
|
"serve": "vue-cli-service serve",
|
|
@@ -15,9 +15,11 @@
|
|
|
15
15
|
"@storybook/addons": "^6.4.14",
|
|
16
16
|
"@storybook/theming": "^6.4.14",
|
|
17
17
|
"core-js": "^3.6.5",
|
|
18
|
+
"flush-promises": "^1.0.2",
|
|
18
19
|
"node-sass": "^5.0.0",
|
|
19
20
|
"user": "0.0.0",
|
|
20
21
|
"v-click-outside": "^3.1.2",
|
|
22
|
+
"v-mask": "^2.3.0",
|
|
21
23
|
"vue": "^2.6.11",
|
|
22
24
|
"vue-the-mask": "^0.11.1",
|
|
23
25
|
"vue2-perfect-scrollbar": "^1.5.2"
|
package/src/App.vue
CHANGED
|
@@ -1,13 +1,36 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div id="app">
|
|
3
|
+
<!-- <text-field label="Пример" v-model="value" @input="inputHandle" @enterPressed="inputHandle" />-->
|
|
4
|
+
<search-text-field label="Пример2" v-model="value" @input="inputHandle" @enterPressed="inputHandle" :options="options" :optionFields="['id', 'name']" />
|
|
3
5
|
</div>
|
|
4
6
|
</template>
|
|
5
7
|
|
|
6
8
|
<script>
|
|
7
9
|
|
|
10
|
+
// import TextField from "./components/TextField/TextField";
|
|
11
|
+
import SearchTextField from "./components/SearchTextField/SearchTextField";
|
|
12
|
+
|
|
8
13
|
export default {
|
|
9
14
|
name: 'App',
|
|
10
|
-
components: {
|
|
15
|
+
components: {
|
|
16
|
+
// TextField,
|
|
17
|
+
SearchTextField
|
|
18
|
+
},
|
|
19
|
+
data() {
|
|
20
|
+
return {
|
|
21
|
+
value: "",
|
|
22
|
+
options: [{
|
|
23
|
+
id: 1,
|
|
24
|
+
name: "reg"
|
|
25
|
+
}
|
|
26
|
+
]
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
methods: {
|
|
30
|
+
inputHandle(val) {
|
|
31
|
+
console.log(val);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
11
34
|
}
|
|
12
35
|
</script>
|
|
13
36
|
|
|
@@ -11,12 +11,7 @@ export default {
|
|
|
11
11
|
const Template = (args, { argTypes }) => ({
|
|
12
12
|
components: { ASearchTextField },
|
|
13
13
|
props: Object.keys(argTypes),
|
|
14
|
-
template: '<a-search-text-field v-bind="$props" @enterPressed="enterPressed"></a-search-text-field>'
|
|
15
|
-
methods: {
|
|
16
|
-
enterPressed(){
|
|
17
|
-
console.log('hihi')
|
|
18
|
-
}
|
|
19
|
-
}
|
|
14
|
+
template: '<a-search-text-field v-bind="$props" @enterPressed="enterPressed"></a-search-text-field>'
|
|
20
15
|
})
|
|
21
16
|
|
|
22
17
|
export const WithIcon = Template.bind({});
|
|
@@ -5,35 +5,19 @@
|
|
|
5
5
|
>
|
|
6
6
|
<div :class="['adt-text-block__field', { error: !!errorText }]">
|
|
7
7
|
<input
|
|
8
|
-
v-if="!mask"
|
|
9
8
|
ref="input"
|
|
10
9
|
:type="type"
|
|
11
|
-
|
|
10
|
+
v-mask="mask"
|
|
11
|
+
v-model="value"
|
|
12
12
|
:placeholder="placeholder"
|
|
13
13
|
required
|
|
14
|
-
@
|
|
15
|
-
@
|
|
14
|
+
@keyup.enter="pressedEnter"
|
|
15
|
+
@input="inputHandler"
|
|
16
16
|
@focus="showAutocomplete = true"
|
|
17
17
|
@click="$emit('showVTour')"
|
|
18
18
|
class="adt-text-block__input"
|
|
19
19
|
:class="{ error: !!errorText }"
|
|
20
20
|
/>
|
|
21
|
-
<TheMask
|
|
22
|
-
v-else
|
|
23
|
-
ref="maskInput"
|
|
24
|
-
:value="value"
|
|
25
|
-
:mask="mask"
|
|
26
|
-
:type="type"
|
|
27
|
-
:masked="false"
|
|
28
|
-
:placeholder="inputPlaceholder"
|
|
29
|
-
required
|
|
30
|
-
@input.native="$emit('input', $event.target.value)"
|
|
31
|
-
@focus.native="showPlaceholder = true"
|
|
32
|
-
@blur.native="showPlaceholder = false"
|
|
33
|
-
class="adt-text-block__input"
|
|
34
|
-
:class="{ error: !!errorText }"
|
|
35
|
-
|
|
36
|
-
/>
|
|
37
21
|
<label class="adt-text-block__label">
|
|
38
22
|
{{ label }}
|
|
39
23
|
</label>
|
|
@@ -72,14 +56,15 @@
|
|
|
72
56
|
|
|
73
57
|
<script>
|
|
74
58
|
import '../../assets/style.scss';
|
|
75
|
-
import {
|
|
59
|
+
import { VueMaskDirective } from "v-mask";
|
|
76
60
|
import { PerfectScrollbar } from "vue2-perfect-scrollbar";
|
|
77
61
|
import vClickOutside from "v-click-outside";
|
|
78
62
|
|
|
79
63
|
export default {
|
|
80
64
|
name: "SearchTextField",
|
|
81
65
|
directives: {
|
|
82
|
-
clickOutside: vClickOutside.directive
|
|
66
|
+
clickOutside: vClickOutside.directive,
|
|
67
|
+
mask: VueMaskDirective
|
|
83
68
|
},
|
|
84
69
|
props: {
|
|
85
70
|
errorText: {
|
|
@@ -102,11 +87,6 @@ export default {
|
|
|
102
87
|
type: String,
|
|
103
88
|
default: "text",
|
|
104
89
|
},
|
|
105
|
-
value: {
|
|
106
|
-
type: String,
|
|
107
|
-
required: true,
|
|
108
|
-
default: ""
|
|
109
|
-
},
|
|
110
90
|
clearable: {
|
|
111
91
|
type: Boolean,
|
|
112
92
|
default: false
|
|
@@ -133,13 +113,13 @@ export default {
|
|
|
133
113
|
},
|
|
134
114
|
},
|
|
135
115
|
components: {
|
|
136
|
-
PerfectScrollbar
|
|
137
|
-
TheMask
|
|
116
|
+
PerfectScrollbar
|
|
138
117
|
},
|
|
139
118
|
data() {
|
|
140
119
|
return {
|
|
141
120
|
showAutocomplete: false,
|
|
142
|
-
showPlaceholder: false
|
|
121
|
+
showPlaceholder: false,
|
|
122
|
+
value: ""
|
|
143
123
|
}
|
|
144
124
|
},
|
|
145
125
|
computed: {
|
|
@@ -148,8 +128,8 @@ export default {
|
|
|
148
128
|
}
|
|
149
129
|
},
|
|
150
130
|
methods: {
|
|
151
|
-
|
|
152
|
-
this.$emit('
|
|
131
|
+
pressedEnter() {
|
|
132
|
+
this.$emit('enter', this.showAutocomplete, this.value);
|
|
153
133
|
},
|
|
154
134
|
onOutsideClick() {
|
|
155
135
|
if (!this.isMobile) this.showAutocomplete = false
|
|
@@ -192,8 +172,8 @@ export default {
|
|
|
192
172
|
autocompleteOption.setAttribute("id", 'searchVariant');
|
|
193
173
|
return autocompleteOption.innerText;
|
|
194
174
|
},
|
|
195
|
-
inputHandler(
|
|
196
|
-
this.$emit('input',
|
|
175
|
+
inputHandler() {
|
|
176
|
+
this.$emit('input', this.value);
|
|
197
177
|
this.showAutocomplete = true;
|
|
198
178
|
},
|
|
199
179
|
onAutocompleteOptionClick(option) {
|
|
@@ -10,12 +10,7 @@ export default {
|
|
|
10
10
|
const Template = (args, { argTypes }) => ({
|
|
11
11
|
components: { ATextField },
|
|
12
12
|
props: Object.keys(argTypes),
|
|
13
|
-
template: '<a-text-field v-bind="$props"
|
|
14
|
-
methods: {
|
|
15
|
-
enterPressed(){
|
|
16
|
-
console.log('test')
|
|
17
|
-
}
|
|
18
|
-
}
|
|
13
|
+
template: '<a-text-field v-bind="$props"></a-text-field>'
|
|
19
14
|
})
|
|
20
15
|
|
|
21
16
|
export const Clearable = Template.bind({});
|
|
@@ -2,31 +2,16 @@
|
|
|
2
2
|
<div class="adt-text-block">
|
|
3
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="$emit('enter')"
|
|
13
|
-
class="adt-text-block__input"
|
|
14
|
-
:class="{ error: !!errorText }"
|
|
15
|
-
/>
|
|
16
|
-
<TheMask
|
|
17
|
-
v-else
|
|
18
|
-
ref="maskInput"
|
|
19
|
-
:value="value"
|
|
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"
|
|
11
|
+
@keyup.enter="pressedEnter"
|
|
28
12
|
class="adt-text-block__input"
|
|
29
13
|
:class="{ error: !!errorText }"
|
|
14
|
+
@input="() => {$emit('input', value)}"
|
|
30
15
|
/>
|
|
31
16
|
<label class="adt-text-block__label">
|
|
32
17
|
{{ label }}
|
|
@@ -51,10 +36,13 @@
|
|
|
51
36
|
</template>
|
|
52
37
|
<script>
|
|
53
38
|
import '../../assets/style.scss';
|
|
54
|
-
import {
|
|
39
|
+
import { VueMaskDirective } from "v-mask";
|
|
55
40
|
|
|
56
41
|
export default {
|
|
57
42
|
name: "TextField",
|
|
43
|
+
directives: {
|
|
44
|
+
mask: VueMaskDirective
|
|
45
|
+
},
|
|
58
46
|
props: {
|
|
59
47
|
errorText: {
|
|
60
48
|
type: String,
|
|
@@ -72,10 +60,6 @@ export default {
|
|
|
72
60
|
type: String,
|
|
73
61
|
default: ""
|
|
74
62
|
},
|
|
75
|
-
value: {
|
|
76
|
-
type: String,
|
|
77
|
-
required: true,
|
|
78
|
-
},
|
|
79
63
|
placeholder: {
|
|
80
64
|
type: String,
|
|
81
65
|
default: ""
|
|
@@ -89,12 +73,10 @@ export default {
|
|
|
89
73
|
default: false
|
|
90
74
|
}
|
|
91
75
|
},
|
|
92
|
-
components: {
|
|
93
|
-
TheMask
|
|
94
|
-
},
|
|
95
76
|
data() {
|
|
96
77
|
return {
|
|
97
|
-
showPlaceholder: false
|
|
78
|
+
showPlaceholder: false,
|
|
79
|
+
value: ""
|
|
98
80
|
}
|
|
99
81
|
},
|
|
100
82
|
computed: {
|
|
@@ -102,5 +84,10 @@ export default {
|
|
|
102
84
|
return this.showPlaceholder ? this.placeholder : ""
|
|
103
85
|
}
|
|
104
86
|
},
|
|
87
|
+
methods: {
|
|
88
|
+
pressedEnter() {
|
|
89
|
+
this.$emit('enterPressed', this.value);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
105
92
|
}
|
|
106
93
|
</script>
|
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')
|