@avakhula/ui 0.0.505 → 0.0.510-alpha-spa.1
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/.babelrc.json +0 -0
- package/.eslintrc.cjs +0 -0
- package/.nvmrc +0 -0
- package/.storybook/main.js +0 -0
- package/.storybook/preview-head.html +0 -0
- package/.storybook/preview.js +0 -0
- package/dist/index.css +1 -0
- package/dist/index.es.js +22382 -0
- package/dist/index.umd.js +238 -0
- package/package.json +11 -10
- package/src/App.vue +16 -127
- package/src/assets/scss/mixins/dropdown-list-item.scss +9 -4
- package/src/assets/scss/mixins/tooltip-position.scss +7 -0
- package/src/assets/scss/mixins.scss +2 -2
- package/src/assets/scss/style.scss +4 -4
- package/src/assets/scss/typography.scss +3 -3
- package/src/assets/scss/variables/colors.json +0 -0
- package/src/assets/scss/variables/colors.scss +0 -0
- package/src/assets/scss/variables/shadows.json +0 -0
- package/src/assets/scss/variables/shadows.scss +0 -0
- package/src/components/Accordion/Accordion.scss +3 -3
- package/src/components/Accordion/Accordion.stories.js +0 -0
- package/src/components/Accordion/Accordion.vue +2 -2
- package/src/components/Accordion/Acordion.spec.js +0 -0
- package/src/components/Accordion/readme.mdx +0 -0
- package/src/components/Alert/Alert.spec.js +0 -0
- package/src/components/Alert/Alert.stories.js +0 -0
- package/src/components/Alert/Alert.vue +6 -1
- package/src/components/Alert/alert.scss +8 -3
- package/src/components/Alert/constants.js +0 -0
- package/src/components/Alert/readme.mdx +0 -0
- package/src/components/Avatar/Avatar.stories.js +5 -1
- package/src/components/Avatar/Avatar.vue +27 -4
- package/src/components/Avatar/constants.js +6 -0
- package/src/components/Badge/Badge.spec.js +0 -0
- package/src/components/Badge/Badge.vue +2 -2
- package/src/components/Badge/readme.mdx +0 -0
- package/src/components/Breadcrumbs/Breadcrumbs.vue +24 -9
- package/src/components/Breadcrumbs/breadcrumbs.scss +5 -5
- package/src/components/Breadcrumbs/breadcrumbs.stories.js +0 -0
- package/src/components/Button/Button.spec.js +0 -0
- package/src/components/Button/Button.vue +20 -4
- package/src/components/Button/button.scss +8 -3
- package/src/components/Button/readme.mdx +0 -0
- package/src/components/ButtonGroup/ButtonGroup.stories.js +0 -0
- package/src/components/ButtonGroup/readme.mdx +0 -0
- package/src/components/Chips/Chips.stories.js +30 -0
- package/src/components/Chips/Chips.vue +125 -0
- package/src/components/Dropdown/Dropdown.spec.js +0 -0
- package/src/components/Dropdown/Dropdown.stories.js +0 -0
- package/src/components/Dropdown/Dropdown.vue +3 -3
- package/src/components/Dropdown/DropdownDivider.vue +1 -1
- package/src/components/Dropdown/DropdownItem.vue +27 -5
- package/src/components/Dropdown/DropdownList.stories.js +0 -0
- package/src/components/Dropdown/DropdownList.vue +6 -2
- package/src/components/Dropdown/readme.mdx +0 -0
- package/src/components/Form/CharactersCount.vue +12 -9
- package/src/components/Form/Checkbox/Checkbox.scss +4 -4
- package/src/components/Form/Checkbox/Checkbox.stories.js +0 -0
- package/src/components/Form/Checkbox/Checkbox.vue +25 -12
- package/src/components/Form/Checkbox/readme.mdx +0 -0
- package/src/components/Form/CheckboxGroup/CheckboxGroup.stories.js +0 -0
- package/src/components/Form/CheckboxGroup/CheckboxGroup.vue +15 -0
- package/src/components/Form/CheckboxGroup/readme.mdx +2 -0
- package/src/components/Form/DatePicker/DatePicker.scss +356 -265
- package/src/components/Form/DatePicker/DatePicker.stories.js +0 -0
- package/src/components/Form/DatePicker/DatePicker.vue +73 -18
- package/src/components/Form/DatePicker/readme.mdx +0 -0
- package/src/components/Form/FormGroup/FormGroup.vue +5 -5
- package/src/components/Form/FormGroup/FormGroupSet.vue +1 -1
- package/src/components/Form/Input/Input.stories.js +0 -0
- package/src/components/Form/Input/Input.vue +120 -14
- package/src/components/Form/Input/constants.js +0 -0
- package/src/components/Form/Input/input.scss +64 -5
- package/src/components/Form/Input/readme.mdx +0 -0
- package/src/components/Form/Label/Label.stories.js +0 -0
- package/src/components/Form/Label/Label.vue +24 -12
- package/src/components/Form/Label/readme.mdx +0 -0
- package/src/components/Form/PhoneInput/PhoneInput.stories.js +0 -0
- package/src/components/Form/PhoneInput/PhoneInput.vue +77 -28
- package/src/components/Form/PhoneInput/phoneInput.scss +42 -10
- package/src/components/Form/PhoneInput/readme.mdx +0 -0
- package/src/components/Form/Radio/Radio.stories.js +0 -0
- package/src/components/Form/Radio/Radio.vue +17 -45
- package/src/components/Form/Radio/radio.scss +8 -5
- package/src/components/Form/Radio/readme.mdx +0 -0
- package/src/components/Form/TextEditor/TextEditor.stories.js +0 -0
- package/src/components/Form/TextEditor/TextEditor.vue +92 -138
- package/src/components/Form/TextEditor/Toolbar.vue +723 -0
- package/src/components/Form/TextEditor/icons/toolbarIcons.js +8 -0
- package/src/components/Form/TextEditor/plugins/imageBlot.js +23 -0
- package/src/components/Form/TextEditor/readme.mdx +0 -0
- package/src/components/Form/TextEditor/setupTextEditor.js +71 -0
- package/src/components/Form/TextEditor/textEditor.scss +15 -339
- package/src/components/Form/Textarea/Textarea.spec.js +0 -0
- package/src/components/Form/Textarea/Textarea.stories.js +0 -0
- package/src/components/Form/Textarea/Textarea.vue +28 -10
- package/src/components/Form/Textarea/readme.mdx +0 -0
- package/src/components/Form/Textarea/textarea.scss +33 -5
- package/src/components/Form/Toggle/Toggle.stories.js +0 -0
- package/src/components/Form/Toggle/Toggle.vue +1 -1
- package/src/components/Form/Toggle/readme.mdx +0 -0
- package/src/components/Form/Toggle/toggle.scss +3 -3
- package/src/components/IconButton/IconButton.scss +13 -2
- package/src/components/IconButton/IconButton.vue +11 -4
- package/src/components/IconButton/readme.mdx +0 -0
- package/src/components/List.vue +1 -1
- package/src/components/Modal/Modal.stories.js +0 -0
- package/src/components/Modal/Modal.vue +109 -40
- package/src/components/Modal/constants.js +0 -0
- package/src/components/Modal/readme.mdx +0 -0
- package/src/components/Pagination/LimitSelector.vue +5 -0
- package/src/components/Pagination/Pagination.vue +37 -5
- package/src/components/Pagination/pagination.scss +20 -4
- package/src/components/Panel/Panel.stories.js +0 -0
- package/src/components/Panel/Panel.vue +72 -6
- package/src/components/Popover/Popover.vue +27 -10
- package/src/components/Popover/constants.js +0 -0
- package/src/components/Popover/popover.scss +4 -4
- package/src/components/Popover/readme.mdx +0 -0
- package/src/components/ProgressBar/ProgressBar.vue +1 -1
- package/src/components/ProgressBar/constants.js +0 -0
- package/src/components/ProgressBar/progressBar.scss +1 -1
- package/src/components/ProgressBar/readme.mdx +0 -0
- package/src/components/Sorting/Sorting.stories.js +0 -0
- package/src/components/Sorting/Sorting.vue +25 -27
- package/src/components/Sorting/sorting.scss +5 -5
- package/src/components/SplitButton/SplitButton.stories.js +0 -0
- package/src/components/SplitButton/SplitButton.vue +52 -9
- package/src/components/SplitButton/SplitButtonItem.vue +14 -2
- package/src/components/SplitButton/readme.mdx +0 -0
- package/src/components/SplitButton/splitButton.scss +3 -3
- package/src/components/StatusIndicator/StatusIndicator.stories.js +0 -0
- package/src/components/StatusIndicator/StatusIndicator.vue +2 -2
- package/src/components/StatusIndicator/constants.js +0 -0
- package/src/components/StatusIndicator/icons.js +0 -0
- package/src/components/StatusIndicator/readme.mdx +0 -0
- package/src/components/Table/Cells/Cell.vue +2 -2
- package/src/components/Table/Cells/CheckboxCell.vue +0 -0
- package/src/components/Table/Row.vue +1 -1
- package/src/components/Table/Table.stories.js +0 -0
- package/src/components/Table/Table.vue +0 -0
- package/src/components/Tabs/Tab.vue +4 -0
- package/src/components/Tabs/TabDropdown.vue +1 -1
- package/src/components/Tabs/Tabs.stories.js +0 -0
- package/src/components/Tabs/Tabs.vue +21 -6
- package/src/components/Tabs/tabs.scss +12 -6
- package/src/components/TagPill/TagPill.stories.js +0 -0
- package/src/components/TagPill/TagPill.vue +8 -2
- package/src/components/TagPill/readme.mdx +0 -0
- package/src/components/ToggleTip/ToggleTip.vue +1 -1
- package/src/components/ToggleTip/constants.js +0 -0
- package/src/components/ToggleTip/readme.mdx +0 -0
- package/src/components/ToggleTip/toggleTip.scss +5 -5
- package/src/components/Tooltip/Tooltip.vue +4 -4
- package/src/components/Tooltip/readme.mdx +0 -0
- package/src/components/TreeSelect/Option.vue +59 -25
- package/src/components/TreeSelect/Select.stories.js +0 -0
- package/src/components/TreeSelect/Select.vue +283 -148
- package/src/components/TreeSelect/TreeSelect.stories.js +0 -0
- package/src/components/TreeSelect/mixins/InfinityLoaderMixin.js +40 -0
- package/src/components/TreeSelect/scss/option.scss +37 -6
- package/src/components/TreeSelect/scss/select.scss +97 -6
- package/src/constants/keyCodes.js +1 -0
- package/src/directives/outside/outside.stories.js +0 -0
- package/src/directives/outside/readme.mdx +0 -0
- package/src/directives/tooltip/TooltipController.js +2 -0
- package/src/directives/tooltip/readme.mdx +0 -0
- package/src/directives/tooltip/textOverflowTooltip.js +3 -1
- package/src/directives/tooltip/tooltip.js +61 -0
- package/src/directives/tooltip/tooltip.stories.js +0 -0
- package/src/helpers/debounce.js +23 -0
- package/src/helpers/removeEvents.js +0 -0
- package/src/helpers/stripHtml.js +4 -0
- package/src/index.js +7 -0
- package/src/main.js +0 -0
- package/src/mixins/expandAnimation.js +0 -0
- package/src/scripts/parseScssVariables.js +0 -0
- package/src/stories/link.readme.mdx +0 -0
- package/src/stories/variables/colors.stories.js +0 -0
- package/src/stories/variables/shadows.stories.js +0 -0
- package/static/docks/button.pdf +0 -0
- package/static/favicon.ico +0 -0
- package/vite.config.js +3 -9
- package/dist/index.js +0 -20786
- package/dist/index.umd.cjs +0 -227
- package/dist/style.css +0 -1
|
@@ -3,35 +3,56 @@
|
|
|
3
3
|
{{ errorMessage }}
|
|
4
4
|
</ib-alert>
|
|
5
5
|
|
|
6
|
-
<
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
6
|
+
<div class="ib-phone-wrapper">
|
|
7
|
+
<vue-tel-input
|
|
8
|
+
v-outside="clickOutside"
|
|
9
|
+
v-model="phone"
|
|
10
|
+
v-bind="$attrs"
|
|
11
|
+
@country-changed="countryChanged"
|
|
12
|
+
:input-options="{ name: inputName, id: inputName, autocomplete: 'tel' }"
|
|
13
|
+
:auto-default-country="autoDefaultCountry"
|
|
14
|
+
:dropdown-options="{ showSearchBox: true, showFlags: true, tabindex: 0 }"
|
|
15
|
+
:defaultCountry="defaultCountry"
|
|
16
|
+
:ignoredCountries="ignoredCountries"
|
|
17
|
+
:class="{ error: error || errorMessage.length, disabled }"
|
|
18
|
+
:disabled="disabled"
|
|
19
|
+
style-classes="ib-phone-input"
|
|
20
|
+
ref="vueTel"
|
|
21
|
+
>
|
|
22
|
+
<template #arrow-icon>
|
|
23
|
+
<ib-icon name="chevron-down-outline"></ib-icon>
|
|
24
|
+
</template>
|
|
25
|
+
|
|
26
|
+
<template #icon-right>
|
|
27
|
+
<ib-icon-button
|
|
28
|
+
v-if="showClearButton"
|
|
29
|
+
v-show="phone.length"
|
|
30
|
+
kind="ghost"
|
|
31
|
+
class="ib-phone-clear-button"
|
|
32
|
+
@click="clearPhone"
|
|
33
|
+
>
|
|
34
|
+
<ib-icon name="close-outline" />
|
|
35
|
+
</ib-icon-button>
|
|
36
|
+
</template>
|
|
37
|
+
</vue-tel-input>
|
|
38
|
+
</div>
|
|
24
39
|
</template>
|
|
25
40
|
|
|
26
41
|
<script>
|
|
27
|
-
import { VueTelInput } from "vue-tel-input";
|
|
28
42
|
import IbIcon from "../../Icon.vue";
|
|
43
|
+
import IbIconButton from "../../IconButton/IconButton.vue";
|
|
29
44
|
import IbAlert from "../../Alert/Alert.vue";
|
|
30
45
|
import { OutsideDirective as Outside } from "../../../directives/outside/outside";
|
|
46
|
+
import { VueTelInput } from 'vue-tel-input';
|
|
47
|
+
import 'vue-tel-input/vue-tel-input.css'
|
|
31
48
|
|
|
32
49
|
export default {
|
|
33
50
|
directives: { Outside },
|
|
34
51
|
props: {
|
|
52
|
+
modelValue: {
|
|
53
|
+
type: String
|
|
54
|
+
},
|
|
55
|
+
value: String,
|
|
35
56
|
inputName: {
|
|
36
57
|
type: String,
|
|
37
58
|
default: "phone",
|
|
@@ -40,10 +61,6 @@ export default {
|
|
|
40
61
|
type: Boolean,
|
|
41
62
|
default: true,
|
|
42
63
|
},
|
|
43
|
-
value: {
|
|
44
|
-
type: String,
|
|
45
|
-
default: "",
|
|
46
|
-
},
|
|
47
64
|
ignoredCountries: {
|
|
48
65
|
type: Array,
|
|
49
66
|
default: () => [],
|
|
@@ -56,25 +73,43 @@ export default {
|
|
|
56
73
|
type: String,
|
|
57
74
|
default: "",
|
|
58
75
|
},
|
|
76
|
+
disabled: {
|
|
77
|
+
type: Boolean,
|
|
78
|
+
default: false,
|
|
79
|
+
},
|
|
80
|
+
showClearButton: {
|
|
81
|
+
type: Boolean,
|
|
82
|
+
default: true,
|
|
83
|
+
},
|
|
59
84
|
},
|
|
85
|
+
emits: ['update:modelValue', 'onReady'],
|
|
60
86
|
components: {
|
|
61
87
|
VueTelInput,
|
|
88
|
+
IbIconButton,
|
|
62
89
|
IbAlert,
|
|
63
90
|
IbIcon,
|
|
64
91
|
},
|
|
65
92
|
data() {
|
|
66
93
|
return {
|
|
67
94
|
vueTel: null,
|
|
68
|
-
phone: "",
|
|
69
95
|
dialCode: "",
|
|
70
96
|
defaultCountry: "US",
|
|
97
|
+
allowChange: false
|
|
71
98
|
};
|
|
72
99
|
},
|
|
73
100
|
mounted() {
|
|
74
101
|
this.vueTel = this.$refs.vueTel;
|
|
75
102
|
|
|
76
|
-
|
|
77
|
-
|
|
103
|
+
this.$emit('onReady');
|
|
104
|
+
},
|
|
105
|
+
computed: {
|
|
106
|
+
phone: {
|
|
107
|
+
get() {
|
|
108
|
+
return this.modelValue
|
|
109
|
+
},
|
|
110
|
+
set(value) {
|
|
111
|
+
this.$emit('update:modelValue', value)
|
|
112
|
+
}
|
|
78
113
|
}
|
|
79
114
|
},
|
|
80
115
|
methods: {
|
|
@@ -95,11 +130,25 @@ export default {
|
|
|
95
130
|
this.vueTel.clickedOutside();
|
|
96
131
|
}
|
|
97
132
|
},
|
|
133
|
+
clearPhone() {
|
|
134
|
+
this.phone = "";
|
|
135
|
+
}
|
|
98
136
|
},
|
|
99
137
|
};
|
|
100
138
|
</script>
|
|
101
139
|
|
|
102
140
|
<style lang="scss">
|
|
103
|
-
@
|
|
141
|
+
@use "./phoneInput.scss" as *;
|
|
142
|
+
|
|
143
|
+
.ib-phone-wrapper {
|
|
144
|
+
position: relative;
|
|
145
|
+
|
|
146
|
+
.ib-phone-clear-button {
|
|
147
|
+
position: absolute;
|
|
148
|
+
right: 5px;
|
|
149
|
+
top: 50%;
|
|
150
|
+
transform: translateY(-50%);
|
|
151
|
+
|
|
152
|
+
}
|
|
153
|
+
}
|
|
104
154
|
</style>
|
|
105
|
-
<style src="vue-tel-input/vue-tel-input.css"></style>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
@
|
|
2
|
-
@
|
|
3
|
-
@
|
|
4
|
-
@
|
|
1
|
+
@use "../../../assets/scss/variables/colors.scss" as *;
|
|
2
|
+
@use "../../../assets/scss/variables/shadows.scss" as *;
|
|
3
|
+
@use "../../../assets/scss/typography.scss" as *;
|
|
4
|
+
@use "../../../assets/scss/mixins.scss" as *;
|
|
5
5
|
|
|
6
6
|
$input-bg: $gray-100;
|
|
7
7
|
$input-color: $neutral-900;
|
|
@@ -43,6 +43,39 @@ $dropdown-item-selected-border-color: $blue-900;
|
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
+
&.disabled {
|
|
47
|
+
.vti__input {
|
|
48
|
+
background-color: $gray-100 !important;
|
|
49
|
+
color: $neutral-500 !important;
|
|
50
|
+
border-color: $input-border-color !important;
|
|
51
|
+
|
|
52
|
+
&:focus {
|
|
53
|
+
outline: none !important;
|
|
54
|
+
border-bottom: 1px solid $input-border-color !important;
|
|
55
|
+
border-radius: 4px 4px 0 0 !important;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.vti__dropdown {
|
|
60
|
+
background-color: $gray-100 !important;
|
|
61
|
+
border-color: $input-border-color !important;
|
|
62
|
+
cursor: not-allowed;
|
|
63
|
+
|
|
64
|
+
.vti__selection {
|
|
65
|
+
filter:grayscale(1);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
&:focus {
|
|
69
|
+
.vti__selection {
|
|
70
|
+
outline: none !important;
|
|
71
|
+
background-color: $gray-100 !important;
|
|
72
|
+
border-bottom: 1px solid $input-border-color !important;
|
|
73
|
+
border-radius: 4px 4px 0 0 !important;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
46
79
|
.vti__dropdown {
|
|
47
80
|
padding: 0;
|
|
48
81
|
border-radius: 4px 4px 0 0;
|
|
@@ -100,17 +133,16 @@ $dropdown-item-selected-border-color: $blue-900;
|
|
|
100
133
|
.vti__input {
|
|
101
134
|
background-color: transparent;
|
|
102
135
|
width: 100%;
|
|
103
|
-
margin: 0;
|
|
104
|
-
|
|
105
|
-
border-
|
|
106
|
-
border-
|
|
107
|
-
border-top: 0px;
|
|
136
|
+
margin: 0 0 6.5px;
|
|
137
|
+
border-left: 0;
|
|
138
|
+
border-right: 0;
|
|
139
|
+
border-top: 0;
|
|
108
140
|
border-radius: 0;
|
|
109
141
|
|
|
110
142
|
&::placeholder {
|
|
111
143
|
@include Ib-H4-regular-italic;
|
|
112
144
|
color: $input-placeholder-color;
|
|
113
|
-
}
|
|
145
|
+
}
|
|
114
146
|
|
|
115
147
|
&:focus {
|
|
116
148
|
border-radius: 0;
|
|
File without changes
|
|
File without changes
|
|
@@ -3,19 +3,17 @@
|
|
|
3
3
|
role="radio"
|
|
4
4
|
:class="classes"
|
|
5
5
|
:for="id"
|
|
6
|
-
:aria-checked="
|
|
7
|
-
@click.prevent="onClick"
|
|
6
|
+
:aria-checked="isChecked"
|
|
8
7
|
>
|
|
9
8
|
<input
|
|
10
9
|
type="radio"
|
|
11
10
|
:name="name"
|
|
12
11
|
:id="id"
|
|
13
12
|
:value="value"
|
|
14
|
-
:checked="
|
|
13
|
+
:checked="isChecked"
|
|
15
14
|
:disabled="disabled"
|
|
16
15
|
ref="radio"
|
|
17
|
-
@
|
|
18
|
-
@change="onChange"
|
|
16
|
+
@change="checkHandler"
|
|
19
17
|
/>
|
|
20
18
|
<span class="ib-radio-body" :class="{ 'without-text': !label?.length }">
|
|
21
19
|
<span class="ib-radio-input"></span>
|
|
@@ -29,11 +27,8 @@ import generateUID from "../../../helpers/generateUID";
|
|
|
29
27
|
|
|
30
28
|
export default {
|
|
31
29
|
name: "IbRadio",
|
|
32
|
-
model: {
|
|
33
|
-
prop: "isChecked",
|
|
34
|
-
event: "input",
|
|
35
|
-
},
|
|
36
30
|
props: {
|
|
31
|
+
modelValue: '',
|
|
37
32
|
label: String,
|
|
38
33
|
error: {
|
|
39
34
|
type: Boolean,
|
|
@@ -49,67 +44,44 @@ export default {
|
|
|
49
44
|
},
|
|
50
45
|
},
|
|
51
46
|
value: {
|
|
52
|
-
type: String,
|
|
47
|
+
type: [String, Number],
|
|
53
48
|
required: true,
|
|
54
49
|
},
|
|
55
|
-
isChecked: {
|
|
56
|
-
type: Boolean,
|
|
57
|
-
default: false,
|
|
58
|
-
},
|
|
59
50
|
disabled: {
|
|
60
51
|
type: Boolean,
|
|
61
52
|
default: false,
|
|
62
53
|
},
|
|
63
54
|
},
|
|
64
|
-
|
|
65
|
-
isChecked(value) {
|
|
66
|
-
this.checked = value;
|
|
67
|
-
},
|
|
68
|
-
},
|
|
69
|
-
mounted() {
|
|
70
|
-
this.$globalEvents.$on(`radio:update:${this.name}`, (uid) => {
|
|
71
|
-
if (this.uid !== uid) {
|
|
72
|
-
this.checked = false;
|
|
73
|
-
}
|
|
74
|
-
});
|
|
75
|
-
},
|
|
55
|
+
emits: ['update:modelValue'],
|
|
76
56
|
data() {
|
|
77
57
|
return {
|
|
78
|
-
checked: this.isChecked,
|
|
79
58
|
uid: generateUID(),
|
|
80
59
|
};
|
|
81
60
|
},
|
|
61
|
+
mounted() {
|
|
62
|
+
this.checked = this.isChecked;
|
|
63
|
+
},
|
|
82
64
|
methods: {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
this.$globalEvents.$emit(`radio:update:${this.name}`, this.uid);
|
|
87
|
-
this.$emit("input", this.checked);
|
|
88
|
-
this.$emit("change", this.checked);
|
|
89
|
-
}
|
|
90
|
-
},
|
|
91
|
-
onChange() {
|
|
92
|
-
if (!this.disabled) {
|
|
93
|
-
this.checked = !this.checked;
|
|
94
|
-
this.$globalEvents.$emit(`radio:update:${this.name}`, this.uid);
|
|
95
|
-
this.$emit("change", this.checked);
|
|
96
|
-
this.$emit("input", this.checked);
|
|
97
|
-
}
|
|
98
|
-
},
|
|
65
|
+
checkHandler() {
|
|
66
|
+
this.$emit('update:modelValue', this.value)
|
|
67
|
+
}
|
|
99
68
|
},
|
|
100
69
|
computed: {
|
|
101
70
|
classes() {
|
|
102
71
|
return {
|
|
103
72
|
"ib-radio": true,
|
|
104
73
|
"has-error": this.error,
|
|
105
|
-
"radio-filled": this.
|
|
74
|
+
"radio-filled": this.isChecked,
|
|
106
75
|
"radio-disabled": this.disabled,
|
|
107
76
|
};
|
|
108
77
|
},
|
|
78
|
+
isChecked() {
|
|
79
|
+
return this.modelValue === this.value
|
|
80
|
+
}
|
|
109
81
|
},
|
|
110
82
|
};
|
|
111
83
|
</script>
|
|
112
84
|
|
|
113
85
|
<style scoped lang="scss">
|
|
114
|
-
@
|
|
86
|
+
@use "./radio.scss" as *;
|
|
115
87
|
</style>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
@
|
|
2
|
-
@
|
|
3
|
-
@
|
|
1
|
+
@use "../../../assets/scss/variables/colors.scss" as *;
|
|
2
|
+
@use "../../../assets/scss/typography.scss" as *;
|
|
3
|
+
@use "../../../assets/scss/mixins.scss" as *;
|
|
4
4
|
|
|
5
5
|
//checkbox
|
|
6
6
|
$radio-text: $neutral-900;
|
|
@@ -30,12 +30,15 @@ $radio-border-filled-disabled: $neutral-500;
|
|
|
30
30
|
.ib-radio {
|
|
31
31
|
display: inline-flex;
|
|
32
32
|
cursor: pointer;
|
|
33
|
+
position: relative;
|
|
33
34
|
|
|
34
35
|
input {
|
|
35
36
|
opacity: 0;
|
|
36
37
|
position: absolute;
|
|
37
|
-
|
|
38
|
-
|
|
38
|
+
width: 1px;
|
|
39
|
+
height: 1px;
|
|
40
|
+
z-index: -1;
|
|
41
|
+
|
|
39
42
|
|
|
40
43
|
&:focus + .ib-radio-body {
|
|
41
44
|
border-radius: 4px;
|
|
File without changes
|
|
File without changes
|