@avakhula/ui 0.0.503 → 0.0.505-alpha-spa.2
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.js +16912 -2987
- package/dist/index.umd.cjs +168 -22
- package/dist/style.css +1 -1
- package/package.json +4 -4
- package/src/App.vue +13 -128
- package/src/assets/scss/mixins/dropdown-list-item.scss +5 -0
- package/src/assets/scss/mixins/tooltip-position.scss +0 -0
- 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 +0 -0
- package/src/components/Accordion/Accordion.stories.js +0 -0
- package/src/components/Accordion/Accordion.vue +0 -0
- 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 +5 -0
- package/src/components/Alert/alert.scss +6 -1
- 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 +25 -2
- package/src/components/Avatar/constants.js +6 -0
- package/src/components/Badge/Badge.spec.js +0 -0
- package/src/components/Badge/Badge.vue +0 -0
- package/src/components/Badge/readme.mdx +0 -0
- package/src/components/Breadcrumbs/Breadcrumbs.vue +0 -0
- package/src/components/Breadcrumbs/breadcrumbs.scss +0 -0
- package/src/components/Breadcrumbs/breadcrumbs.stories.js +0 -0
- package/src/components/Button/Button.spec.js +0 -0
- package/src/components/Button/Button.vue +19 -3
- package/src/components/Button/button.scss +4 -0
- 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.stories.js +0 -0
- package/src/components/Dropdown/Dropdown.vue +0 -0
- package/src/components/Dropdown/DropdownItem.vue +26 -4
- package/src/components/Dropdown/DropdownList.stories.js +0 -0
- package/src/components/Dropdown/readme.mdx +0 -0
- package/src/components/Form/CharactersCount.vue +10 -7
- package/src/components/Form/Checkbox/Checkbox.scss +0 -0
- package/src/components/Form/Checkbox/Checkbox.stories.js +0 -0
- package/src/components/Form/Checkbox/Checkbox.vue +23 -11
- 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 +345 -260
- package/src/components/Form/DatePicker/DatePicker.stories.js +0 -0
- package/src/components/Form/DatePicker/DatePicker.vue +55 -14
- package/src/components/Form/DatePicker/readme.mdx +0 -0
- package/src/components/Form/FormGroup/FormGroup.vue +3 -3
- package/src/components/Form/Input/Input.stories.js +0 -0
- package/src/components/Form/Input/Input.vue +6 -2
- package/src/components/Form/Input/constants.js +0 -0
- package/src/components/Form/Input/input.scss +0 -0
- 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 +22 -10
- 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 +21 -12
- package/src/components/Form/PhoneInput/phoneInput.scss +4 -5
- 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 +22 -35
- package/src/components/Form/Radio/radio.scss +5 -2
- 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 +67 -15
- package/src/components/Form/TextEditor/readme.mdx +0 -0
- package/src/components/Form/TextEditor/textEditor.scss +22 -0
- package/src/components/Form/Textarea/Textarea.stories.js +0 -0
- package/src/components/Form/Textarea/Textarea.vue +19 -2
- package/src/components/Form/Textarea/readme.mdx +0 -0
- package/src/components/Form/Textarea/textarea.scss +20 -1
- package/src/components/Form/Toggle/Toggle.stories.js +0 -0
- package/src/components/Form/Toggle/Toggle.vue +0 -0
- package/src/components/Form/Toggle/readme.mdx +0 -0
- package/src/components/Form/Toggle/toggle.scss +0 -0
- package/src/components/IconButton/IconButton.scss +11 -0
- package/src/components/IconButton/IconButton.vue +5 -0
- package/src/components/IconButton/readme.mdx +0 -0
- package/src/components/List.vue +0 -0
- package/src/components/Modal/Modal.stories.js +0 -0
- package/src/components/Modal/Modal.vue +6 -5
- package/src/components/Modal/constants.js +0 -0
- package/src/components/Modal/readme.mdx +0 -0
- package/src/components/Pagination/LimitSelector.vue +4 -0
- package/src/components/Pagination/Pagination.vue +9 -2
- package/src/components/Pagination/pagination.scss +0 -0
- package/src/components/Panel/Panel.stories.js +0 -0
- package/src/components/Panel/Panel.vue +68 -2
- package/src/components/Popover/Popover.vue +4 -4
- package/src/components/Popover/constants.js +0 -0
- package/src/components/Popover/popover.scss +1 -1
- package/src/components/Popover/readme.mdx +0 -0
- package/src/components/ProgressBar/ProgressBar.vue +0 -0
- package/src/components/ProgressBar/constants.js +0 -0
- package/src/components/ProgressBar/progressBar.scss +0 -0
- package/src/components/ProgressBar/readme.mdx +0 -0
- package/src/components/Sorting/Sorting.stories.js +0 -0
- package/src/components/Sorting/Sorting.vue +0 -0
- package/src/components/Sorting/sorting.scss +0 -0
- package/src/components/SplitButton/SplitButton.stories.js +0 -0
- package/src/components/SplitButton/SplitButton.vue +31 -7
- package/src/components/SplitButton/SplitButtonItem.vue +13 -1
- package/src/components/SplitButton/readme.mdx +0 -0
- package/src/components/SplitButton/splitButton.scss +0 -0
- package/src/components/StatusIndicator/StatusIndicator.stories.js +0 -0
- package/src/components/StatusIndicator/StatusIndicator.vue +0 -0
- 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/Tabs/TabDropdown.vue +0 -0
- package/src/components/Tabs/Tabs.stories.js +0 -0
- package/src/components/Tabs/Tabs.vue +0 -0
- package/src/components/Tabs/tabs.scss +0 -0
- package/src/components/TagPill/TagPill.stories.js +0 -0
- package/src/components/TagPill/readme.mdx +0 -0
- package/src/components/ToggleTip/constants.js +0 -0
- package/src/components/ToggleTip/readme.mdx +0 -0
- package/src/components/ToggleTip/toggleTip.scss +0 -0
- package/src/components/Tooltip/Tooltip.vue +1 -1
- package/src/components/Tooltip/readme.mdx +0 -0
- package/src/components/TreeSelect/Option.vue +40 -9
- package/src/components/TreeSelect/Select.stories.js +0 -0
- package/src/components/TreeSelect/Select.vue +77 -29
- 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 +31 -0
- package/src/components/TreeSelect/scss/select.scss +47 -1
- 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 +15 -0
- package/src/directives/tooltip/tooltip.stories.js +0 -0
- package/src/helpers/removeEvents.js +0 -0
- package/src/index.js +4 -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
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div
|
|
3
|
-
class="flatpickr-wrapper"
|
|
3
|
+
class="ib-flatpickr-wrapper"
|
|
4
4
|
:class="{
|
|
5
5
|
'has-labels': label.length || endDateLabel.length,
|
|
6
6
|
'has-label': label.length,
|
|
7
7
|
'has-error': errorMessage.length,
|
|
8
|
+
'is-disabled': disabled,
|
|
8
9
|
'is-range': mode === 'range',
|
|
9
10
|
}"
|
|
10
11
|
>
|
|
@@ -18,11 +19,16 @@
|
|
|
18
19
|
{{ label }}
|
|
19
20
|
</ib-label>
|
|
20
21
|
<div class="input-wrapper" @click="open" :class="{ active: isOpen }">
|
|
21
|
-
<
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
<label :aria-label="ariaLabel">
|
|
23
|
+
<input
|
|
24
|
+
:placeholder="placeholder"
|
|
25
|
+
:name="name"
|
|
26
|
+
ref="date"
|
|
27
|
+
id="date"
|
|
28
|
+
:disabled="disabled"
|
|
29
|
+
class="date-picker-input"
|
|
30
|
+
/>
|
|
31
|
+
</label>
|
|
26
32
|
|
|
27
33
|
<ib-icon name="today-outline" class="calendar-icon" />
|
|
28
34
|
</div>
|
|
@@ -46,12 +52,14 @@
|
|
|
46
52
|
@click="openEndDate"
|
|
47
53
|
:class="{ active: isOpenEndDate }"
|
|
48
54
|
>
|
|
49
|
-
<
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
+
<label :aria-label="endDateAriaLabel">
|
|
56
|
+
<input
|
|
57
|
+
class="date-picker-input"
|
|
58
|
+
:placeholder="endDatePlaceholder"
|
|
59
|
+
ref="toDate"
|
|
60
|
+
@keydown="onKeydownEndField"
|
|
61
|
+
/>
|
|
62
|
+
</label>
|
|
55
63
|
<ib-icon name="today-outline" class="calendar-icon" />
|
|
56
64
|
</div>
|
|
57
65
|
|
|
@@ -90,6 +98,10 @@ export default {
|
|
|
90
98
|
type: String,
|
|
91
99
|
default: "",
|
|
92
100
|
},
|
|
101
|
+
endDatePlaceholder: {
|
|
102
|
+
type: String,
|
|
103
|
+
default: "",
|
|
104
|
+
},
|
|
93
105
|
required: {
|
|
94
106
|
type: Boolean,
|
|
95
107
|
default: false,
|
|
@@ -102,6 +114,14 @@ export default {
|
|
|
102
114
|
type: String,
|
|
103
115
|
default: SINGLE_MODE,
|
|
104
116
|
},
|
|
117
|
+
ariaLabel: {
|
|
118
|
+
type: String,
|
|
119
|
+
default: "",
|
|
120
|
+
},
|
|
121
|
+
endDateAriaLabel: {
|
|
122
|
+
type: String,
|
|
123
|
+
default: "",
|
|
124
|
+
},
|
|
105
125
|
label: {
|
|
106
126
|
type: String,
|
|
107
127
|
default: "",
|
|
@@ -122,6 +142,10 @@ export default {
|
|
|
122
142
|
type: String,
|
|
123
143
|
default: "",
|
|
124
144
|
},
|
|
145
|
+
disabled: {
|
|
146
|
+
type: Boolean,
|
|
147
|
+
default: false,
|
|
148
|
+
}
|
|
125
149
|
},
|
|
126
150
|
mounted() {
|
|
127
151
|
document.addEventListener("keyup", this.onDocumentKeyDown, true);
|
|
@@ -137,8 +161,16 @@ export default {
|
|
|
137
161
|
value() {
|
|
138
162
|
this.initFlatpickr();
|
|
139
163
|
},
|
|
164
|
+
disabled() {
|
|
165
|
+
this.$nextTick(() => {
|
|
166
|
+
this.initFlatpickr();
|
|
167
|
+
});
|
|
168
|
+
},
|
|
140
169
|
modelValue() {
|
|
141
|
-
this.
|
|
170
|
+
if (JSON.stringify(this.modelValue) === JSON.stringify(this.data)) return;
|
|
171
|
+
|
|
172
|
+
const value = this.modelValue[0] && this.modelValue[1] ? this.modelValue : [];
|
|
173
|
+
this.flat?.setDate(value, true);
|
|
142
174
|
},
|
|
143
175
|
},
|
|
144
176
|
data() {
|
|
@@ -196,7 +228,7 @@ export default {
|
|
|
196
228
|
if (this.mode === RANGE_MODE) {
|
|
197
229
|
defaultConfig.defaultDate = this.modelValue.length
|
|
198
230
|
? [this.modelValue[0], this.modelValue[1]]
|
|
199
|
-
: [this.value[0], this.value[1]];
|
|
231
|
+
: [this.value?.[0], this.value?.[1]];
|
|
200
232
|
} else {
|
|
201
233
|
defaultConfig.defaultDate = this.modelValue
|
|
202
234
|
? this.modelValue
|
|
@@ -213,6 +245,7 @@ export default {
|
|
|
213
245
|
this.$nextTick(() => {
|
|
214
246
|
this.isOpen = false;
|
|
215
247
|
this.isOpenEndDate = false;
|
|
248
|
+
this.$emit("blur");
|
|
216
249
|
});
|
|
217
250
|
},
|
|
218
251
|
onChange(value) {
|
|
@@ -227,6 +260,11 @@ export default {
|
|
|
227
260
|
this.close();
|
|
228
261
|
}
|
|
229
262
|
},
|
|
263
|
+
onKeydownEndField(e) {
|
|
264
|
+
if (e.key === "ArrowDown") {
|
|
265
|
+
this.flat.selectedDateElem.focus();
|
|
266
|
+
}
|
|
267
|
+
},
|
|
230
268
|
triggerChange() {
|
|
231
269
|
setTimeout(() => {
|
|
232
270
|
if (this.pickerOptions.mode === "range") {
|
|
@@ -247,6 +285,8 @@ export default {
|
|
|
247
285
|
this.$emit("input", this.data);
|
|
248
286
|
this.$emit("update:modelValue", this.data);
|
|
249
287
|
}
|
|
288
|
+
|
|
289
|
+
this.$emit("blur");
|
|
250
290
|
}
|
|
251
291
|
});
|
|
252
292
|
},
|
|
@@ -277,6 +317,7 @@ export default {
|
|
|
277
317
|
IbLabel,
|
|
278
318
|
IbAlert,
|
|
279
319
|
},
|
|
320
|
+
emits: ["input", "update:modelValue"],
|
|
280
321
|
};
|
|
281
322
|
</script>
|
|
282
323
|
<style lang="scss">
|
|
File without changes
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="ib-form-group" :class="{
|
|
2
|
+
<div class="ib-form-group" :class="{ disabled: disabled }">
|
|
3
3
|
<slot></slot>
|
|
4
4
|
<p class="support-text" v-if="supportText.length">{{ supportText }}</p>
|
|
5
5
|
</div>
|
|
@@ -13,7 +13,7 @@ export default {
|
|
|
13
13
|
type: String,
|
|
14
14
|
default: "",
|
|
15
15
|
},
|
|
16
|
-
|
|
16
|
+
disabled: {
|
|
17
17
|
type: Boolean,
|
|
18
18
|
default: false,
|
|
19
19
|
},
|
|
@@ -34,7 +34,7 @@ export default {
|
|
|
34
34
|
margin-top: 5px;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
&.
|
|
37
|
+
&.disabled {
|
|
38
38
|
.support-text {
|
|
39
39
|
color: $neutral-500;
|
|
40
40
|
}
|
|
File without changes
|
|
@@ -7,12 +7,13 @@
|
|
|
7
7
|
|
|
8
8
|
<input
|
|
9
9
|
v-bind="attrs"
|
|
10
|
-
v-model="actualValue"
|
|
10
|
+
v-model.trim="actualValue"
|
|
11
11
|
ref="field"
|
|
12
12
|
:aria-invalid="hasErrorState ? true : false"
|
|
13
13
|
:readonly="readonly"
|
|
14
14
|
:disabled="disabled"
|
|
15
15
|
:id="id"
|
|
16
|
+
:autocomplete="autocomplete"
|
|
16
17
|
:class="classes"
|
|
17
18
|
@input="onInput($event)"
|
|
18
19
|
@blur="onBlur($event)"
|
|
@@ -29,7 +30,7 @@
|
|
|
29
30
|
@click="clearInput"
|
|
30
31
|
@keypress.enter="clearInput"
|
|
31
32
|
v-if="type !== 'password' && showClearButton"
|
|
32
|
-
v-show="actualValue?.length"
|
|
33
|
+
v-show="actualValue?.toString().length"
|
|
33
34
|
>
|
|
34
35
|
<ib-icon name="close-outline"></ib-icon>
|
|
35
36
|
</ib-icon-button>
|
|
@@ -164,6 +165,9 @@ export default {
|
|
|
164
165
|
type: Boolean,
|
|
165
166
|
default: false,
|
|
166
167
|
},
|
|
168
|
+
autocomplete: {
|
|
169
|
+
type: String
|
|
170
|
+
}
|
|
167
171
|
},
|
|
168
172
|
data() {
|
|
169
173
|
return {
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,26 +1,25 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<label :class="classes" :for
|
|
2
|
+
<label :class="classes" :for>
|
|
3
3
|
<span v-if="required" class="required">* </span>
|
|
4
4
|
<slot></slot>
|
|
5
5
|
|
|
6
6
|
<ib-icon-button
|
|
7
|
-
v-if="infoText.length"
|
|
7
|
+
v-if="infoText.length || Object.keys(infoText).length"
|
|
8
8
|
size="xs"
|
|
9
9
|
class="info-button"
|
|
10
10
|
kind="ghost"
|
|
11
11
|
type="button"
|
|
12
|
+
v-tooltip:[tooltipPosition]="infoText"
|
|
12
13
|
>
|
|
13
14
|
<ib-icon name="information-circle-outline" />
|
|
14
|
-
|
|
15
|
-
<ib-tooltip :text="infoText" :position="tooltipPosition"></ib-tooltip>
|
|
16
15
|
</ib-icon-button>
|
|
17
16
|
</label>
|
|
18
17
|
</template>
|
|
19
18
|
|
|
20
19
|
<script>
|
|
21
20
|
import IbIconButton from "../../IconButton/IconButton.vue";
|
|
22
|
-
import IbTooltip from "../../Tooltip/Tooltip.vue";
|
|
23
21
|
import IbIcon from "../../Icon.vue";
|
|
22
|
+
import { TooltipDirective as Tooltip } from "../../../directives/tooltip/tooltip";
|
|
24
23
|
|
|
25
24
|
export default {
|
|
26
25
|
name: "IbLabel",
|
|
@@ -33,23 +32,32 @@ export default {
|
|
|
33
32
|
default: false,
|
|
34
33
|
},
|
|
35
34
|
infoText: {
|
|
36
|
-
type: String,
|
|
35
|
+
type: [String, Object],
|
|
37
36
|
default: "",
|
|
38
37
|
},
|
|
39
38
|
tooltipPosition: {
|
|
40
39
|
type: String,
|
|
41
40
|
},
|
|
41
|
+
disabled: {
|
|
42
|
+
type: Boolean,
|
|
43
|
+
default: false,
|
|
44
|
+
},
|
|
42
45
|
},
|
|
43
46
|
mounted() {
|
|
44
47
|
this.$globalEvents.$on(`label:disabled:${this.for}`, (value) => {
|
|
45
|
-
this.
|
|
48
|
+
this.idDisabled = value;
|
|
46
49
|
});
|
|
47
50
|
},
|
|
48
51
|
data() {
|
|
49
52
|
return {
|
|
50
|
-
|
|
53
|
+
idDisabled: this.disabled,
|
|
51
54
|
};
|
|
52
55
|
},
|
|
56
|
+
watch: {
|
|
57
|
+
disabled(value) {
|
|
58
|
+
this.idDisabled = value;
|
|
59
|
+
},
|
|
60
|
+
},
|
|
53
61
|
computed: {
|
|
54
62
|
classes() {
|
|
55
63
|
const classList = ["ib-label"];
|
|
@@ -58,7 +66,7 @@ export default {
|
|
|
58
66
|
classList.push("has-info-text");
|
|
59
67
|
}
|
|
60
68
|
|
|
61
|
-
if (this.
|
|
69
|
+
if (this.idDisabled) {
|
|
62
70
|
classList.push("label-disabled");
|
|
63
71
|
}
|
|
64
72
|
|
|
@@ -68,7 +76,9 @@ export default {
|
|
|
68
76
|
components: {
|
|
69
77
|
IbIconButton,
|
|
70
78
|
IbIcon,
|
|
71
|
-
|
|
79
|
+
},
|
|
80
|
+
directives: {
|
|
81
|
+
Tooltip,
|
|
72
82
|
},
|
|
73
83
|
};
|
|
74
84
|
</script>
|
|
@@ -109,6 +119,8 @@ export default {
|
|
|
109
119
|
.info-button {
|
|
110
120
|
display: inline-block;
|
|
111
121
|
margin-left: 3px;
|
|
122
|
+
position: relative;
|
|
123
|
+
|
|
112
124
|
.ib-icon {
|
|
113
125
|
color: $gray-600;
|
|
114
126
|
font-size: 16px;
|
|
File without changes
|
|
File without changes
|
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
v-model="phone"
|
|
9
9
|
v-bind="$attrs"
|
|
10
10
|
@country-changed="countryChanged"
|
|
11
|
-
:input-options="{ name: inputName, id: inputName }"
|
|
11
|
+
:input-options="{ name: inputName, id: inputName, autocomplete: 'off' }"
|
|
12
12
|
:auto-default-country="autoDefaultCountry"
|
|
13
|
-
:dropdown-options="{ showSearchBox: true, showFlags: true }"
|
|
13
|
+
:dropdown-options="{ showSearchBox: true, showFlags: true, tabindex: 0 }"
|
|
14
14
|
:defaultCountry="defaultCountry"
|
|
15
15
|
:ignoredCountries="ignoredCountries"
|
|
16
16
|
:class="{ error: error || errorMessage.length }"
|
|
@@ -24,14 +24,19 @@
|
|
|
24
24
|
</template>
|
|
25
25
|
|
|
26
26
|
<script>
|
|
27
|
-
import { VueTelInput } from "vue-tel-input";
|
|
28
27
|
import IbIcon from "../../Icon.vue";
|
|
29
28
|
import IbAlert from "../../Alert/Alert.vue";
|
|
30
29
|
import { OutsideDirective as Outside } from "../../../directives/outside/outside";
|
|
30
|
+
import { VueTelInput } from 'vue-tel-input';
|
|
31
|
+
import 'vue-tel-input/vue-tel-input.css'
|
|
31
32
|
|
|
32
33
|
export default {
|
|
33
34
|
directives: { Outside },
|
|
34
35
|
props: {
|
|
36
|
+
modelValue: {
|
|
37
|
+
type: String
|
|
38
|
+
},
|
|
39
|
+
value: String,
|
|
35
40
|
inputName: {
|
|
36
41
|
type: String,
|
|
37
42
|
default: "phone",
|
|
@@ -40,10 +45,6 @@ export default {
|
|
|
40
45
|
type: Boolean,
|
|
41
46
|
default: true,
|
|
42
47
|
},
|
|
43
|
-
value: {
|
|
44
|
-
type: String,
|
|
45
|
-
default: "",
|
|
46
|
-
},
|
|
47
48
|
ignoredCountries: {
|
|
48
49
|
type: Array,
|
|
49
50
|
default: () => [],
|
|
@@ -57,6 +58,7 @@ export default {
|
|
|
57
58
|
default: "",
|
|
58
59
|
},
|
|
59
60
|
},
|
|
61
|
+
emits: ['update:modelValue', 'onReady'],
|
|
60
62
|
components: {
|
|
61
63
|
VueTelInput,
|
|
62
64
|
IbAlert,
|
|
@@ -65,16 +67,24 @@ export default {
|
|
|
65
67
|
data() {
|
|
66
68
|
return {
|
|
67
69
|
vueTel: null,
|
|
68
|
-
phone: "",
|
|
69
70
|
dialCode: "",
|
|
70
71
|
defaultCountry: "US",
|
|
72
|
+
allowChange: false
|
|
71
73
|
};
|
|
72
74
|
},
|
|
73
75
|
mounted() {
|
|
74
76
|
this.vueTel = this.$refs.vueTel;
|
|
75
77
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
+
this.$emit('onReady');
|
|
79
|
+
},
|
|
80
|
+
computed: {
|
|
81
|
+
phone: {
|
|
82
|
+
get() {
|
|
83
|
+
return this.modelValue
|
|
84
|
+
},
|
|
85
|
+
set(value) {
|
|
86
|
+
this.$emit('update:modelValue', value)
|
|
87
|
+
}
|
|
78
88
|
}
|
|
79
89
|
},
|
|
80
90
|
methods: {
|
|
@@ -101,5 +111,4 @@ export default {
|
|
|
101
111
|
|
|
102
112
|
<style lang="scss">
|
|
103
113
|
@import "./phoneInput.scss";
|
|
104
|
-
</style>
|
|
105
|
-
<style src="vue-tel-input/vue-tel-input.css"></style>
|
|
114
|
+
</style>
|
|
@@ -100,11 +100,10 @@ $dropdown-item-selected-border-color: $blue-900;
|
|
|
100
100
|
.vti__input {
|
|
101
101
|
background-color: transparent;
|
|
102
102
|
width: 100%;
|
|
103
|
-
margin: 0;
|
|
104
|
-
|
|
105
|
-
border-
|
|
106
|
-
border-
|
|
107
|
-
border-top: 0px;
|
|
103
|
+
margin: 0 0 6.5px;
|
|
104
|
+
border-left: 0;
|
|
105
|
+
border-right: 0;
|
|
106
|
+
border-top: 0;
|
|
108
107
|
border-radius: 0;
|
|
109
108
|
|
|
110
109
|
&::placeholder {
|
|
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,53 +44,42 @@ 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
|
-
|
|
66
|
-
|
|
67
|
-
|
|
55
|
+
emits: ['update:modelValue'],
|
|
56
|
+
data() {
|
|
57
|
+
return {
|
|
58
|
+
checked: false,
|
|
59
|
+
uid: generateUID(),
|
|
60
|
+
};
|
|
68
61
|
},
|
|
69
62
|
mounted() {
|
|
63
|
+
this.checked = this.isChecked;
|
|
70
64
|
this.$globalEvents.$on(`radio:update:${this.name}`, (uid) => {
|
|
71
65
|
if (this.uid !== uid) {
|
|
72
66
|
this.checked = false;
|
|
73
67
|
}
|
|
74
68
|
});
|
|
75
69
|
},
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
checked
|
|
79
|
-
|
|
80
|
-
};
|
|
70
|
+
watch: {
|
|
71
|
+
isChecked(val) {
|
|
72
|
+
this.checked = val;
|
|
73
|
+
},
|
|
81
74
|
},
|
|
82
75
|
methods: {
|
|
83
|
-
|
|
76
|
+
checkHandler() {
|
|
77
|
+
this.$emit('update:modelValue', this.value)
|
|
84
78
|
if (!this.disabled) {
|
|
85
79
|
this.checked = !this.checked;
|
|
86
80
|
this.$globalEvents.$emit(`radio:update:${this.name}`, this.uid);
|
|
87
|
-
this.$emit("input", this.checked);
|
|
88
|
-
this.$emit("change", this.checked);
|
|
89
81
|
}
|
|
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
|
-
},
|
|
82
|
+
}
|
|
99
83
|
},
|
|
100
84
|
computed: {
|
|
101
85
|
classes() {
|
|
@@ -106,6 +90,9 @@ export default {
|
|
|
106
90
|
"radio-disabled": this.disabled,
|
|
107
91
|
};
|
|
108
92
|
},
|
|
93
|
+
isChecked() {
|
|
94
|
+
return this.modelValue === this.value
|
|
95
|
+
}
|
|
109
96
|
},
|
|
110
97
|
};
|
|
111
98
|
</script>
|
|
@@ -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
|