@avakhula/ui 0.1.13 → 0.1.15
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/.prettierrc.json +0 -0
- package/.storybook/intelliboardTheme.js +0 -0
- package/.storybook/manager.js +0 -0
- package/.storybook/scss-loader.scss +0 -0
- package/.storybook/withSource.js +0 -0
- package/README.md +0 -0
- package/dist/index.js +9028 -7513
- package/dist/index.umd.cjs +76 -73
- package/dist/style.css +1 -1
- package/index.html +0 -0
- package/package.json +4 -3
- package/src/App.vue +5 -128
- package/src/EventEmmiter.js +0 -0
- package/src/assets/scss/mixins/dropdown-list-item.scss +13 -1
- package/src/assets/scss/mixins.scss +0 -0
- package/src/assets/scss/reset.scss +0 -0
- package/src/assets/scss/style.scss +0 -0
- package/src/assets/scss/typography.scss +0 -0
- package/src/components/Alert/Alert.vue +5 -0
- package/src/components/Alert/alert.scss +6 -1
- 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.stories.js +0 -0
- package/src/components/Breadcrumbs/Breadcrumbs.vue +17 -7
- package/src/components/Button/Button.stories.js +0 -0
- package/src/components/Button/Button.vue +19 -3
- package/src/components/Button/button.scss +5 -0
- package/src/components/Button/constants.js +0 -0
- package/src/components/ButtonGroup/ButtonGroup.vue +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/DropdownDivider.vue +0 -0
- package/src/components/Dropdown/DropdownItem.vue +26 -4
- package/src/components/Dropdown/DropdownList.vue +0 -0
- package/src/components/Dropdown/constants.js +0 -0
- package/src/components/Form/CharactersCount.vue +10 -7
- package/src/components/Form/Checkbox/Checkbox.vue +25 -11
- 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.vue +72 -17
- package/src/components/Form/DatePicker/Icons/chevron-back.js +0 -0
- package/src/components/Form/DatePicker/Icons/chevron-forward.js +0 -0
- package/src/components/Form/FormGroup/FormGroup.stories.js +0 -0
- package/src/components/Form/FormGroup/FormGroup.vue +3 -3
- package/src/components/Form/FormGroup/FormGroupSet.stories.js +0 -0
- package/src/components/Form/FormGroup/FormGroupSet.vue +0 -0
- package/src/components/Form/Input/Input.vue +116 -13
- package/src/components/Form/Input/input.scss +61 -2
- package/src/components/Form/Label/Label.vue +22 -10
- package/src/components/Form/PhoneInput/PhoneInput.vue +26 -12
- package/src/components/Form/PhoneInput/phoneInput.scss +38 -6
- package/src/components/Form/Radio/Radio.vue +16 -44
- package/src/components/Form/Radio/radio.scss +5 -2
- package/src/components/Form/TextEditor/TextEditor.vue +117 -22
- package/src/components/Form/TextEditor/icons/svg/chevron-down.svg +0 -0
- package/src/components/Form/TextEditor/icons/toolbarIcons.js +0 -0
- package/src/components/Form/TextEditor/plugins/alphabetList.js +0 -0
- package/src/components/Form/TextEditor/textEditor.scss +56 -32
- package/src/components/Form/Textarea/Textarea.spec.js +0 -0
- package/src/components/Form/Textarea/Textarea.vue +19 -6
- package/src/components/Form/Textarea/textarea.scss +30 -2
- package/src/components/Icon.vue +0 -0
- package/src/components/IconButton/IconButton.scss +11 -0
- package/src/components/IconButton/IconButton.stories.js +0 -0
- package/src/components/IconButton/IconButton.vue +6 -9
- package/src/components/IconButton/constants.js +0 -0
- package/src/components/Modal/Modal.vue +42 -9
- package/src/components/Pagination/LimitSelector.vue +5 -0
- package/src/components/Pagination/Pagination.stories.js +0 -0
- package/src/components/Pagination/Pagination.vue +9 -2
- package/src/components/Panel/Panel.vue +87 -6
- package/src/components/Popover/Popover.stories.js +0 -0
- package/src/components/Popover/Popover.vue +47 -19
- package/src/components/Popover/popover.scss +27 -7
- package/src/components/ProgressBar/ProgressBar.stories.js +0 -0
- package/src/components/Sorting/Sorting.vue +24 -26
- package/src/components/Sorting/constants.js +0 -0
- package/src/components/SplitButton/SplitButton.vue +51 -8
- package/src/components/SplitButton/SplitButtonItem.vue +13 -1
- package/src/components/SplitButton/constants.js +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/Tabs.vue +5 -0
- package/src/components/Tabs/tabs.scss +8 -2
- package/src/components/TagPill/TagPill.vue +6 -0
- package/src/components/TagPill/constants.js +0 -0
- package/src/components/ToggleTip/ToggleTip.stories.js +0 -0
- package/src/components/ToggleTip/ToggleTip.vue +0 -0
- package/src/components/Tooltip/Tooltip.stories.js +0 -0
- package/src/components/Tooltip/Tooltip.vue +1 -1
- package/src/components/TreeSelect/Option.vue +48 -16
- package/src/components/TreeSelect/Select.vue +101 -39
- 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 +48 -2
- package/src/constants/events.js +0 -0
- package/src/constants/keyCodes.js +1 -0
- package/src/directives/outside/outside.js +0 -0
- package/src/directives/tooltip/TooltipController.js +2 -0
- package/src/directives/tooltip/textOverflowTooltip.js +3 -1
- package/src/directives/tooltip/tooltip.js +15 -0
- package/src/helpers/generateUID.js +0 -0
- package/src/helpers/getHrefFromID.js +0 -0
- package/src/helpers/multiLineOverflows.js +0 -0
- package/src/helpers/stripHtml.js +4 -0
- package/src/index.js +2 -0
- package/src/stories/link.stories.js +0 -0
- package/static/Logo.svg +0 -0
- package/vite.config.js +0 -0
|
@@ -1,53 +1,81 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
<Teleport to="body" v-if="attachToBody">
|
|
3
|
+
<Transition>
|
|
4
|
+
<div ref="popover" v-show="isVisible" :class="classes">
|
|
5
|
+
<slot></slot>
|
|
6
|
+
</div>
|
|
7
|
+
</Transition>
|
|
8
|
+
</Teleport>
|
|
9
|
+
|
|
10
|
+
<Transition v-else>
|
|
11
|
+
<div ref="popover" v-show="isVisible" :class="classes">
|
|
12
|
+
<slot></slot>
|
|
13
|
+
</div>
|
|
14
|
+
</Transition>
|
|
7
15
|
</template>
|
|
8
16
|
|
|
9
17
|
<script>
|
|
10
|
-
import {
|
|
18
|
+
import { computePosition, autoPlacement } from '@floating-ui/dom';
|
|
11
19
|
|
|
12
20
|
export default {
|
|
13
21
|
name: "IbPopover",
|
|
14
22
|
props: {
|
|
15
23
|
position: {
|
|
16
|
-
type: String,
|
|
17
|
-
default:
|
|
24
|
+
type: [String, Array],
|
|
25
|
+
default: 'top',
|
|
18
26
|
},
|
|
19
27
|
alwaysVisible: {
|
|
20
28
|
type: Boolean,
|
|
21
29
|
default: false,
|
|
22
30
|
},
|
|
31
|
+
attachToBody: {
|
|
32
|
+
type: Boolean,
|
|
33
|
+
default: false,
|
|
34
|
+
},
|
|
23
35
|
},
|
|
24
36
|
data() {
|
|
25
37
|
return {
|
|
26
38
|
parentNode: null,
|
|
27
39
|
isVisible: this.alwaysVisible ? true : false,
|
|
40
|
+
activePosition: null,
|
|
28
41
|
};
|
|
29
42
|
},
|
|
30
43
|
mounted() {
|
|
31
44
|
this.$nextTick(() => {
|
|
32
45
|
this.parentNode = this.$el.parentNode;
|
|
33
46
|
|
|
34
|
-
if (!this.parentNode) return;
|
|
35
|
-
|
|
36
|
-
if (getComputedStyle(this.parentNode).position !== "absolute") {
|
|
37
|
-
this.parentNode.style.position = "relative";
|
|
38
|
-
}
|
|
39
|
-
|
|
40
47
|
if (!this.alwaysVisible) {
|
|
41
|
-
this.parentNode
|
|
42
|
-
this.parentNode
|
|
43
|
-
this.parentNode
|
|
44
|
-
this.parentNode
|
|
48
|
+
this.parentNode?.addEventListener("focus", this.showPopover, true);
|
|
49
|
+
this.parentNode?.addEventListener("blur", this.hidePopover, true);
|
|
50
|
+
this.parentNode?.addEventListener("mouseover", this.showPopover);
|
|
51
|
+
this.parentNode?.addEventListener("mouseleave", this.hidePopover);
|
|
45
52
|
}
|
|
46
53
|
});
|
|
47
54
|
},
|
|
48
55
|
methods: {
|
|
49
56
|
showPopover() {
|
|
57
|
+
if (this.isVisible) return;
|
|
50
58
|
this.isVisible = true;
|
|
59
|
+
|
|
60
|
+
computePosition(
|
|
61
|
+
this.parentNode,
|
|
62
|
+
this.$refs.popover,
|
|
63
|
+
{
|
|
64
|
+
middleware: [
|
|
65
|
+
autoPlacement({
|
|
66
|
+
allowedPlacements: this.position,
|
|
67
|
+
})
|
|
68
|
+
]
|
|
69
|
+
}
|
|
70
|
+
)
|
|
71
|
+
.then(({x, y, placement }) => {
|
|
72
|
+
this.activePosition = placement;
|
|
73
|
+
|
|
74
|
+
Object.assign(this.$refs.popover.style, {
|
|
75
|
+
left: `${x}px`,
|
|
76
|
+
top: `${y}px`,
|
|
77
|
+
});
|
|
78
|
+
});
|
|
51
79
|
},
|
|
52
80
|
hidePopover() {
|
|
53
81
|
this.isVisible = false;
|
|
@@ -56,7 +84,7 @@ export default {
|
|
|
56
84
|
computed: {
|
|
57
85
|
classes() {
|
|
58
86
|
const classList = ["ib-popover"];
|
|
59
|
-
classList.push(`ib-${this.
|
|
87
|
+
classList.push(`ib-${this.activePosition}`);
|
|
60
88
|
|
|
61
89
|
if (this.isVisible) {
|
|
62
90
|
classList.push("active");
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
@import "../../assets/scss/typography.scss";
|
|
2
|
-
@import "../../assets/scss/mixins/tooltip-position.scss";
|
|
3
2
|
@import "../../assets/scss/variables/colors.scss";
|
|
4
3
|
@import "../../assets/scss/variables/shadows.scss";
|
|
5
4
|
|
|
@@ -16,11 +15,32 @@ $shadow: $ib-shadow-3;
|
|
|
16
15
|
color: $textColor;
|
|
17
16
|
border-radius: 4px;
|
|
18
17
|
box-shadow: $shadow;
|
|
19
|
-
|
|
20
|
-
bottom: auto;
|
|
21
|
-
left: auto;
|
|
22
|
-
right: auto;
|
|
23
|
-
@include TooltipPosition;
|
|
24
|
-
z-index: 100;
|
|
18
|
+
z-index: 9998;
|
|
25
19
|
text-align: start;
|
|
20
|
+
|
|
21
|
+
&.ib {
|
|
22
|
+
&-right,
|
|
23
|
+
&-right-start,
|
|
24
|
+
&-right-end {
|
|
25
|
+
margin-left: 7px;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
&-left,
|
|
29
|
+
&-left-start,
|
|
30
|
+
&-left-end {
|
|
31
|
+
margin-left: -7px;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
&-top,
|
|
35
|
+
&-top-start,
|
|
36
|
+
&-top-end {
|
|
37
|
+
margin-top: -7px;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
&-bottom,
|
|
41
|
+
&-bottom-start,
|
|
42
|
+
&-bottom-end {
|
|
43
|
+
margin-bottom: -7px;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
26
46
|
}
|
|
File without changes
|
|
@@ -8,33 +8,31 @@
|
|
|
8
8
|
}"
|
|
9
9
|
v-if="view === sortingTypesView.TABLE_VIEW"
|
|
10
10
|
>
|
|
11
|
-
<
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
:
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
</button>
|
|
11
|
+
<button
|
|
12
|
+
class="sorting-label"
|
|
13
|
+
v-tooltip:[sortingTooltipPosition]="sortingTooltipContent"
|
|
14
|
+
:class="{
|
|
15
|
+
'sorting-label-active': isOpenToggleTip && hasToggleTip,
|
|
16
|
+
'has-action': tooltipText?.length || hasToggleTip
|
|
17
|
+
}"
|
|
18
|
+
type="button"
|
|
19
|
+
@click="isOpenToggleTip = !isOpenToggleTip"
|
|
20
|
+
>
|
|
21
|
+
{{ title }}
|
|
22
|
+
</button>
|
|
24
23
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
</div>
|
|
24
|
+
<ib-toggle-tip
|
|
25
|
+
v-if="hasToggleTip"
|
|
26
|
+
position="bottom-center"
|
|
27
|
+
:is-open="isOpenToggleTip"
|
|
28
|
+
:title="toggleTipTitle"
|
|
29
|
+
@close="isOpenToggleTip = false"
|
|
30
|
+
>
|
|
31
|
+
<slot name="toggleTipBody"></slot>
|
|
32
|
+
<template #buttons>
|
|
33
|
+
<slot name="toggleTipButtons"></slot>
|
|
34
|
+
</template>
|
|
35
|
+
</ib-toggle-tip>
|
|
38
36
|
|
|
39
37
|
<ib-icon-button
|
|
40
38
|
v-if="!hideSortingButton"
|
|
File without changes
|
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div :class="classes">
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
v-if="
|
|
3
|
+
|
|
4
|
+
<router-link
|
|
5
|
+
v-if="isRouterLink"
|
|
6
6
|
class="split-button-main"
|
|
7
|
+
:class="{ disabled }"
|
|
8
|
+
:disabled="disabled"
|
|
9
|
+
:to="mainButtonAttrs.to"
|
|
7
10
|
v-bind="mainButtonAttrs"
|
|
11
|
+
@click="onClickLink"
|
|
8
12
|
>
|
|
9
13
|
{{ content }}
|
|
10
|
-
</
|
|
14
|
+
</router-link>
|
|
11
15
|
|
|
12
16
|
<a
|
|
13
|
-
v-else
|
|
17
|
+
v-else-if="isLink"
|
|
14
18
|
class="split-button-main"
|
|
15
19
|
:class="{ disabled }"
|
|
16
20
|
:disabled="disabled"
|
|
@@ -20,7 +24,16 @@
|
|
|
20
24
|
{{ content }}
|
|
21
25
|
</a>
|
|
22
26
|
|
|
23
|
-
<
|
|
27
|
+
<button
|
|
28
|
+
v-else
|
|
29
|
+
:disabled="disabled"
|
|
30
|
+
class="split-button-main"
|
|
31
|
+
v-bind="mainButtonAttrs"
|
|
32
|
+
>
|
|
33
|
+
{{ content }}
|
|
34
|
+
</button>
|
|
35
|
+
|
|
36
|
+
<ib-dropdown-list :disabled="disabled" :closeOnClick="true" :vertical="verticalPosition" :horizontal="verticalPosition === 'top' ? 'right' : 'left'">
|
|
24
37
|
<template #trigger>
|
|
25
38
|
<button :disabled="disabled" class="split-button-menu-trigger">
|
|
26
39
|
<ib-icon name="chevron-down-outline" />
|
|
@@ -53,6 +66,10 @@ export default {
|
|
|
53
66
|
type: String,
|
|
54
67
|
default: splitButtonKindOptions.common,
|
|
55
68
|
},
|
|
69
|
+
verticalPosition: {
|
|
70
|
+
type: String,
|
|
71
|
+
default: "bottom",
|
|
72
|
+
},
|
|
56
73
|
disabled: {
|
|
57
74
|
type: Boolean,
|
|
58
75
|
default: false,
|
|
@@ -83,7 +100,20 @@ export default {
|
|
|
83
100
|
}
|
|
84
101
|
}
|
|
85
102
|
|
|
86
|
-
this
|
|
103
|
+
this.$nextTick(() => {
|
|
104
|
+
this.setActiveItem();
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
this.listObserver = new MutationObserver((mutationsList) => {
|
|
108
|
+
for (const mutation of mutationsList) {
|
|
109
|
+
if (mutation.type === "attributes" && mutation.attributeName === "disabled") {
|
|
110
|
+
this.mainButtonAttrs.disabled = mutation.target.disabled;
|
|
111
|
+
break;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
this.listObserver.observe(this.$refs.list, { attributes: true, subtree: true });
|
|
87
117
|
},
|
|
88
118
|
data() {
|
|
89
119
|
return {
|
|
@@ -91,7 +121,9 @@ export default {
|
|
|
91
121
|
content: "",
|
|
92
122
|
mainButtonAttrs: {},
|
|
93
123
|
isLink: false,
|
|
124
|
+
isRouterLink: false,
|
|
94
125
|
childList: [],
|
|
126
|
+
listObserver: null,
|
|
95
127
|
};
|
|
96
128
|
},
|
|
97
129
|
components: {
|
|
@@ -100,14 +132,21 @@ export default {
|
|
|
100
132
|
},
|
|
101
133
|
methods: {
|
|
102
134
|
setActiveItem() {
|
|
103
|
-
|
|
135
|
+
const attrs = this.$slots.default()[this.activeElemIdx].props;
|
|
104
136
|
|
|
137
|
+
this.mainButtonAttrs = attrs;
|
|
105
138
|
if (this.mainButtonAttrs && "href" in this.mainButtonAttrs) {
|
|
106
139
|
this.isLink = true;
|
|
107
140
|
} else {
|
|
108
141
|
this.isLink = false;
|
|
109
142
|
}
|
|
110
143
|
|
|
144
|
+
if (this.mainButtonAttrs && "to" in this.mainButtonAttrs) {
|
|
145
|
+
this.isRouterLink = true;
|
|
146
|
+
} else {
|
|
147
|
+
this.isRouterLink = false;
|
|
148
|
+
}
|
|
149
|
+
|
|
111
150
|
this.childList[this.activeElemIdx].classList.add("active");
|
|
112
151
|
this.content = this.childList[this.activeElemIdx].textContent;
|
|
113
152
|
},
|
|
@@ -131,6 +170,10 @@ export default {
|
|
|
131
170
|
this.setActiveItem();
|
|
132
171
|
},
|
|
133
172
|
},
|
|
173
|
+
beforeUnmount() {
|
|
174
|
+
this.listObserver.disconnect();
|
|
175
|
+
this.listObserver = null;
|
|
176
|
+
}
|
|
134
177
|
};
|
|
135
178
|
</script>
|
|
136
179
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<component
|
|
3
|
-
:is="
|
|
3
|
+
:is="component"
|
|
4
4
|
v-bind="attrs"
|
|
5
5
|
class="ib-dropdown-item"
|
|
6
6
|
>
|
|
@@ -15,6 +15,9 @@ export default {
|
|
|
15
15
|
type: String,
|
|
16
16
|
default: "",
|
|
17
17
|
},
|
|
18
|
+
to: {
|
|
19
|
+
type: [String, Object],
|
|
20
|
+
}
|
|
18
21
|
},
|
|
19
22
|
computed: {
|
|
20
23
|
attrs() {
|
|
@@ -23,8 +26,17 @@ export default {
|
|
|
23
26
|
attrsList.href = this.href;
|
|
24
27
|
}
|
|
25
28
|
|
|
29
|
+
if (this.to) {
|
|
30
|
+
attrsList.to = this.to;
|
|
31
|
+
}
|
|
32
|
+
|
|
26
33
|
return attrsList;
|
|
27
34
|
},
|
|
35
|
+
component() {
|
|
36
|
+
if (this.href.length) return "a";
|
|
37
|
+
if (this.to) return "router-link";
|
|
38
|
+
return "button";
|
|
39
|
+
}
|
|
28
40
|
},
|
|
29
41
|
};
|
|
30
42
|
</script>
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -14,6 +14,8 @@
|
|
|
14
14
|
@click="selectTab(tab.id)"
|
|
15
15
|
target="_self"
|
|
16
16
|
>
|
|
17
|
+
<ib-icon class="tab-icon" v-if="tab.icon" :name="tab.icon" />
|
|
18
|
+
|
|
17
19
|
{{ tab.title }}
|
|
18
20
|
</a>
|
|
19
21
|
</div>
|
|
@@ -32,8 +34,10 @@
|
|
|
32
34
|
</div>
|
|
33
35
|
</template>
|
|
34
36
|
<script>
|
|
37
|
+
import IbIcon from "../Icon.vue";
|
|
35
38
|
import IbTabDropdown from "./TabDropdown.vue";
|
|
36
39
|
import getHrefFromId from "../../helpers/getHrefFromID";
|
|
40
|
+
|
|
37
41
|
export default {
|
|
38
42
|
name: "IbTabs",
|
|
39
43
|
props: {
|
|
@@ -108,6 +112,7 @@ export default {
|
|
|
108
112
|
},
|
|
109
113
|
components: {
|
|
110
114
|
IbTabDropdown,
|
|
115
|
+
IbIcon,
|
|
111
116
|
},
|
|
112
117
|
emits: ["changeTab"]
|
|
113
118
|
};
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
background-color: $gray-300;
|
|
24
24
|
z-index: -1;
|
|
25
25
|
}
|
|
26
|
-
|
|
26
|
+
|
|
27
27
|
.tab-item {
|
|
28
28
|
position: relative;
|
|
29
29
|
margin: 0 15px;
|
|
@@ -65,6 +65,12 @@
|
|
|
65
65
|
color: $neutral-900;
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
+
.tab-icon {
|
|
69
|
+
margin-right: 3px;
|
|
70
|
+
color: inherit;
|
|
71
|
+
font-size: 16px;
|
|
72
|
+
}
|
|
73
|
+
|
|
68
74
|
&::after {
|
|
69
75
|
content: '';
|
|
70
76
|
width: 100%;
|
|
@@ -154,4 +160,4 @@
|
|
|
154
160
|
}
|
|
155
161
|
}
|
|
156
162
|
}
|
|
157
|
-
}
|
|
163
|
+
}
|
|
@@ -18,6 +18,10 @@ export default {
|
|
|
18
18
|
default: tagPillSTatuses.neutral,
|
|
19
19
|
validator: (value) => Object.keys(tagPillSTatuses).includes(value),
|
|
20
20
|
},
|
|
21
|
+
icon: {
|
|
22
|
+
type: String,
|
|
23
|
+
default: "",
|
|
24
|
+
},
|
|
21
25
|
showIcon: {
|
|
22
26
|
type: Boolean,
|
|
23
27
|
default: false,
|
|
@@ -31,6 +35,8 @@ export default {
|
|
|
31
35
|
return classList;
|
|
32
36
|
},
|
|
33
37
|
iconName() {
|
|
38
|
+
if (this.icon) return this.icon;
|
|
39
|
+
|
|
34
40
|
switch (this.status) {
|
|
35
41
|
case tagPillSTatuses.success:
|
|
36
42
|
return "checkmark-outline";
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<li>
|
|
3
3
|
<div
|
|
4
|
-
v-tooltip="showTooltip ? option.title : ''"
|
|
4
|
+
v-tooltip="showTooltip ? (option.isDisabled ? option.disableTooltip : option.title) : ''"
|
|
5
5
|
class="tree-select-option"
|
|
6
6
|
tabindex="0"
|
|
7
7
|
role="option"
|
|
@@ -14,7 +14,9 @@
|
|
|
14
14
|
active: option.isChildrenVisible,
|
|
15
15
|
'is-multiple': isMultiple,
|
|
16
16
|
'is-not-multiple': !isMultiple,
|
|
17
|
+
'has-icon': option.icon,
|
|
17
18
|
'tree-select-option-toggle': this.isToggle && this.isMultiple,
|
|
19
|
+
'alphabetic-option': alphabeticStyle,
|
|
18
20
|
}"
|
|
19
21
|
@keydown.self="onKeydown"
|
|
20
22
|
@focus="$emit('onFocus', `option-${id}`)"
|
|
@@ -46,7 +48,7 @@
|
|
|
46
48
|
:aria-label="option.title"
|
|
47
49
|
:name="actualName"
|
|
48
50
|
:value="option.id"
|
|
49
|
-
:id="'input' + id"
|
|
51
|
+
:id="'input' + id + generateUID()"
|
|
50
52
|
:is-checked="isChecked(option)"
|
|
51
53
|
:disabled="option.isDisabled"
|
|
52
54
|
:readonly="option.readonly"
|
|
@@ -63,13 +65,21 @@
|
|
|
63
65
|
'bookmarkable-option-title ' + (isBookmarked ? 'bookmarked' : '')
|
|
64
66
|
"
|
|
65
67
|
>
|
|
66
|
-
<
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
68
|
+
<div class="bookmarkable-option-content" v-if="!hasChildren">
|
|
69
|
+
<span class="option-label" >
|
|
70
|
+
{{ option.title }}
|
|
71
|
+
</span>
|
|
72
|
+
|
|
73
|
+
<ib-icon-button
|
|
70
74
|
@click.stop.prevent="$emit('toggle-bookmark', option)"
|
|
71
|
-
|
|
72
|
-
|
|
75
|
+
kind="ghost"
|
|
76
|
+
v-tooltip="lang(isBookmarked ? 'unpin' : 'pin_to_top', 'select')"
|
|
77
|
+
>
|
|
78
|
+
<ib-icon
|
|
79
|
+
:name="isBookmarked ? 'star' : 'star-outline'"
|
|
80
|
+
></ib-icon>
|
|
81
|
+
</ib-icon-button>
|
|
82
|
+
</div>
|
|
73
83
|
|
|
74
84
|
<span class="option-label" v-else>{{ option.title }}</span>
|
|
75
85
|
</span>
|
|
@@ -84,7 +94,13 @@
|
|
|
84
94
|
</template>
|
|
85
95
|
|
|
86
96
|
<template v-else>
|
|
87
|
-
<span class="option-label">
|
|
97
|
+
<span class="option-label">
|
|
98
|
+
<ib-icon
|
|
99
|
+
v-if="option.icon"
|
|
100
|
+
:name="option.icon"
|
|
101
|
+
></ib-icon>
|
|
102
|
+
{{ option.title }}
|
|
103
|
+
</span>
|
|
88
104
|
</template>
|
|
89
105
|
</div>
|
|
90
106
|
|
|
@@ -118,6 +134,7 @@ import List from "../List.vue";
|
|
|
118
134
|
import IbIcon from "../Icon.vue";
|
|
119
135
|
import IbIconButton from "../IconButton/IconButton.vue";
|
|
120
136
|
import { TooltipDirective as Tooltip } from "../../directives/tooltip/tooltip";
|
|
137
|
+
import generateUID from "../../helpers/generateUID";
|
|
121
138
|
import multiLineOverflows from "../../helpers/multiLineOverflows";
|
|
122
139
|
import {
|
|
123
140
|
SPACE_KEY_CODE,
|
|
@@ -168,16 +185,26 @@ export default {
|
|
|
168
185
|
type: Boolean,
|
|
169
186
|
default: false,
|
|
170
187
|
},
|
|
188
|
+
alphabeticStyle: {
|
|
189
|
+
type: Boolean,
|
|
190
|
+
default: false
|
|
191
|
+
},
|
|
171
192
|
},
|
|
172
193
|
mounted() {
|
|
173
194
|
// eslint-disable-next-line no-prototype-builtins
|
|
174
195
|
if (this.option.hasOwnProperty("children") && this.option.children) {
|
|
175
196
|
this.checkParent();
|
|
176
197
|
}
|
|
198
|
+
|
|
199
|
+
if(this.option.showTooltipByDefault) {
|
|
200
|
+
this.showTooltip = true;
|
|
201
|
+
}
|
|
177
202
|
},
|
|
178
203
|
updated() {
|
|
179
204
|
this.$nextTick(() => {
|
|
180
|
-
if
|
|
205
|
+
if(this.option.showTooltipByDefault) {
|
|
206
|
+
this.showTooltip = true;
|
|
207
|
+
} else if (multiLineOverflows(this.$el.querySelector(".option-label"))) {
|
|
181
208
|
this.showTooltip = true;
|
|
182
209
|
}
|
|
183
210
|
});
|
|
@@ -185,6 +212,7 @@ export default {
|
|
|
185
212
|
data() {
|
|
186
213
|
return {
|
|
187
214
|
showTooltip: false,
|
|
215
|
+
generateUID,
|
|
188
216
|
};
|
|
189
217
|
},
|
|
190
218
|
methods: {
|
|
@@ -219,6 +247,11 @@ export default {
|
|
|
219
247
|
this.check(this.option, value, true, checkChildren);
|
|
220
248
|
},
|
|
221
249
|
check(option, checkStatus, isDirectChild, checkChildren) {
|
|
250
|
+
if (!this.isMultiple && this.hasVisibleChildren) {
|
|
251
|
+
this.toggleChildrenVisibility();
|
|
252
|
+
return;
|
|
253
|
+
}
|
|
254
|
+
|
|
222
255
|
this.$emit("check", option, checkStatus, isDirectChild);
|
|
223
256
|
if (checkChildren) {
|
|
224
257
|
option.children &&
|
|
@@ -271,12 +304,11 @@ export default {
|
|
|
271
304
|
},
|
|
272
305
|
isChecked(option) {
|
|
273
306
|
if(this.hasChildren) {
|
|
274
|
-
if (
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
) {
|
|
307
|
+
if (this.childrenSelectedCount === this.countOfAllChildren) {
|
|
308
|
+
return true;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
if (this.childrenSelectedCount > 0 && this.countOfAllChildren > this.childrenSelectedCount) {
|
|
280
312
|
return null; //null will trigger indeterminate stage
|
|
281
313
|
}
|
|
282
314
|
}
|