adata-ui 0.3.73 → 0.3.74
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/README.md +7 -7
- package/babel.config.js +5 -5
- package/package.json +76 -76
- package/public/index.html +17 -17
- package/public/logo.svg +4 -4
- package/src/App.vue +25 -25
- package/src/assets/_text_field.scss +224 -224
- package/src/assets/facebook.svg +4 -4
- package/src/assets/instagram.svg +6 -6
- package/src/assets/logo-desktop-main.svg +8 -8
- package/src/assets/logo-desktop.svg +9 -9
- package/src/assets/logo-mobile-main.svg +4 -4
- package/src/assets/logo-mobile.svg +9 -9
- package/src/assets/logo-white-desktop.svg +8 -8
- package/src/assets/style.scss +1 -1
- package/src/assets/telegram.svg +4 -4
- package/src/assets/tiktok.svg +4 -4
- package/src/assets/up-down.svg +3 -3
- package/src/assets/youtube.svg +5 -5
- package/src/components/Alert/Alert.stories.js +17 -17
- package/src/components/Alert/Alert.vue +63 -63
- package/src/components/BottomNavigationBar/ABottomNavigationBar.vue +160 -160
- package/src/components/BottomNavigationBar/BottomNavigationBar.stories.js +24 -24
- package/src/components/Button/AButton.vue +231 -231
- package/src/components/Button/Button.stories.js +23 -23
- package/src/components/Checkbox/ACheckbox.vue +114 -114
- package/src/components/Checkbox/Checkbox.stories.js +15 -15
- package/src/components/CheckboxMenu/CheckboxMenu.stories.js +23 -23
- package/src/components/CheckboxMenu/CheckboxMenu.vue +108 -108
- package/src/components/ErrorPages/BadGateway.vue +224 -224
- package/src/components/ErrorPages/Forbidden.vue +468 -468
- package/src/components/ErrorPages/InternalServerError.vue +275 -275
- package/src/components/ErrorPages/NotFound.vue +995 -995
- package/src/components/ErrorPages/Unavailable.vue +3705 -3705
- package/src/components/Footer/Footer.stories.js +20 -20
- package/src/components/Footer/Footer.vue +292 -292
- package/src/components/Header/ChildLinks.vue +141 -122
- package/src/components/Header/Header.stories.js +56 -56
- package/src/components/Header/Header.vue +1289 -1289
- package/src/components/Header/InfoHeader.vue +319 -319
- package/src/components/Header/Profile.vue +670 -670
- package/src/components/Header/ProfileMenu.vue +291 -276
- package/src/components/Header/ProfileMobile.vue +308 -308
- package/src/components/Header/ProfileOld.vue +781 -781
- package/src/components/InternalServerError/InternalServerError.stories.js +16 -16
- package/src/components/InternalServerError/InternalServerError.vue +262 -262
- package/src/components/Introduction.stories.mdx +7 -7
- package/src/components/Loader/Loader.stories.js +24 -24
- package/src/components/Loader/Loader.vue +325 -325
- package/src/components/MailTo/MailTo.stories.js +14 -14
- package/src/components/MailTo/MailTo.vue +258 -258
- package/src/components/NavIcon/ANavIcon.vue +49 -49
- package/src/components/NavIcon/NavIcon.stories.js +14 -14
- package/src/components/PasswordField/PasswordField.stories.js +16 -16
- package/src/components/PasswordField/PasswordField.vue +77 -77
- package/src/components/SearchTextField/SearchTextField.stories.js +77 -77
- package/src/components/SearchTextField/SearchTextField.vue +230 -230
- package/src/components/ServiceSlider/AServiceSlider.vue +782 -782
- package/src/components/ServiceSlider/ServiceSlider.stories.js +20 -20
- package/src/components/Table/ATable.vue +117 -117
- package/src/components/Table/Table.stories.js +15 -15
- package/src/components/TextArea/TextArea.stories.js +17 -17
- package/src/components/TextArea/TextArea.vue +116 -116
- package/src/components/TextError/TextError.stories.js +15 -15
- package/src/components/TextError/TextError.vue +57 -57
- package/src/components/TextField/TextField.stories.js +17 -17
- package/src/components/TextField/TextField.vue +107 -107
- package/src/components/index.js +54 -54
- package/src/components/newComponents/FooterNew/FooterBottom.vue +153 -153
- package/src/components/newComponents/FooterNew/FooterItem.vue +113 -113
- package/src/components/newComponents/FooterNew/FooterNew.stories.js +20 -20
- package/src/components/newComponents/FooterNew/FooterNew.vue +39 -39
- package/src/components/newComponents/FooterNew/FooterTop.vue +321 -321
- package/src/components/transitions/SlideToggle.vue +55 -55
- package/src/components/transitions/VerticalMobileToggle.vue +75 -75
- package/src/configs/icons.js +112 -112
- package/src/configs/profileDropDown.js +134 -134
- package/src/main.js +12 -12
- package/dist/adata-ui.common.js +0 -12969
- package/dist/adata-ui.common.js.map +0 -1
- package/dist/adata-ui.css +0 -1
- package/dist/adata-ui.umd.js +0 -12979
- package/dist/adata-ui.umd.js.map +0 -1
- package/dist/adata-ui.umd.min.js +0 -7
- package/dist/adata-ui.umd.min.js.map +0 -1
- package/dist/demo.html +0 -10
- package/dist/img/facebook.797d820f.svg +0 -4
- package/dist/img/instagram.8a77381c.svg +0 -6
- package/dist/img/logo-desktop-main.4d169395.svg +0 -8
- package/dist/img/logo-mobile-main.397bce24.svg +0 -4
- package/dist/img/logo-white-desktop.7d0e3481.svg +0 -8
- package/dist/img/telegram.be0d1008.svg +0 -4
- package/dist/img/tiktok.eaeb39cb.svg +0 -4
- package/dist/img/up-down.e2b28f72.svg +0 -3
- package/dist/img/youtube.125aace6.svg +0 -5
- package/package-lock.json +0 -26218
|
@@ -1,114 +1,114 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<label :for="fakeHash" class="a-checkbox">
|
|
3
|
-
<input
|
|
4
|
-
type="checkbox"
|
|
5
|
-
:id="fakeHash"
|
|
6
|
-
:value="inputValue"
|
|
7
|
-
v-model="model"
|
|
8
|
-
class="a-checkbox__input"
|
|
9
|
-
:disabled="disabled"
|
|
10
|
-
/>
|
|
11
|
-
<span class="checkmark" />
|
|
12
|
-
<span class="a-checkbox__label">{{ label }}</span>
|
|
13
|
-
</label>
|
|
14
|
-
</template>
|
|
15
|
-
|
|
16
|
-
<script>
|
|
17
|
-
export default {
|
|
18
|
-
props: {
|
|
19
|
-
id: {
|
|
20
|
-
type: [String, Number],
|
|
21
|
-
default: null,
|
|
22
|
-
},
|
|
23
|
-
inputValue: {
|
|
24
|
-
type: [String, Boolean],
|
|
25
|
-
default: null,
|
|
26
|
-
},
|
|
27
|
-
value: {
|
|
28
|
-
type: [Array, Number, String, Boolean],
|
|
29
|
-
default: null,
|
|
30
|
-
},
|
|
31
|
-
label: {
|
|
32
|
-
type: String,
|
|
33
|
-
default: "",
|
|
34
|
-
},
|
|
35
|
-
disabled: {
|
|
36
|
-
type: Boolean,
|
|
37
|
-
default: false,
|
|
38
|
-
},
|
|
39
|
-
},
|
|
40
|
-
computed: {
|
|
41
|
-
fakeHash: function () {
|
|
42
|
-
return `${this.id}_${this.label}_checkbox`;
|
|
43
|
-
},
|
|
44
|
-
model: {
|
|
45
|
-
get() {
|
|
46
|
-
return this.value;
|
|
47
|
-
},
|
|
48
|
-
set(value) {
|
|
49
|
-
this.$emit("input", value);
|
|
50
|
-
},
|
|
51
|
-
},
|
|
52
|
-
},
|
|
53
|
-
};
|
|
54
|
-
</script>
|
|
55
|
-
|
|
56
|
-
<style lang="scss" scoped>
|
|
57
|
-
.a-checkbox {
|
|
58
|
-
padding: 8px 0;
|
|
59
|
-
display: flex;
|
|
60
|
-
align-items: center;
|
|
61
|
-
position: relative;
|
|
62
|
-
cursor: pointer;
|
|
63
|
-
-webkit-user-select: none;
|
|
64
|
-
-moz-user-select: none;
|
|
65
|
-
-ms-user-select: none;
|
|
66
|
-
user-select: none;
|
|
67
|
-
|
|
68
|
-
&__input {
|
|
69
|
-
opacity: 0;
|
|
70
|
-
cursor: pointer;
|
|
71
|
-
height: 0;
|
|
72
|
-
width: 0;
|
|
73
|
-
&:checked ~ .checkmark {
|
|
74
|
-
position: relative;
|
|
75
|
-
background: #007aff;
|
|
76
|
-
border: 1px solid transparent;
|
|
77
|
-
}
|
|
78
|
-
&:checked ~ .checkmark:after {
|
|
79
|
-
display: block;
|
|
80
|
-
background-image: url("data:image/svg+xml,%3Csvg%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2016%2012%22%3E%0A%20%20%20%20%3Cpath%20d%3D%22M1%206.556L5.308%2011%2015%201%22%20stroke%3D%22%23fff%22%20stroke-width%3D%221.5%22%20stroke-miterlimit%3D%2210%22%20stroke-linecap%3D%22round%22%0A%20%20%20%20%20%20%20%20stroke-linejoin%3D%22round%22%3E%3C%2Fpath%3E%0A%3C%2Fsvg%3E");
|
|
81
|
-
background-position: center center;
|
|
82
|
-
background-repeat: no-repeat;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
&__label {
|
|
87
|
-
font-size: 14px;
|
|
88
|
-
line-height: 22px;
|
|
89
|
-
color: var(--newGray);
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
.checkmark {
|
|
94
|
-
border: 1px solid #9da3ac;
|
|
95
|
-
border-radius: 2px;
|
|
96
|
-
width: 16px;
|
|
97
|
-
height: 16px;
|
|
98
|
-
cursor: pointer;
|
|
99
|
-
margin-right: 8px;
|
|
100
|
-
display: flex;
|
|
101
|
-
justify-content: center;
|
|
102
|
-
align-items: center;
|
|
103
|
-
flex-shrink: 0;
|
|
104
|
-
background: #fff;
|
|
105
|
-
&:after {
|
|
106
|
-
content: "";
|
|
107
|
-
position: absolute;
|
|
108
|
-
left: -1px;
|
|
109
|
-
top: -1px;
|
|
110
|
-
width: 16px;
|
|
111
|
-
height: 16px;
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<label :for="fakeHash" class="a-checkbox">
|
|
3
|
+
<input
|
|
4
|
+
type="checkbox"
|
|
5
|
+
:id="fakeHash"
|
|
6
|
+
:value="inputValue"
|
|
7
|
+
v-model="model"
|
|
8
|
+
class="a-checkbox__input"
|
|
9
|
+
:disabled="disabled"
|
|
10
|
+
/>
|
|
11
|
+
<span class="checkmark" />
|
|
12
|
+
<span class="a-checkbox__label">{{ label }}</span>
|
|
13
|
+
</label>
|
|
14
|
+
</template>
|
|
15
|
+
|
|
16
|
+
<script>
|
|
17
|
+
export default {
|
|
18
|
+
props: {
|
|
19
|
+
id: {
|
|
20
|
+
type: [String, Number],
|
|
21
|
+
default: null,
|
|
22
|
+
},
|
|
23
|
+
inputValue: {
|
|
24
|
+
type: [String, Boolean],
|
|
25
|
+
default: null,
|
|
26
|
+
},
|
|
27
|
+
value: {
|
|
28
|
+
type: [Array, Number, String, Boolean],
|
|
29
|
+
default: null,
|
|
30
|
+
},
|
|
31
|
+
label: {
|
|
32
|
+
type: String,
|
|
33
|
+
default: "",
|
|
34
|
+
},
|
|
35
|
+
disabled: {
|
|
36
|
+
type: Boolean,
|
|
37
|
+
default: false,
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
computed: {
|
|
41
|
+
fakeHash: function () {
|
|
42
|
+
return `${this.id}_${this.label}_checkbox`;
|
|
43
|
+
},
|
|
44
|
+
model: {
|
|
45
|
+
get() {
|
|
46
|
+
return this.value;
|
|
47
|
+
},
|
|
48
|
+
set(value) {
|
|
49
|
+
this.$emit("input", value);
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
</script>
|
|
55
|
+
|
|
56
|
+
<style lang="scss" scoped>
|
|
57
|
+
.a-checkbox {
|
|
58
|
+
padding: 8px 0;
|
|
59
|
+
display: flex;
|
|
60
|
+
align-items: center;
|
|
61
|
+
position: relative;
|
|
62
|
+
cursor: pointer;
|
|
63
|
+
-webkit-user-select: none;
|
|
64
|
+
-moz-user-select: none;
|
|
65
|
+
-ms-user-select: none;
|
|
66
|
+
user-select: none;
|
|
67
|
+
|
|
68
|
+
&__input {
|
|
69
|
+
opacity: 0;
|
|
70
|
+
cursor: pointer;
|
|
71
|
+
height: 0;
|
|
72
|
+
width: 0;
|
|
73
|
+
&:checked ~ .checkmark {
|
|
74
|
+
position: relative;
|
|
75
|
+
background: #007aff;
|
|
76
|
+
border: 1px solid transparent;
|
|
77
|
+
}
|
|
78
|
+
&:checked ~ .checkmark:after {
|
|
79
|
+
display: block;
|
|
80
|
+
background-image: url("data:image/svg+xml,%3Csvg%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2016%2012%22%3E%0A%20%20%20%20%3Cpath%20d%3D%22M1%206.556L5.308%2011%2015%201%22%20stroke%3D%22%23fff%22%20stroke-width%3D%221.5%22%20stroke-miterlimit%3D%2210%22%20stroke-linecap%3D%22round%22%0A%20%20%20%20%20%20%20%20stroke-linejoin%3D%22round%22%3E%3C%2Fpath%3E%0A%3C%2Fsvg%3E");
|
|
81
|
+
background-position: center center;
|
|
82
|
+
background-repeat: no-repeat;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
&__label {
|
|
87
|
+
font-size: 14px;
|
|
88
|
+
line-height: 22px;
|
|
89
|
+
color: var(--newGray);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.checkmark {
|
|
94
|
+
border: 1px solid #9da3ac;
|
|
95
|
+
border-radius: 2px;
|
|
96
|
+
width: 16px;
|
|
97
|
+
height: 16px;
|
|
98
|
+
cursor: pointer;
|
|
99
|
+
margin-right: 8px;
|
|
100
|
+
display: flex;
|
|
101
|
+
justify-content: center;
|
|
102
|
+
align-items: center;
|
|
103
|
+
flex-shrink: 0;
|
|
104
|
+
background: #fff;
|
|
105
|
+
&:after {
|
|
106
|
+
content: "";
|
|
107
|
+
position: absolute;
|
|
108
|
+
left: -1px;
|
|
109
|
+
top: -1px;
|
|
110
|
+
width: 16px;
|
|
111
|
+
height: 16px;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
</style>
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import ACheckbox from "./ACheckbox.vue";
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
title: "Checkbox",
|
|
5
|
-
component: ACheckbox,
|
|
6
|
-
template: "<a-checkbox></a-checkbox>",
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
const Template = (args, { argTypes }) => ({
|
|
10
|
-
components: { ACheckbox },
|
|
11
|
-
props: Object.keys(argTypes),
|
|
12
|
-
template: "<a-checkbox v-bind='$props'></a-checkbox>",
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
export const BaseCheckbox = Template.bind({});
|
|
1
|
+
import ACheckbox from "./ACheckbox.vue";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: "Checkbox",
|
|
5
|
+
component: ACheckbox,
|
|
6
|
+
template: "<a-checkbox></a-checkbox>",
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
const Template = (args, { argTypes }) => ({
|
|
10
|
+
components: { ACheckbox },
|
|
11
|
+
props: Object.keys(argTypes),
|
|
12
|
+
template: "<a-checkbox v-bind='$props'></a-checkbox>",
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export const BaseCheckbox = Template.bind({});
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import ACheckboxMenu from "./CheckboxMenu.vue";
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
title: 'CheckboxMenu',
|
|
5
|
-
component: ACheckboxMenu,
|
|
6
|
-
data: () => ({ value: "" }),
|
|
7
|
-
template: "<a-checkbox-menu @input='(val) => {this.value = val}' label='Example'></a-checkbox-menu>>"
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const Template = (args, { argTypes }) => ({
|
|
12
|
-
components: { ACheckboxMenu },
|
|
13
|
-
props: Object.keys(argTypes),
|
|
14
|
-
template: '<a-checkbox-menu v-bind="$props" @enterPressed="enterPressed"></a-checkbox-menu>'
|
|
15
|
-
})
|
|
16
|
-
|
|
17
|
-
export const Simple = Template.bind({});
|
|
18
|
-
Simple.args = {
|
|
19
|
-
options: JSON.parse('[{"code":"13.92.21.300.000.00.0796.000000000002","name":"Мешок"},{"code":"172112.300.000001","name":"Мешок"},{"code":"139221.900.000000","name":"Мешок"},{"code":"139224.350.000000","name":"Мешок"},{"code":"000000000000952557","name":"МЕШОК ТРЕХСЛОЙНЫЙ 50кг ПП"},{"code":"000000000000952559","name":"МЕШОК 350Х950 ДЛЯ ПРОБ 10кг ПП"},{"code":"13.92.21.300.000.00.0736.000000000011","name":"Мешок"},{"code":"22.22.12.900.001.00.0796.000000000027","name":"Мешок"},{"code":"13.92.21.300.000.00.0736.000000000008","name":"Мешок"},{"code":"139221.900.000002","name":"Мешок"},{"code":"139221.300.000003","name":"Мешок"},{"code":"151213.000.000007","name":"Ремешок"},{"code":"139223.000.000047","name":"Мешок"},{"code":"141923.950.000000","name":"Ремешок"},{"code":"13.92.21.300.000.00.0736.000000000004","name":"Мешок"},{"code":"139221.300.000004","name":"Мешок"},{"code":"13.92.21.300.000.00.0796.000000000008","name":"Мешок"},{"code":"13.92.21.900.000.00.0796.000000000004","name":"Мешок"},{"code":"22.22.12.900.001.00.0796.000000000029","name":"Мешок"},{"code":"13.92.21.00.00.00.30.13.2","name":"Мешок для мусора"}]'),
|
|
20
|
-
optionFields: ["name"],
|
|
21
|
-
exceptions: [
|
|
22
|
-
JSON.parse('{"code":"000000000000952557","name":"МЕШОК ТРЕХСЛОЙНЫЙ 50кг ПП"}')
|
|
23
|
-
]
|
|
1
|
+
import ACheckboxMenu from "./CheckboxMenu.vue";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: 'CheckboxMenu',
|
|
5
|
+
component: ACheckboxMenu,
|
|
6
|
+
data: () => ({ value: "" }),
|
|
7
|
+
template: "<a-checkbox-menu @input='(val) => {this.value = val}' label='Example'></a-checkbox-menu>>"
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
const Template = (args, { argTypes }) => ({
|
|
12
|
+
components: { ACheckboxMenu },
|
|
13
|
+
props: Object.keys(argTypes),
|
|
14
|
+
template: '<a-checkbox-menu v-bind="$props" @enterPressed="enterPressed"></a-checkbox-menu>'
|
|
15
|
+
})
|
|
16
|
+
|
|
17
|
+
export const Simple = Template.bind({});
|
|
18
|
+
Simple.args = {
|
|
19
|
+
options: JSON.parse('[{"code":"13.92.21.300.000.00.0796.000000000002","name":"Мешок"},{"code":"172112.300.000001","name":"Мешок"},{"code":"139221.900.000000","name":"Мешок"},{"code":"139224.350.000000","name":"Мешок"},{"code":"000000000000952557","name":"МЕШОК ТРЕХСЛОЙНЫЙ 50кг ПП"},{"code":"000000000000952559","name":"МЕШОК 350Х950 ДЛЯ ПРОБ 10кг ПП"},{"code":"13.92.21.300.000.00.0736.000000000011","name":"Мешок"},{"code":"22.22.12.900.001.00.0796.000000000027","name":"Мешок"},{"code":"13.92.21.300.000.00.0736.000000000008","name":"Мешок"},{"code":"139221.900.000002","name":"Мешок"},{"code":"139221.300.000003","name":"Мешок"},{"code":"151213.000.000007","name":"Ремешок"},{"code":"139223.000.000047","name":"Мешок"},{"code":"141923.950.000000","name":"Ремешок"},{"code":"13.92.21.300.000.00.0736.000000000004","name":"Мешок"},{"code":"139221.300.000004","name":"Мешок"},{"code":"13.92.21.300.000.00.0796.000000000008","name":"Мешок"},{"code":"13.92.21.900.000.00.0796.000000000004","name":"Мешок"},{"code":"22.22.12.900.001.00.0796.000000000029","name":"Мешок"},{"code":"13.92.21.00.00.00.30.13.2","name":"Мешок для мусора"}]'),
|
|
20
|
+
optionFields: ["name"],
|
|
21
|
+
exceptions: [
|
|
22
|
+
JSON.parse('{"code":"000000000000952557","name":"МЕШОК ТРЕХСЛОЙНЫЙ 50кг ПП"}')
|
|
23
|
+
]
|
|
24
24
|
}
|
|
@@ -1,108 +1,108 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="search-options__item checkboxes__selects">
|
|
3
|
-
<div class="checkboxes__selects__item" v-for="(option, index) in options" :key="index + 'a'">
|
|
4
|
-
<input
|
|
5
|
-
:value="option.code"
|
|
6
|
-
:checked="isChecked(option)"
|
|
7
|
-
@change="removeChecked(option)"
|
|
8
|
-
@input="inputHandler(option)"
|
|
9
|
-
type="checkbox"
|
|
10
|
-
:id="'optionsNames' + index"
|
|
11
|
-
name="optionsNames"
|
|
12
|
-
:disabled="exceptions.length === 100"
|
|
13
|
-
>
|
|
14
|
-
<label :for="'optionsNames' + index">{{ optionToText(option) }}</label>
|
|
15
|
-
</div>
|
|
16
|
-
</div>
|
|
17
|
-
</template>
|
|
18
|
-
|
|
19
|
-
<script>
|
|
20
|
-
export default {
|
|
21
|
-
name: "CheckboxesMenu",
|
|
22
|
-
props: {
|
|
23
|
-
exceptions: {
|
|
24
|
-
type: Array,
|
|
25
|
-
default: () => []
|
|
26
|
-
},
|
|
27
|
-
options: {
|
|
28
|
-
type: Array,
|
|
29
|
-
default: () => []
|
|
30
|
-
},
|
|
31
|
-
checkName: {
|
|
32
|
-
type: String,
|
|
33
|
-
default: "code"
|
|
34
|
-
},
|
|
35
|
-
optionTemplate: {
|
|
36
|
-
type: String,
|
|
37
|
-
default: "name~ - ~code"
|
|
38
|
-
}
|
|
39
|
-
},
|
|
40
|
-
computed: {
|
|
41
|
-
optionsTemplateKeys() {
|
|
42
|
-
return this.optionTemplate.split("~")
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
methods: {
|
|
46
|
-
isChecked(option) {
|
|
47
|
-
return this.exceptions && this.exceptions.findIndex(el => {
|
|
48
|
-
return el[this.checkName] === option[this.checkName]
|
|
49
|
-
}) > -1
|
|
50
|
-
},
|
|
51
|
-
removeChecked(val) {
|
|
52
|
-
if (!event.target.checked) {
|
|
53
|
-
let idx = this.exceptions.findIndex(el => {
|
|
54
|
-
return el[this.checkName] === val[this.checkName];
|
|
55
|
-
})
|
|
56
|
-
if (idx !== -1) {
|
|
57
|
-
this.$emit("removeException", {value: val, idx});
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
},
|
|
61
|
-
optionToText(option) {
|
|
62
|
-
return this.optionsTemplateKeys.map(key => option[key] || key).join("")
|
|
63
|
-
},
|
|
64
|
-
inputHandler(option) {
|
|
65
|
-
if(event.target.checked) this.$emit('autocompleteSelect', option);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
</script>
|
|
70
|
-
|
|
71
|
-
<style lang="scss" scoped>
|
|
72
|
-
.checkboxes__selects {
|
|
73
|
-
position: absolute;
|
|
74
|
-
background: #fff;
|
|
75
|
-
width: calc(100% - 8px);
|
|
76
|
-
padding: 8px 16px;
|
|
77
|
-
max-height: 360px;
|
|
78
|
-
overflow-y: auto;
|
|
79
|
-
left: 0;
|
|
80
|
-
z-index: 1000;
|
|
81
|
-
border-radius: 2px;
|
|
82
|
-
border: 1px solid #c4c4c480;
|
|
83
|
-
&::-webkit-scrollbar {
|
|
84
|
-
width: 4px;
|
|
85
|
-
&-thumb {
|
|
86
|
-
background: #c4c4c4;
|
|
87
|
-
}
|
|
88
|
-
&-track {
|
|
89
|
-
background: #fff;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
.checkboxes__selects__item {
|
|
94
|
-
padding: 4px 0;
|
|
95
|
-
line-height: 16px;
|
|
96
|
-
font-size: 14px;
|
|
97
|
-
font-weight: 400;
|
|
98
|
-
color: #333;
|
|
99
|
-
cursor: pointer;
|
|
100
|
-
display: flex;
|
|
101
|
-
align-items: center;
|
|
102
|
-
|
|
103
|
-
input {
|
|
104
|
-
margin-right: 4px;
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div class="search-options__item checkboxes__selects">
|
|
3
|
+
<div class="checkboxes__selects__item" v-for="(option, index) in options" :key="index + 'a'">
|
|
4
|
+
<input
|
|
5
|
+
:value="option.code"
|
|
6
|
+
:checked="isChecked(option)"
|
|
7
|
+
@change="removeChecked(option)"
|
|
8
|
+
@input="inputHandler(option)"
|
|
9
|
+
type="checkbox"
|
|
10
|
+
:id="'optionsNames' + index"
|
|
11
|
+
name="optionsNames"
|
|
12
|
+
:disabled="exceptions.length === 100"
|
|
13
|
+
>
|
|
14
|
+
<label :for="'optionsNames' + index">{{ optionToText(option) }}</label>
|
|
15
|
+
</div>
|
|
16
|
+
</div>
|
|
17
|
+
</template>
|
|
18
|
+
|
|
19
|
+
<script>
|
|
20
|
+
export default {
|
|
21
|
+
name: "CheckboxesMenu",
|
|
22
|
+
props: {
|
|
23
|
+
exceptions: {
|
|
24
|
+
type: Array,
|
|
25
|
+
default: () => []
|
|
26
|
+
},
|
|
27
|
+
options: {
|
|
28
|
+
type: Array,
|
|
29
|
+
default: () => []
|
|
30
|
+
},
|
|
31
|
+
checkName: {
|
|
32
|
+
type: String,
|
|
33
|
+
default: "code"
|
|
34
|
+
},
|
|
35
|
+
optionTemplate: {
|
|
36
|
+
type: String,
|
|
37
|
+
default: "name~ - ~code"
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
computed: {
|
|
41
|
+
optionsTemplateKeys() {
|
|
42
|
+
return this.optionTemplate.split("~")
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
methods: {
|
|
46
|
+
isChecked(option) {
|
|
47
|
+
return this.exceptions && this.exceptions.findIndex(el => {
|
|
48
|
+
return el[this.checkName] === option[this.checkName]
|
|
49
|
+
}) > -1
|
|
50
|
+
},
|
|
51
|
+
removeChecked(val) {
|
|
52
|
+
if (!event.target.checked) {
|
|
53
|
+
let idx = this.exceptions.findIndex(el => {
|
|
54
|
+
return el[this.checkName] === val[this.checkName];
|
|
55
|
+
})
|
|
56
|
+
if (idx !== -1) {
|
|
57
|
+
this.$emit("removeException", {value: val, idx});
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
optionToText(option) {
|
|
62
|
+
return this.optionsTemplateKeys.map(key => option[key] || key).join("")
|
|
63
|
+
},
|
|
64
|
+
inputHandler(option) {
|
|
65
|
+
if(event.target.checked) this.$emit('autocompleteSelect', option);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
</script>
|
|
70
|
+
|
|
71
|
+
<style lang="scss" scoped>
|
|
72
|
+
.checkboxes__selects {
|
|
73
|
+
position: absolute;
|
|
74
|
+
background: #fff;
|
|
75
|
+
width: calc(100% - 8px);
|
|
76
|
+
padding: 8px 16px;
|
|
77
|
+
max-height: 360px;
|
|
78
|
+
overflow-y: auto;
|
|
79
|
+
left: 0;
|
|
80
|
+
z-index: 1000;
|
|
81
|
+
border-radius: 2px;
|
|
82
|
+
border: 1px solid #c4c4c480;
|
|
83
|
+
&::-webkit-scrollbar {
|
|
84
|
+
width: 4px;
|
|
85
|
+
&-thumb {
|
|
86
|
+
background: #c4c4c4;
|
|
87
|
+
}
|
|
88
|
+
&-track {
|
|
89
|
+
background: #fff;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.checkboxes__selects__item {
|
|
94
|
+
padding: 4px 0;
|
|
95
|
+
line-height: 16px;
|
|
96
|
+
font-size: 14px;
|
|
97
|
+
font-weight: 400;
|
|
98
|
+
color: #333;
|
|
99
|
+
cursor: pointer;
|
|
100
|
+
display: flex;
|
|
101
|
+
align-items: center;
|
|
102
|
+
|
|
103
|
+
input {
|
|
104
|
+
margin-right: 4px;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
</style>
|