adata-ui 0.3.44 → 0.3.45

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adata-ui",
3
- "version": "0.3.44",
3
+ "version": "0.3.45",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -39,27 +39,6 @@
39
39
  -webkit-appearance: none;
40
40
  }
41
41
 
42
- &__error {
43
- display: flex;
44
- align-items: center;
45
- background: rgba(255, 46, 67, 0.12);
46
- border-radius: 4px;
47
- overflow: hidden;
48
- color: #2c3e50;
49
- margin-top: 8px;
50
- .error-icon {
51
- background: #FF2E43;
52
- padding: 4px 8px;
53
- display: grid;
54
- place-content: center;
55
- }
56
- p {
57
- font-size: 12px;
58
- line-height: 20px;
59
- padding: 2px 16px;
60
- }
61
- }
62
-
63
42
  &__field {
64
43
  position: relative;
65
44
  overflow: hidden;
@@ -31,28 +31,13 @@
31
31
  </svg>
32
32
  </div>
33
33
  </div>
34
- <div class="adt-text-block__error" v-if="!!errorText">
35
- <div class="error-icon">
36
- <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
37
- <g clip-path="url(#clip0_508_13640)">
38
- <path d="M8.00016 14.6666C11.6821 14.6666 14.6668 11.6818 14.6668 7.99992C14.6668 4.31802 11.6821 1.33325 8.00016 1.33325C4.31826 1.33325 1.3335 4.31802 1.3335 7.99992C1.3335 11.6818 4.31826 14.6666 8.00016 14.6666Z" stroke="white" stroke-linecap="round" stroke-linejoin="round"/>
39
- <path d="M8 10.6667H8.00667" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
40
- <path d="M8 5.33325V7.99992" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
41
- </g>
42
- <defs>
43
- <clipPath id="clip0_508_13640">
44
- <rect width="16" height="16" fill="white"/>
45
- </clipPath>
46
- </defs>
47
- </svg>
48
- </div>
49
- <p>{{ errorText }}</p>
50
- </div>
34
+ <a-text-error v-if="!!errorText" :errorText="errorText" />
51
35
  </div>
52
36
  </template>
53
37
 
54
38
  <script>
55
- import '../../assets/style.scss';
39
+ import '@/assets/style.scss';
40
+ import ATextError from "@/components/TextError/TextError";
56
41
 
57
42
  export default {
58
43
  name: "PasswordField",
@@ -74,6 +59,9 @@ export default {
74
59
  required: true,
75
60
  }
76
61
  },
62
+ components: {
63
+ ATextError
64
+ },
77
65
  data() {
78
66
  return {
79
67
  showPassword: false
@@ -46,23 +46,7 @@
46
46
  </svg>
47
47
  </div>
48
48
  </div>
49
- <div class="adt-text-block__error" v-if="!!errorText">
50
- <div class="error-icon">
51
- <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
52
- <g clip-path="url(#clip0_508_13640)">
53
- <path d="M8.00016 14.6666C11.6821 14.6666 14.6668 11.6818 14.6668 7.99992C14.6668 4.31802 11.6821 1.33325 8.00016 1.33325C4.31826 1.33325 1.3335 4.31802 1.3335 7.99992C1.3335 11.6818 4.31826 14.6666 8.00016 14.6666Z" stroke="white" stroke-linecap="round" stroke-linejoin="round"/>
54
- <path d="M8 10.6667H8.00667" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
55
- <path d="M8 5.33325V7.99992" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
56
- </g>
57
- <defs>
58
- <clipPath id="clip0_508_13640">
59
- <rect width="16" height="16" fill="white"/>
60
- </clipPath>
61
- </defs>
62
- </svg>
63
- </div>
64
- <p>{{ errorText }}</p>
65
- </div>
49
+ <text-error v-if="!!errorText" :errorText="errorText" />
66
50
  <div
67
51
  class="adt-text-block__options search-options"
68
52
  v-show="options && options.length > 0 && showAutocomplete"
@@ -88,10 +72,11 @@
88
72
  </template>
89
73
 
90
74
  <script>
91
- import "../../assets/style.scss";
75
+ import "@/assets/style.scss";
92
76
 
93
77
  import { PerfectScrollbar } from "vue2-perfect-scrollbar";
94
78
  import vClickOutside from "v-click-outside";
79
+ import TextError from "@/components/TextError/TextError";
95
80
 
96
81
  export default {
97
82
  name: "SearchTextField",
@@ -163,6 +148,7 @@ export default {
163
148
  },
164
149
  components: {
165
150
  PerfectScrollbar,
151
+ TextError
166
152
  },
167
153
  data() {
168
154
  return {
@@ -44,31 +44,12 @@
44
44
  </svg>
45
45
  </div>
46
46
  </div>
47
- <div class="adt-text-block__error" v-if="!!errorText">
48
- <svg
49
- width="14"
50
- height="14"
51
- viewBox="0 0 16 16"
52
- fill="none"
53
- xmlns="http://www.w3.org/2000/svg"
54
- id="icon__attention"
55
- >
56
- <path
57
- 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"
58
- fill="#FF2E43"
59
- />
60
- <path
61
- 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"
62
- fill="#FF2E43"
63
- />
64
- <circle cx="8" cy="8" r="7" stroke="#FF2E43" />
65
- </svg>
66
- {{ errorText }}
67
- </div>
47
+ <text-error v-if="!!errorText" :errorText="errorText" />
68
48
  </div>
69
49
  </template>
70
50
  <script>
71
- import "../../assets/style.scss";
51
+ import "@/assets/style.scss";
52
+ import TextError from "@/components/TextError/TextError";
72
53
 
73
54
  export default {
74
55
  name: "TextArea",
@@ -110,6 +91,9 @@ export default {
110
91
  default: false,
111
92
  },
112
93
  },
94
+ components: {
95
+ TextError
96
+ },
113
97
  data() {
114
98
  return {
115
99
  showPlaceholder: false,
@@ -0,0 +1,15 @@
1
+ import TextError from "./TextError";
2
+
3
+ export default {
4
+ title: 'TextError',
5
+ component: TextError,
6
+ }
7
+
8
+ const Template = (args, { argTypes }) => ({
9
+ components: { TextError },
10
+ props: Object.keys(argTypes),
11
+ template: '<text-error v-bind="$props"></text-error>'
12
+ })
13
+
14
+ export const Default = Template.bind({});
15
+ Default.args = {errorText: 'Введите больше чем 20 символов'}
@@ -0,0 +1,58 @@
1
+ <template>
2
+ <div class="adt-text-error">
3
+ <div class="adt-text-error__icon">
4
+ <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
5
+ <g clip-path="url(#clip0_508_13640)">
6
+ <path
7
+ d="M8.00016 14.6666C11.6821 14.6666 14.6668 11.6818 14.6668 7.99992C14.6668 4.31802 11.6821 1.33325 8.00016 1.33325C4.31826 1.33325 1.3335 4.31802 1.3335 7.99992C1.3335 11.6818 4.31826 14.6666 8.00016 14.6666Z"
8
+ stroke="white" stroke-linecap="round" stroke-linejoin="round"/>
9
+ <path d="M8 10.6667H8.00667" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
10
+ <path d="M8 5.33325V7.99992" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
11
+ </g>
12
+ <defs>
13
+ <clipPath id="clip0_508_13640">
14
+ <rect width="16" height="16" fill="white"/>
15
+ </clipPath>
16
+ </defs>
17
+ </svg>
18
+ </div>
19
+ <p class="adt-text-error__text">{{ errorText }}</p>
20
+ </div>
21
+ </template>
22
+
23
+ <script>
24
+ export default {
25
+ name: "TextError",
26
+ props: {
27
+ errorText: {
28
+ type: String,
29
+ default: ""
30
+ },
31
+ },
32
+ };
33
+ </script>
34
+
35
+ <style lang="scss" scoped>
36
+ .adt-text-error {
37
+ display: flex;
38
+ align-items: center;
39
+ background: rgba(255, 46, 67, 0.12);
40
+ border-radius: 4px;
41
+ overflow: hidden;
42
+ color: #2c3e50;
43
+ margin-top: 8px;
44
+
45
+ &__icon {
46
+ background: #FF2E43;
47
+ padding: 4px 8px;
48
+ display: grid;
49
+ place-content: center;
50
+ }
51
+
52
+ &__text {
53
+ font-size: 12px;
54
+ line-height: 20px;
55
+ padding: 2px 16px;
56
+ }
57
+ }
58
+ </style>
@@ -39,30 +39,18 @@
39
39
  </svg>
40
40
  </div>
41
41
  </div>
42
- <div class="adt-text-block__error" v-if="!!errorText">
43
- <div class="error-icon">
44
- <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
45
- <g clip-path="url(#clip0_508_13640)">
46
- <path d="M8.00016 14.6666C11.6821 14.6666 14.6668 11.6818 14.6668 7.99992C14.6668 4.31802 11.6821 1.33325 8.00016 1.33325C4.31826 1.33325 1.3335 4.31802 1.3335 7.99992C1.3335 11.6818 4.31826 14.6666 8.00016 14.6666Z" stroke="white" stroke-linecap="round" stroke-linejoin="round"/>
47
- <path d="M8 10.6667H8.00667" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
48
- <path d="M8 5.33325V7.99992" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
49
- </g>
50
- <defs>
51
- <clipPath id="clip0_508_13640">
52
- <rect width="16" height="16" fill="white"/>
53
- </clipPath>
54
- </defs>
55
- </svg>
56
- </div>
57
- <p>{{ errorText }}</p>
58
- </div>
42
+ <text-error v-if="!!errorText" :errorText="errorText" />
59
43
  </div>
60
44
  </template>
61
45
  <script>
62
- import "../../assets/style.scss";
46
+ import "@/assets/style.scss";
47
+ import TextError from "@/components/TextError/TextError";
63
48
 
64
49
  export default {
65
50
  name: "TextField",
51
+ components: {
52
+ TextError
53
+ },
66
54
  props: {
67
55
  id: {
68
56
  type: String,
@@ -1,16 +0,0 @@
1
- import APasswordField from "./SearchMultiCategory.vue";
2
-
3
- export default {
4
- title: 'PasswordField',
5
- component: APasswordField,
6
- template: "<a-password-field label='Example'></a-password-field>"
7
- }
8
-
9
- const Template = (args, { argTypes }) => ({
10
- components: { APasswordField },
11
- props: Object.keys(argTypes),
12
- template: '<a-password-field v-bind="$props"></a-password-field>'
13
- })
14
-
15
- export const BasePasswordField = Template.bind({});
16
- BasePasswordField.args = {label: 'Password'}
@@ -1,75 +0,0 @@
1
- <template>
2
- <div class="adt-text-block">
3
- <div class="adt-text-block__field">
4
- <input
5
- ref="input"
6
- :type="type"
7
- :value="value"
8
- required
9
- @input="$emit('input', $event.target.value)"
10
- class="adt-text-block__input"
11
- :class="{ error: !!errorText }"
12
- />
13
- <label class="adt-text-block__label">{{ label }}</label>
14
- <div v-if="showPassword" @click="showPassword = false" class="adt-text-block__icon desktop">
15
- <svg width="12" height="12" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 511.992 511.992" id="openedEye">
16
- <path
17
- d="M510.096 249.937c-4.032-5.867-100.928-143.275-254.101-143.275-131.435 0-248.555 136.619-253.483 142.443-3.349 3.968-3.349 9.792 0 13.781C7.44 268.71 124.56 405.329 255.995 405.329S504.549 268.71 509.477 262.886c3.094-3.669 3.371-8.981.619-12.949zM255.995 383.996c-105.365 0-205.547-100.48-230.997-128 25.408-27.541 125.483-128 230.997-128 123.285 0 210.304 100.331 231.552 127.424-24.534 26.645-125.291 128.576-231.552 128.576z"></path>
18
- <path
19
- d="M255.995 170.662c-47.061 0-85.333 38.272-85.333 85.333s38.272 85.333 85.333 85.333 85.333-38.272 85.333-85.333-38.272-85.333-85.333-85.333zm0 149.334c-35.285 0-64-28.715-64-64s28.715-64 64-64 64 28.715 64 64-28.715 64-64 64z"></path>
20
- </svg>
21
- </div>
22
- <div v-else @click="showPassword = true" class="adt-text-block__icon desktop">
23
- <svg width="12" height="12" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512.001 512.001" id="closedEye">
24
- <path
25
- d="M316.332 195.662c-4.16-4.16-10.923-4.16-15.083 0s-4.16 10.944 0 15.083c12.075 12.075 18.752 28.139 18.752 45.248 0 35.285-28.715 64-64 64-17.109 0-33.173-6.656-45.248-18.752-4.16-4.16-10.923-4.16-15.083 0-4.16 4.139-4.16 10.923 0 15.083 16.085 16.128 37.525 25.003 60.331 25.003 47.061 0 85.333-38.272 85.333-85.333 0-22.807-8.874-44.247-25.002-60.332zm-45.462-23.531c-4.843-.853-9.792-1.472-14.869-1.472-47.061 0-85.333 38.272-85.333 85.333 0 5.077.619 10.027 1.493 14.869.917 5.163 5.419 8.811 10.475 8.811.619 0 1.237-.043 1.877-.171 5.781-1.024 9.664-6.571 8.64-12.352-.661-3.627-1.152-7.317-1.152-11.157 0-35.285 28.715-64 64-64 3.84 0 7.531.491 11.157 1.131 5.675 1.152 11.328-2.859 12.352-8.64 1.024-5.781-2.858-11.328-8.64-12.352z"></path>
26
- <path
27
- d="M509.462 249.102c-2.411-2.859-60.117-70.208-139.712-111.445-5.163-2.709-11.669-.661-14.379 4.587-2.709 5.227-.661 11.669 4.587 14.379 61.312 31.744 110.293 81.28 127.04 99.371-25.429 27.541-125.504 128-230.997 128-35.797 0-71.872-8.64-107.264-25.707-5.248-2.581-11.669-.341-14.229 4.971-2.581 5.291-.341 11.669 4.971 14.229 38.293 18.496 77.504 27.84 116.523 27.84 131.435 0 248.555-136.619 253.483-142.443 3.369-3.969 3.348-9.793-.023-13.782zM325.996 118.947c-24.277-8.171-47.829-12.288-69.995-12.288-131.435 0-248.555 136.619-253.483 142.443-3.115 3.669-3.371 9.003-.597 12.992 1.472 2.112 36.736 52.181 97.856 92.779a10.48 10.48 0 005.888 1.792c3.435 0 6.827-1.664 8.875-4.8 3.264-4.885 1.92-11.52-2.987-14.763-44.885-29.845-75.605-65.877-87.104-80.533 24.555-26.667 125.291-128.576 231.552-128.576 19.861 0 41.131 3.755 63.189 11.157 5.589 2.005 11.648-1.088 13.504-6.699 1.878-5.589-1.109-11.626-6.698-13.504z"></path>
28
- <path
29
- d="M444.865 67.128c-4.16-4.16-10.923-4.16-15.083 0L67.116 429.795c-4.16 4.16-4.16 10.923 0 15.083a10.716 10.716 0 007.552 3.115c2.731 0 5.461-1.045 7.531-3.115L444.865 82.211c4.16-4.16 4.16-10.923 0-15.083z"></path>
30
- </svg>
31
- </div>
32
- </div>
33
- <div class="adt-text-block__error" v-if="!!errorText">
34
- <svg width="14" height="14" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" id="icon__attention">
35
- <path 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" fill="#FF2E43"/>
36
- <path 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" fill="#FF2E43"/>
37
- <circle cx="8" cy="8" r="7" stroke="#FF2E43"/>
38
- </svg>
39
- {{ errorText }}
40
- </div>
41
- </div>
42
- </template>
43
-
44
- <script>
45
- import '../../assets/style.scss';
46
-
47
- export default {
48
- name: "PasswordField",
49
- props: {
50
- errorText: {
51
- type: String,
52
- default: ""
53
- },
54
- label: {
55
- type: String,
56
- required: true,
57
- },
58
- value: {
59
- type: [String, null],
60
- required: true,
61
- }
62
- },
63
- data() {
64
- return {
65
- showPassword: false
66
- }
67
- },
68
- computed: {
69
- type() {
70
- return this.showPassword ? "text" : "password";
71
- }
72
- }
73
- }
74
- </script>
75
-