@avakhula/ui 0.0.505 → 0.0.506-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.js +14352 -12501
- package/dist/index.umd.cjs +93 -82
- package/package.json +8 -7
- package/src/App.vue +7 -126
- package/src/assets/scss/mixins/dropdown-list-item.scss +6 -1
- package/src/assets/scss/mixins/tooltip-position.scss +0 -0
- package/src/assets/scss/mixins.scss +0 -0
- package/src/assets/scss/style.scss +0 -0
- 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 +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 +23 -8
- 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 +5 -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.spec.js +0 -0
- package/src/components/Dropdown/Dropdown.stories.js +0 -0
- package/src/components/Dropdown/Dropdown.vue +93 -23
- package/src/components/Dropdown/DropdownDivider.vue +0 -0
- package/src/components/Dropdown/DropdownItem.vue +26 -4
- package/src/components/Dropdown/DropdownList.stories.js +0 -0
- package/src/components/Dropdown/DropdownList.vue +15 -1
- 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 +24 -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 +352 -261
- package/src/components/Form/DatePicker/DatePicker.stories.js +0 -0
- package/src/components/Form/DatePicker/DatePicker.vue +72 -17
- package/src/components/Form/DatePicker/readme.mdx +0 -0
- package/src/components/Form/FormGroup/FormGroup.vue +3 -3
- package/src/components/Form/FormGroup/FormGroupSet.vue +0 -0
- package/src/components/Form/Input/Input.stories.js +0 -0
- package/src/components/Form/Input/Input.vue +119 -13
- package/src/components/Form/Input/constants.js +0 -0
- package/src/components/Form/Input/input.scss +61 -2
- 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 +76 -27
- package/src/components/Form/PhoneInput/phoneInput.scss +38 -6
- 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 +16 -44
- 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 +91 -137
- 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 +11 -335
- 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 +20 -6
- package/src/components/Form/Textarea/readme.mdx +0 -0
- package/src/components/Form/Textarea/textarea.scss +30 -2
- 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 +10 -3
- 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 +42 -9
- 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 +36 -4
- package/src/components/Pagination/pagination.scss +17 -1
- package/src/components/Panel/Panel.stories.js +0 -0
- package/src/components/Panel/Panel.vue +68 -2
- package/src/components/Popover/Popover.vue +25 -9
- 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 +24 -26
- package/src/components/Sorting/sorting.scss +0 -0
- package/src/components/SplitButton/SplitButton.stories.js +0 -0
- package/src/components/SplitButton/SplitButton.vue +51 -8
- 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/Table/Cells/Cell.vue +0 -0
- package/src/components/Table/Cells/CheckboxCell.vue +0 -0
- package/src/components/Table/Row.vue +0 -0
- 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 +0 -0
- package/src/components/Tabs/Tabs.stories.js +0 -0
- package/src/components/Tabs/Tabs.vue +20 -5
- package/src/components/Tabs/tabs.scss +8 -2
- package/src/components/TagPill/TagPill.stories.js +0 -0
- package/src/components/TagPill/TagPill.vue +6 -0
- package/src/components/TagPill/readme.mdx +0 -0
- package/src/components/ToggleTip/ToggleTip.vue +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 +58 -24
- package/src/components/TreeSelect/Select.stories.js +0 -0
- package/src/components/TreeSelect/Select.vue +281 -147
- 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 +93 -2
- 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 +0 -0
- package/dist/style.css +0 -1
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<button
|
|
3
|
+
:class="{
|
|
4
|
+
'ib-chips': true,
|
|
5
|
+
'ib-chips-active': active,
|
|
6
|
+
'ib-chips-error': error,
|
|
7
|
+
'ib-chips-disabled': disabled,
|
|
8
|
+
}"
|
|
9
|
+
:disabled="disabled"
|
|
10
|
+
>
|
|
11
|
+
<span v-if="hasIcon" class="ib-chips-icon-wrapper">
|
|
12
|
+
<slot class="ib-chips-icon" name="icon" />
|
|
13
|
+
</span>
|
|
14
|
+
|
|
15
|
+
<slot />
|
|
16
|
+
|
|
17
|
+
<span class="ib-chips-close-wrapper" v-if="showCloseIcon">
|
|
18
|
+
<icon class="ib-chips-icon" name="close-outline" />
|
|
19
|
+
</span>
|
|
20
|
+
</button>
|
|
21
|
+
</template>
|
|
22
|
+
|
|
23
|
+
<script>
|
|
24
|
+
import Icon from "../Icon.vue";
|
|
25
|
+
|
|
26
|
+
export default {
|
|
27
|
+
props: {
|
|
28
|
+
showCloseIcon: {
|
|
29
|
+
type: Boolean,
|
|
30
|
+
default: false,
|
|
31
|
+
},
|
|
32
|
+
active: {
|
|
33
|
+
type: Boolean,
|
|
34
|
+
default: false,
|
|
35
|
+
},
|
|
36
|
+
error: {
|
|
37
|
+
type: Boolean,
|
|
38
|
+
default: false,
|
|
39
|
+
},
|
|
40
|
+
disabled: {
|
|
41
|
+
type: Boolean,
|
|
42
|
+
default: false,
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
computed: {
|
|
46
|
+
hasIcon() {
|
|
47
|
+
return this.$slots?.icon;
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
components: {
|
|
51
|
+
Icon,
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
</script>
|
|
55
|
+
<style lang="scss" scoped>
|
|
56
|
+
@import "../../assets/scss/variables/colors.scss";
|
|
57
|
+
@import "../../assets/scss/typography.scss";
|
|
58
|
+
@import "../../assets/scss/mixins.scss";
|
|
59
|
+
|
|
60
|
+
.ib-chips {
|
|
61
|
+
@include Ib-H4-medium;
|
|
62
|
+
padding: 8.5px 10px;
|
|
63
|
+
border: 2px solid transparent;
|
|
64
|
+
border-radius: 4px;
|
|
65
|
+
height: 36px;
|
|
66
|
+
display: flex;
|
|
67
|
+
align-items: center;
|
|
68
|
+
background-color: $gray-100;
|
|
69
|
+
color: $neutral-600;
|
|
70
|
+
cursor: pointer;
|
|
71
|
+
transition: all 0.3s;
|
|
72
|
+
|
|
73
|
+
.ib-chips-close-wrapper,
|
|
74
|
+
.ib-chips-icon-wrapper {
|
|
75
|
+
width: 16px;
|
|
76
|
+
height: 16px;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.ib-chips-icon-wrapper {
|
|
80
|
+
margin-right: 5px;
|
|
81
|
+
}
|
|
82
|
+
.ib-chips-close-wrapper {
|
|
83
|
+
margin-left: 5px;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.ib-chips-icon {
|
|
87
|
+
color: inherit;
|
|
88
|
+
font-size: 16px;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
&.ib-chips-active {
|
|
92
|
+
background-color: $blue-200;
|
|
93
|
+
color: $blue-800;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
&.ib-chips-error {
|
|
97
|
+
border-color: $red-800;
|
|
98
|
+
color: $red-800;
|
|
99
|
+
background-color: $red-50;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
&.ib-chips-disabled {
|
|
103
|
+
border-color: transparent!important;
|
|
104
|
+
color: $neutral-500!important;
|
|
105
|
+
background-color: $gray-100!important;
|
|
106
|
+
cursor: default;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
&:hover {
|
|
110
|
+
border-color: $blue-300;
|
|
111
|
+
background-color: $blue-100;
|
|
112
|
+
color: $blue-700;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
&:active {
|
|
116
|
+
border-color: transparent;
|
|
117
|
+
background-color: $blue-200;
|
|
118
|
+
color: $blue-900;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
&:focus {
|
|
122
|
+
@include focus(2px);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
</style>
|
|
File without changes
|
|
File without changes
|
|
@@ -21,23 +21,46 @@
|
|
|
21
21
|
<slot name="trigger" v-bind:is-opened="isOpenedState"></slot>
|
|
22
22
|
</span>
|
|
23
23
|
|
|
24
|
-
<
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
v-if="!destroyOnHide || isOpenedState"
|
|
28
|
-
v-show="isOpenedState"
|
|
24
|
+
<Teleport
|
|
25
|
+
:to="attachToBody ? 'body' : attachTo"
|
|
26
|
+
v-if="attachToBody || attachTo"
|
|
29
27
|
>
|
|
30
|
-
<div
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
28
|
+
<div
|
|
29
|
+
ref="body"
|
|
30
|
+
:class="'ib-dropdown-menu is-teleported ' + classes"
|
|
31
|
+
v-if="!destroyOnHide || isOpenedState"
|
|
32
|
+
v-show="isOpenedState"
|
|
33
|
+
>
|
|
34
|
+
<div class="dropdown-body" @click="closeOnClickIfRequired">
|
|
35
|
+
<slot name="body" v-bind:is-opened-state="isOpenedState"></slot>
|
|
36
|
+
<span class="close" @click="close" v-if="showCloseIcon">
|
|
37
|
+
<slot name="close"></slot>
|
|
38
|
+
</span>
|
|
39
|
+
</div>
|
|
40
|
+
<div class="footer-slot">
|
|
41
|
+
<slot name="footer"></slot>
|
|
42
|
+
</div>
|
|
36
43
|
</div>
|
|
37
|
-
|
|
38
|
-
|
|
44
|
+
</Teleport>
|
|
45
|
+
|
|
46
|
+
<template v-else>
|
|
47
|
+
<div
|
|
48
|
+
ref="body"
|
|
49
|
+
:class="'ib-dropdown-menu ' + classes"
|
|
50
|
+
v-if="!destroyOnHide || isOpenedState"
|
|
51
|
+
v-show="isOpenedState"
|
|
52
|
+
>
|
|
53
|
+
<div class="dropdown-body" @click="closeOnClickIfRequired">
|
|
54
|
+
<slot name="body" v-bind:is-opened-state="isOpenedState"></slot>
|
|
55
|
+
<span class="close" @click="close" v-if="showCloseIcon">
|
|
56
|
+
<slot name="close"></slot>
|
|
57
|
+
</span>
|
|
58
|
+
</div>
|
|
59
|
+
<div class="footer-slot">
|
|
60
|
+
<slot name="footer"></slot>
|
|
61
|
+
</div>
|
|
39
62
|
</div>
|
|
40
|
-
</
|
|
63
|
+
</template>
|
|
41
64
|
|
|
42
65
|
<div class="before" @click="close">
|
|
43
66
|
<slot name="before"></slot>
|
|
@@ -55,6 +78,7 @@ import {
|
|
|
55
78
|
import { EVENT_NAME_CLICK } from "../../constants/events";
|
|
56
79
|
import { OutsideDirective as Outside } from "../../directives/outside/outside";
|
|
57
80
|
import { verticalPosition, horizontalPosition } from "./constants";
|
|
81
|
+
import { computePosition, flip, shift, offset } from "@floating-ui/dom";
|
|
58
82
|
|
|
59
83
|
export default {
|
|
60
84
|
name: "IbDropdown",
|
|
@@ -95,6 +119,14 @@ export default {
|
|
|
95
119
|
type: Boolean,
|
|
96
120
|
default: false,
|
|
97
121
|
},
|
|
122
|
+
attachToBody: {
|
|
123
|
+
type: Boolean,
|
|
124
|
+
default: false,
|
|
125
|
+
},
|
|
126
|
+
attachTo: {
|
|
127
|
+
type: String,
|
|
128
|
+
default: null,
|
|
129
|
+
},
|
|
98
130
|
},
|
|
99
131
|
watch: {
|
|
100
132
|
isOpened(value) {
|
|
@@ -122,6 +154,39 @@ export default {
|
|
|
122
154
|
};
|
|
123
155
|
},
|
|
124
156
|
methods: {
|
|
157
|
+
async updatePosition() {
|
|
158
|
+
const trigger = this.$refs.dropdown;
|
|
159
|
+
const body = this.$refs.body;
|
|
160
|
+
|
|
161
|
+
if (!trigger || !body) return;
|
|
162
|
+
|
|
163
|
+
const placementMap = {
|
|
164
|
+
bottom: { v: "bottom", h: "left" },
|
|
165
|
+
top: { v: "top", h: "left" },
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
const verticalPlacement = this.vertical === "top" ? "top" : "bottom";
|
|
169
|
+
const horizontalAlignment =
|
|
170
|
+
this.horizontal === "right"
|
|
171
|
+
? "end"
|
|
172
|
+
: this.horizontal === "center"
|
|
173
|
+
? ""
|
|
174
|
+
: "start";
|
|
175
|
+
|
|
176
|
+
const placement = horizontalAlignment
|
|
177
|
+
? `${verticalPlacement}-${horizontalAlignment}`
|
|
178
|
+
: verticalPlacement;
|
|
179
|
+
|
|
180
|
+
const { x, y } = await computePosition(trigger, body, {
|
|
181
|
+
placement,
|
|
182
|
+
middleware: [offset(3), flip(), shift({ padding: 8 })],
|
|
183
|
+
});
|
|
184
|
+
|
|
185
|
+
Object.assign(body.style, {
|
|
186
|
+
left: `${x}px`,
|
|
187
|
+
top: `${y}px`,
|
|
188
|
+
});
|
|
189
|
+
},
|
|
125
190
|
onKeydown(e) {
|
|
126
191
|
if (e.keyCode === ENTER_KEY_CODE || e.keyCode === SPACE_KEY_CODE) {
|
|
127
192
|
e.preventDefault();
|
|
@@ -147,14 +212,16 @@ export default {
|
|
|
147
212
|
}
|
|
148
213
|
},
|
|
149
214
|
open() {
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
215
|
+
if (this.disabled) return;
|
|
216
|
+
this.isOpenedState = true;
|
|
217
|
+
this.$emit('open');
|
|
218
|
+
this.$globalEvents.$emit('dropdown:open', this);
|
|
219
|
+
this.$nextTick(() => {
|
|
220
|
+
if (this.attachToBody || this.attachTo) {
|
|
221
|
+
this.updatePosition();
|
|
222
|
+
}
|
|
223
|
+
});
|
|
224
|
+
},
|
|
158
225
|
close() {
|
|
159
226
|
if (this.isOpenedState) {
|
|
160
227
|
if (this.disabled) {
|
|
@@ -250,9 +317,12 @@ $menu-bg: $white;
|
|
|
250
317
|
position: absolute;
|
|
251
318
|
display: block;
|
|
252
319
|
background-color: $menu-bg;
|
|
253
|
-
min-width: 100%;
|
|
254
320
|
width: fit-content;
|
|
255
321
|
|
|
322
|
+
&.is-teleported {
|
|
323
|
+
position: fixed;
|
|
324
|
+
}
|
|
325
|
+
|
|
256
326
|
.dropdown-body {
|
|
257
327
|
width: max-content;
|
|
258
328
|
min-width: 100%;
|
|
File without changes
|
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<li class="dropdown-item-wrapper">
|
|
3
3
|
<component
|
|
4
|
-
:is="
|
|
4
|
+
:is="component"
|
|
5
5
|
:class="checked ? 'active' : ''"
|
|
6
6
|
v-bind="attrs"
|
|
7
7
|
tabindex="0"
|
|
8
8
|
>
|
|
9
|
-
<
|
|
9
|
+
<p>
|
|
10
|
+
<div v-show="$slots.icon" class="dropdown-item-icon">
|
|
11
|
+
<slot name="icon"></slot>
|
|
12
|
+
</div>
|
|
13
|
+
<slot ref="slot"></slot>
|
|
14
|
+
</p>
|
|
10
15
|
</component>
|
|
11
16
|
</li>
|
|
12
17
|
</template>
|
|
@@ -21,8 +26,20 @@ export default {
|
|
|
21
26
|
href: {
|
|
22
27
|
type: String,
|
|
23
28
|
},
|
|
29
|
+
to: {
|
|
30
|
+
type: [String, Object],
|
|
31
|
+
}
|
|
24
32
|
},
|
|
25
33
|
computed: {
|
|
34
|
+
component() {
|
|
35
|
+
if (this.href) {
|
|
36
|
+
return "a";
|
|
37
|
+
} else if (this.to) {
|
|
38
|
+
return "router-link";
|
|
39
|
+
} else {
|
|
40
|
+
return "div";
|
|
41
|
+
}
|
|
42
|
+
},
|
|
26
43
|
attrs() {
|
|
27
44
|
const attrs = {
|
|
28
45
|
class: "ib-dropdown-item",
|
|
@@ -32,13 +49,17 @@ export default {
|
|
|
32
49
|
attrs.href = this.href;
|
|
33
50
|
}
|
|
34
51
|
|
|
52
|
+
if (this.to) {
|
|
53
|
+
attrs.to = this.to;
|
|
54
|
+
}
|
|
55
|
+
|
|
35
56
|
return attrs;
|
|
36
57
|
},
|
|
37
58
|
},
|
|
38
59
|
};
|
|
39
60
|
</script>
|
|
40
61
|
|
|
41
|
-
<style lang="scss">
|
|
62
|
+
<style lang="scss" scoped>
|
|
42
63
|
@import "../../assets/scss/mixins/dropdown-list-item.scss";
|
|
43
64
|
@include DropdownListItem;
|
|
44
65
|
|
|
@@ -50,8 +71,9 @@ export default {
|
|
|
50
71
|
display: flex;
|
|
51
72
|
align-items: center;
|
|
52
73
|
|
|
53
|
-
.
|
|
74
|
+
.dropdown-item-icon {
|
|
54
75
|
font-size: 16px;
|
|
76
|
+
height: 16px;
|
|
55
77
|
color: inherit;
|
|
56
78
|
margin-right: 15px;
|
|
57
79
|
}
|
|
File without changes
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="dropdown-list-wrapper">
|
|
2
|
+
<div class="dropdown-list-wrapper" :class="class">
|
|
3
3
|
<ib-dropdown
|
|
4
4
|
:horizontal="horizontal"
|
|
5
5
|
:vertical="vertical"
|
|
6
6
|
:isOpened="isOpened"
|
|
7
7
|
:closeOnClick="closeOnClick"
|
|
8
8
|
:disabled="disabled"
|
|
9
|
+
:attachToBody="attachToBody"
|
|
10
|
+
:attachTo="attachTo"
|
|
9
11
|
v-bind="$attrs"
|
|
10
12
|
ref="dropdown"
|
|
11
13
|
@all="proxyEvents"
|
|
@@ -50,6 +52,18 @@ export default {
|
|
|
50
52
|
type: Boolean,
|
|
51
53
|
default: false,
|
|
52
54
|
},
|
|
55
|
+
class: {
|
|
56
|
+
type: String,
|
|
57
|
+
default: "",
|
|
58
|
+
},
|
|
59
|
+
attachToBody: {
|
|
60
|
+
type: Boolean,
|
|
61
|
+
default: false,
|
|
62
|
+
},
|
|
63
|
+
attachTo: {
|
|
64
|
+
type: String,
|
|
65
|
+
default: null,
|
|
66
|
+
},
|
|
53
67
|
},
|
|
54
68
|
methods: {
|
|
55
69
|
proxyEvents(eventInfo) {
|
|
File without changes
|
|
@@ -3,17 +3,13 @@
|
|
|
3
3
|
<template v-if="!characterLength">
|
|
4
4
|
<p class="val-limit">Max {{ characterLimit }}</p>
|
|
5
5
|
</template>
|
|
6
|
-
<template v-else-if="characterLimit
|
|
7
|
-
<p class="val-length">{{
|
|
6
|
+
<template v-else-if="characterLimit >= characterLength">
|
|
7
|
+
<p class="val-length">{{ characterLength }}</p>
|
|
8
8
|
/
|
|
9
9
|
<p class="val-limit">{{ characterLimit }}</p>
|
|
10
10
|
</template>
|
|
11
|
-
<template v-else-if="characterLimit === characterLength">0</template>
|
|
12
|
-
|
|
13
11
|
<template v-else>
|
|
14
|
-
<p class="val-length
|
|
15
|
-
{{ characterLimit - characterLength }}
|
|
16
|
-
</p>
|
|
12
|
+
<p class="val-length error">{{ characterLimit - characterLength }}</p>
|
|
17
13
|
</template>
|
|
18
14
|
</div>
|
|
19
15
|
</template>
|
|
@@ -51,5 +47,12 @@ $textarea-character-count-limited-color: $red-900;
|
|
|
51
47
|
color: $textarea-character-count-limited-color;
|
|
52
48
|
}
|
|
53
49
|
}
|
|
50
|
+
|
|
51
|
+
.val-length,
|
|
52
|
+
.val-limit {
|
|
53
|
+
&.error {
|
|
54
|
+
color: $textarea-character-count-limited-color;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
54
57
|
}
|
|
55
58
|
</style>
|
|
File without changes
|
|
File without changes
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
2
|
+
<div class="ib-checkbox-wrapper" :class="this.$attrs.class">
|
|
3
3
|
<label
|
|
4
4
|
v-bind="attrs"
|
|
5
|
+
role="checkbox"
|
|
5
6
|
:for="id"
|
|
6
7
|
:tabindex="disabled | disableFocus ? -1 : 0"
|
|
8
|
+
:aria-checked="checked ? true : false"
|
|
7
9
|
@click.prevent.stop="onChange"
|
|
8
10
|
@keypress.prevent="onChange"
|
|
9
11
|
>
|
|
@@ -12,12 +14,22 @@
|
|
|
12
14
|
type="checkbox"
|
|
13
15
|
:name="name"
|
|
14
16
|
:id="id"
|
|
15
|
-
:value="value"
|
|
17
|
+
:value="value ?? 1"
|
|
16
18
|
:disabled="disabled"
|
|
17
19
|
:required="required"
|
|
18
20
|
v-model="checked"
|
|
19
21
|
@click="onChange"
|
|
20
22
|
/>
|
|
23
|
+
|
|
24
|
+
<input
|
|
25
|
+
v-if="!value && !checked"
|
|
26
|
+
value="0"
|
|
27
|
+
type="hidden"
|
|
28
|
+
:name="name"
|
|
29
|
+
:disabled="disabled"
|
|
30
|
+
:required="required"
|
|
31
|
+
/>
|
|
32
|
+
|
|
21
33
|
<div class="ib-checkbox-body">
|
|
22
34
|
<span
|
|
23
35
|
v-if="labelPosition === 'left' && label.length"
|
|
@@ -72,10 +84,10 @@ export default {
|
|
|
72
84
|
},
|
|
73
85
|
},
|
|
74
86
|
value: {
|
|
75
|
-
|
|
87
|
+
type: [String, Number],
|
|
76
88
|
},
|
|
77
89
|
modelValue: {
|
|
78
|
-
type: Boolean,
|
|
90
|
+
type: [Boolean, String],
|
|
79
91
|
},
|
|
80
92
|
isChecked: {
|
|
81
93
|
type: Boolean,
|
|
@@ -108,20 +120,21 @@ export default {
|
|
|
108
120
|
},
|
|
109
121
|
modelValue(value) {
|
|
110
122
|
this.$emit("update:modelValue", this.modelValue);
|
|
111
|
-
this.checked = value;
|
|
123
|
+
this.checked = value === "0" ? false : Boolean(value);
|
|
112
124
|
},
|
|
113
125
|
},
|
|
114
126
|
data() {
|
|
127
|
+
const value = this.modelValue
|
|
128
|
+
? (this.modelValue === "0" ? false : Boolean(this.modelValue))
|
|
129
|
+
: this.isChecked;
|
|
130
|
+
|
|
115
131
|
return {
|
|
116
|
-
checked:
|
|
132
|
+
checked: value,
|
|
117
133
|
};
|
|
118
134
|
},
|
|
119
135
|
methods: {
|
|
120
136
|
onChange(e) {
|
|
121
|
-
if (this.readonly)
|
|
122
|
-
e.preventDefault();
|
|
123
|
-
return;
|
|
124
|
-
};
|
|
137
|
+
if (this.disabled || this.readonly) return;
|
|
125
138
|
|
|
126
139
|
this.checked = !this.checked;
|
|
127
140
|
this.$emit("update:modelValue", this.checked);
|
|
@@ -157,6 +170,6 @@ export default {
|
|
|
157
170
|
};
|
|
158
171
|
</script>
|
|
159
172
|
|
|
160
|
-
<style lang="scss">
|
|
173
|
+
<style lang="scss" scoped>
|
|
161
174
|
@import "./Checkbox.scss";
|
|
162
175
|
</style>
|
|
File without changes
|
|
File without changes
|
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
v-if="labelText.length"
|
|
8
8
|
class="ib-checkbox-group-label"
|
|
9
9
|
:required="required"
|
|
10
|
+
:info-text="infoText"
|
|
11
|
+
:tooltip-position="tooltipPosition"
|
|
10
12
|
>
|
|
11
13
|
{{ labelText }}
|
|
12
14
|
</ib-label>
|
|
@@ -44,6 +46,17 @@ export default {
|
|
|
44
46
|
type: String,
|
|
45
47
|
default: "",
|
|
46
48
|
},
|
|
49
|
+
infoText: {
|
|
50
|
+
type: String,
|
|
51
|
+
default: ""
|
|
52
|
+
},
|
|
53
|
+
height: {
|
|
54
|
+
type: String,
|
|
55
|
+
default: '290px'
|
|
56
|
+
},
|
|
57
|
+
tooltipPosition: {
|
|
58
|
+
type: String
|
|
59
|
+
}
|
|
47
60
|
},
|
|
48
61
|
components: {
|
|
49
62
|
IbLabel,
|
|
@@ -62,6 +75,8 @@ export default {
|
|
|
62
75
|
.ib-checkbox-group-content {
|
|
63
76
|
display: flex;
|
|
64
77
|
flex-direction: column;
|
|
78
|
+
flex-wrap: wrap;
|
|
79
|
+
max-height: v-bind(height);
|
|
65
80
|
.ib-radio:not(:last-child),
|
|
66
81
|
.ib-checkbox:not(:last-child) {
|
|
67
82
|
margin-bottom: 10px;
|
|
@@ -17,6 +17,8 @@ The IbCheckboxGroup component is a wrapper component that helps to group and dis
|
|
|
17
17
|
| required | Boolean | false | If true, a required indicator will be displayed next to the label |
|
|
18
18
|
| horizontal | Boolean | false | If true, the checkboxes or radio buttons will be displayed horizontally |
|
|
19
19
|
| errorMessage | String | '' | Responsible for displaying an error |
|
|
20
|
+
| infoText | String | '' | The text that will be displayed inside the tooltip when the information button is hover or have focus. |
|
|
21
|
+
| maxHeight | String | '290px' | Max height of container with radio elements. |
|
|
20
22
|
|
|
21
23
|
### Slots
|
|
22
24
|
|