adata-ui 0.1.41 → 0.1.42
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 +50 -545
- package/dist/adata-ui.common.js.map +1 -1
- package/dist/adata-ui.umd.js +50 -545
- 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.json +1 -1
- package/src/App.vue +1 -40
- package/src/components/Header/Profile.vue +2 -2
- package/src/components/TextField/TextField.vue +66 -39
package/package.json
CHANGED
package/src/App.vue
CHANGED
|
@@ -1,49 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div id="app">
|
|
3
|
-
<!-- <text-field label="Пример" v-model="value" @input="inputHandle" @enterPressed="inputHandle" />-->
|
|
4
|
-
<search-text-field
|
|
5
|
-
label="Пример2"
|
|
6
|
-
v-model="value"
|
|
7
|
-
@input="inputHandle"
|
|
8
|
-
@enterPressed="inputHandle"
|
|
9
|
-
:options="options"
|
|
10
|
-
:optionFields="['id', 'name']"
|
|
11
|
-
v-mask="'####-##'"
|
|
12
|
-
clearable
|
|
13
|
-
/>
|
|
14
|
-
</div>
|
|
2
|
+
<div id="app"></div>
|
|
15
3
|
</template>
|
|
16
4
|
|
|
17
5
|
<script>
|
|
18
|
-
import { VueMaskDirective } from "v-mask";
|
|
19
|
-
// import TextField from "./components/TextField/TextField";
|
|
20
|
-
import SearchTextField from "./components/SearchTextField/SearchTextField";
|
|
21
|
-
|
|
22
6
|
export default {
|
|
23
7
|
name: "App",
|
|
24
|
-
directives: {
|
|
25
|
-
mask: VueMaskDirective,
|
|
26
|
-
},
|
|
27
|
-
components: {
|
|
28
|
-
// TextField,
|
|
29
|
-
SearchTextField,
|
|
30
|
-
},
|
|
31
|
-
data() {
|
|
32
|
-
return {
|
|
33
|
-
value: "",
|
|
34
|
-
options: [
|
|
35
|
-
{
|
|
36
|
-
id: 1,
|
|
37
|
-
name: "reg",
|
|
38
|
-
},
|
|
39
|
-
],
|
|
40
|
-
};
|
|
41
|
-
},
|
|
42
|
-
methods: {
|
|
43
|
-
inputHandle(val) {
|
|
44
|
-
console.log(val);
|
|
45
|
-
},
|
|
46
|
-
},
|
|
47
8
|
};
|
|
48
9
|
</script>
|
|
49
10
|
|
|
@@ -330,8 +330,8 @@ export default {
|
|
|
330
330
|
handleClick(url, name) {
|
|
331
331
|
if (!name.includes('Текущий')) {
|
|
332
332
|
window.open(url, "_self");
|
|
333
|
-
this.active = false;
|
|
334
|
-
if (this.chosenElem) this.chosenElem.opened = false;
|
|
333
|
+
// this.active = false;
|
|
334
|
+
// if (this.chosenElem) this.chosenElem.opened = false;
|
|
335
335
|
}
|
|
336
336
|
},
|
|
337
337
|
rotateItem(index) {
|
|
@@ -2,51 +2,74 @@
|
|
|
2
2
|
<div class="adt-text-block">
|
|
3
3
|
<div :class="['adt-text-block__field', { error: !!errorText }]">
|
|
4
4
|
<input
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
@input="() => {$emit('input', value)}"
|
|
5
|
+
ref="input"
|
|
6
|
+
:type="type"
|
|
7
|
+
:value="value"
|
|
8
|
+
:placeholder="placeholder"
|
|
9
|
+
required
|
|
10
|
+
@input="$emit('input', $event.target.value)"
|
|
11
|
+
@keyup.enter="enterPressed"
|
|
12
|
+
class="adt-text-block__input"
|
|
13
|
+
:class="{ error: !!errorText }"
|
|
15
14
|
/>
|
|
16
15
|
<label class="adt-text-block__label">
|
|
17
16
|
{{ label }}
|
|
18
17
|
<span v-if="required" class="adt-text-block__required">*</span>
|
|
19
18
|
</label>
|
|
20
|
-
<div
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
<div
|
|
20
|
+
class="adt-text-block__icon desktop"
|
|
21
|
+
v-if="clearable && value && value.length > 0"
|
|
22
|
+
@click="$emit('input', '')"
|
|
23
|
+
>
|
|
24
|
+
<svg
|
|
25
|
+
width="12"
|
|
26
|
+
height="12"
|
|
27
|
+
fill="none"
|
|
28
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
29
|
+
viewBox="0 0 16 16"
|
|
30
|
+
id="clearIcon"
|
|
31
|
+
>
|
|
32
|
+
<path
|
|
33
|
+
d="M2 2l12 12m0-12L2 14"
|
|
34
|
+
stroke="#2C3E50"
|
|
35
|
+
stroke-linecap="round"
|
|
36
|
+
stroke-linejoin="round"
|
|
37
|
+
></path>
|
|
24
38
|
</svg>
|
|
25
39
|
</div>
|
|
26
40
|
</div>
|
|
27
41
|
<div class="adt-text-block__error" v-if="!!errorText">
|
|
28
|
-
<svg
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
42
|
+
<svg
|
|
43
|
+
width="14"
|
|
44
|
+
height="14"
|
|
45
|
+
viewBox="0 0 16 16"
|
|
46
|
+
fill="none"
|
|
47
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
48
|
+
id="icon__attention"
|
|
49
|
+
>
|
|
50
|
+
<path
|
|
51
|
+
d="M8.5 4C8.5 3.72386 8.27614 3.5 8 3.5C7.72386 3.5 7.5 3.72386 7.5 4H8.5ZM7.5 9C7.5 9.27614 7.72386 9.5 8 9.5C8.27614 9.5 8.5 9.27614 8.5 9H7.5ZM7.5 4V9H8.5V4H7.5Z"
|
|
52
|
+
fill="#FF2E43"
|
|
53
|
+
/>
|
|
54
|
+
<path
|
|
55
|
+
d="M8.5 11C8.5 10.7239 8.27614 10.5 8 10.5C7.72386 10.5 7.5 10.7239 7.5 11H8.5ZM7.5 11.5C7.5 11.7761 7.72386 12 8 12C8.27614 12 8.5 11.7761 8.5 11.5H7.5ZM7.5 11V11.5H8.5V11H7.5Z"
|
|
56
|
+
fill="#FF2E43"
|
|
57
|
+
/>
|
|
58
|
+
<circle cx="8" cy="8" r="7" stroke="#FF2E43" />
|
|
32
59
|
</svg>
|
|
33
60
|
{{ errorText }}
|
|
34
61
|
</div>
|
|
35
62
|
</div>
|
|
36
63
|
</template>
|
|
37
64
|
<script>
|
|
38
|
-
import
|
|
39
|
-
import { VueMaskDirective } from "v-mask";
|
|
65
|
+
import "../../assets/style.scss";
|
|
40
66
|
|
|
41
67
|
export default {
|
|
42
68
|
name: "TextField",
|
|
43
|
-
directives: {
|
|
44
|
-
mask: VueMaskDirective
|
|
45
|
-
},
|
|
46
69
|
props: {
|
|
47
70
|
errorText: {
|
|
48
71
|
type: String,
|
|
49
|
-
default: ""
|
|
72
|
+
default: "",
|
|
50
73
|
},
|
|
51
74
|
label: {
|
|
52
75
|
type: String,
|
|
@@ -56,38 +79,42 @@ export default {
|
|
|
56
79
|
type: String,
|
|
57
80
|
default: "text",
|
|
58
81
|
},
|
|
59
|
-
|
|
82
|
+
value: {
|
|
60
83
|
type: String,
|
|
61
|
-
|
|
84
|
+
required: true,
|
|
85
|
+
default: "",
|
|
62
86
|
},
|
|
63
87
|
placeholder: {
|
|
64
88
|
type: String,
|
|
65
|
-
default: ""
|
|
89
|
+
default: "",
|
|
66
90
|
},
|
|
67
91
|
clearable: {
|
|
68
92
|
type: Boolean,
|
|
69
|
-
default: false
|
|
93
|
+
default: false,
|
|
70
94
|
},
|
|
71
95
|
required: {
|
|
72
96
|
type: Boolean,
|
|
73
|
-
default: false
|
|
74
|
-
}
|
|
97
|
+
default: false,
|
|
98
|
+
},
|
|
75
99
|
},
|
|
76
100
|
data() {
|
|
77
101
|
return {
|
|
78
102
|
showPlaceholder: false,
|
|
79
|
-
|
|
80
|
-
}
|
|
103
|
+
};
|
|
81
104
|
},
|
|
82
105
|
computed: {
|
|
83
106
|
inputPlaceholder() {
|
|
84
|
-
return this.showPlaceholder ? this.placeholder : ""
|
|
85
|
-
}
|
|
107
|
+
return this.showPlaceholder ? this.placeholder : "";
|
|
108
|
+
},
|
|
86
109
|
},
|
|
87
110
|
methods: {
|
|
88
|
-
|
|
89
|
-
this.$emit(
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
|
|
111
|
+
enterPressed() {
|
|
112
|
+
this.$emit("enterPressed", this.showAutocomplete);
|
|
113
|
+
},
|
|
114
|
+
inputHandler(e) {
|
|
115
|
+
this.$emit("input", e.target.value);
|
|
116
|
+
this.showAutocomplete = true;
|
|
117
|
+
},
|
|
118
|
+
},
|
|
119
|
+
};
|
|
93
120
|
</script>
|