@avakhula/ui 0.0.32 → 0.0.34-4.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/.eslintrc.cjs +17 -10
- package/.storybook/preview-head.html +1 -0
- package/dist/index.js +9040 -7752
- package/dist/index.umd.cjs +87 -88
- package/dist/style.css +1 -1
- package/package.json +15 -15
- package/src/App.vue +138 -25
- package/src/assets/scss/mixins/dropdown-list-item.scss +8 -1
- package/src/assets/scss/mixins/tooltip-position.scss +1 -1
- package/src/assets/scss/variables/shadows.json +14 -30
- package/src/assets/scss/variables/shadows.scss +10 -15
- package/src/components/Accordion/Accordion.scss +4 -1
- package/src/components/Accordion/Accordion.vue +20 -3
- package/src/components/Accordion/Acordion.spec.js +75 -0
- package/src/components/Alert/Alert.spec.js +69 -0
- package/src/components/Alert/Alert.stories.js +1 -4
- package/src/components/Alert/Alert.vue +22 -3
- package/src/components/Alert/alert.scss +22 -0
- package/src/components/Alert/constants.js +1 -0
- package/src/components/Avatar/Avatar.stories.js +23 -0
- package/src/components/Avatar/Avatar.vue +125 -0
- package/src/components/Avatar/constants.js +4 -0
- package/src/components/Badge/Badge.spec.js +37 -0
- package/src/components/Badge/Badge.vue +1 -1
- package/src/components/Button/Button.spec.js +85 -0
- package/src/components/Button/Button.vue +14 -3
- package/src/components/Button/button.scss +5 -0
- package/src/components/Dropdown/Dropdown.vue +3 -3
- package/src/components/Dropdown/DropdownItem.vue +9 -3
- package/src/components/Form/Checkbox/Checkbox.scss +79 -53
- package/src/components/Form/Checkbox/Checkbox.stories.js +4 -2
- package/src/components/Form/Checkbox/Checkbox.vue +70 -48
- package/src/components/Form/CheckboxGroup/CheckboxGroup.vue +11 -0
- package/src/components/Form/CheckboxGroup/readme.mdx +2 -0
- package/src/components/Form/DatePicker/DatePicker.scss +259 -261
- package/src/components/Form/DatePicker/DatePicker.vue +1 -1
- package/src/components/Form/Input/Input.vue +69 -15
- package/src/components/Form/Input/constants.js +1 -0
- package/src/components/Form/Input/input.scss +33 -6
- package/src/components/Form/Label/Label.stories.js +7 -0
- package/src/components/Form/Label/Label.vue +43 -4
- package/src/components/Form/Label/readme.mdx +1 -0
- package/src/components/Form/PhoneInput/phoneInput.scss +3 -2
- package/src/components/Form/Radio/Radio.vue +31 -38
- package/src/components/Form/Radio/radio.scss +6 -3
- package/src/components/Form/Toggle/Toggle.vue +5 -1
- package/src/components/Form/Toggle/toggle.scss +4 -4
- package/src/components/IconButton/IconButton.scss +7 -0
- package/src/components/IconButton/IconButton.vue +10 -9
- package/src/components/List.vue +1 -1
- package/src/components/Modal/Modal.stories.js +6 -4
- package/src/components/Modal/Modal.vue +56 -11
- package/src/components/Pagination/LimitSelector.vue +3 -5
- package/src/components/Pagination/Pagination.vue +3 -0
- package/src/components/Pagination/pagination.scss +8 -14
- package/src/components/Panel/Panel.stories.js +0 -7
- package/src/components/Panel/Panel.vue +30 -29
- package/src/components/Popover/Popover.vue +43 -17
- package/src/components/Popover/constants.js +1 -1
- package/src/components/Popover/popover.scss +28 -8
- package/src/components/ProgressBar/ProgressBar.vue +14 -1
- package/src/components/ProgressBar/constants.js +1 -0
- package/src/components/ProgressBar/progressBar.scss +7 -0
- package/src/components/Sorting/Sorting.stories.js +12 -2
- package/src/components/Sorting/Sorting.vue +125 -37
- package/src/components/Sorting/sorting.scss +17 -14
- package/src/components/SplitButton/SplitButton.vue +8 -1
- package/src/components/SplitButton/splitButton.scss +3 -0
- package/src/components/StatusIndicator/icons.js +11 -11
- package/src/components/Tabs/Tabs.vue +25 -2
- package/src/components/Tabs/tabs.scss +1 -1
- package/src/components/ToggleTip/constants.js +1 -1
- package/src/components/ToggleTip/toggleTip.scss +2 -2
- package/src/components/Tooltip/Tooltip.vue +120 -4
- package/src/components/TreeSelect/Option.vue +36 -27
- package/src/components/TreeSelect/Select.stories.js +6 -88
- package/src/components/TreeSelect/Select.vue +272 -130
- package/src/components/TreeSelect/scss/option.scss +4 -0
- package/src/components/TreeSelect/scss/select.scss +51 -6
- package/src/directives/tooltip/TooltipController.js +184 -0
- package/src/directives/tooltip/readme.mdx +17 -0
- package/src/directives/tooltip/textOverflowTooltip.js +21 -49
- package/src/directives/tooltip/tooltip.js +57 -45
- package/src/directives/tooltip/tooltip.stories.js +39 -0
- package/src/helpers/removeEvents.js +2 -2
- package/src/index.js +1 -0
- package/src/main.js +1 -0
- package/src/scripts/parseScssVariables.js +23 -7
- package/src/components/Panel/constants.js +0 -4
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import IbSorting from "./Sorting.vue";
|
|
2
2
|
import { typesSorting, typesSortingView } from "./constants.js";
|
|
3
|
+
import { popoverPosition } from "../Popover/constants";
|
|
3
4
|
|
|
4
5
|
export default {
|
|
5
6
|
title: "Sorting",
|
|
@@ -9,10 +10,18 @@ export default {
|
|
|
9
10
|
control: { type: "select" },
|
|
10
11
|
options: Object.values(typesSorting),
|
|
11
12
|
},
|
|
12
|
-
|
|
13
|
+
view: {
|
|
13
14
|
control: { type: "select" },
|
|
14
15
|
options: Object.values(typesSortingView),
|
|
15
16
|
},
|
|
17
|
+
tooltipPosition: {
|
|
18
|
+
control: { type: "select" },
|
|
19
|
+
options: Object.keys(popoverPosition),
|
|
20
|
+
},
|
|
21
|
+
tooltipIconPosition: {
|
|
22
|
+
control: { type: "select" },
|
|
23
|
+
options: Object.keys(popoverPosition),
|
|
24
|
+
},
|
|
16
25
|
},
|
|
17
26
|
};
|
|
18
27
|
|
|
@@ -30,6 +39,7 @@ const Template = (args) => ({
|
|
|
30
39
|
|
|
31
40
|
export const Default = Template.bind({});
|
|
32
41
|
Default.args = {
|
|
33
|
-
|
|
42
|
+
view: typesSortingView.TABLE_VIEW,
|
|
34
43
|
title: "sorting",
|
|
44
|
+
tableName: "test",
|
|
35
45
|
};
|
|
@@ -4,43 +4,63 @@
|
|
|
4
4
|
class="table-sorting-wrapper"
|
|
5
5
|
:class="{
|
|
6
6
|
active: currentTypeSort,
|
|
7
|
-
disabled:
|
|
7
|
+
disabled: disable,
|
|
8
8
|
}"
|
|
9
|
-
v-if="
|
|
9
|
+
v-if="view === sortingTypesView.TABLE_VIEW"
|
|
10
10
|
>
|
|
11
|
-
<
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
<div>
|
|
12
|
+
<button
|
|
13
|
+
class="sorting-label"
|
|
14
|
+
v-tooltip:[sortingTooltipPosition]="sortingTooltipContent"
|
|
15
|
+
:class="{
|
|
16
|
+
'sorting-label-active': isOpenToggleTip && hasToggleTip,
|
|
17
|
+
'has-action': tooltipText?.length || hasToggleTip
|
|
18
|
+
}"
|
|
19
|
+
type="button"
|
|
20
|
+
@click="isOpenToggleTip = !isOpenToggleTip"
|
|
21
|
+
>
|
|
22
|
+
{{ title }}
|
|
23
|
+
</button>
|
|
24
|
+
|
|
25
|
+
<ib-toggle-tip
|
|
26
|
+
v-if="hasToggleTip"
|
|
27
|
+
position="bottom-center"
|
|
28
|
+
:is-open="isOpenToggleTip"
|
|
29
|
+
:title="toggleTipTitle"
|
|
30
|
+
@close="isOpenToggleTip = false"
|
|
31
|
+
>
|
|
32
|
+
<slot name="toggleTipBody"></slot>
|
|
33
|
+
<template #buttons>
|
|
34
|
+
<slot name="toggleTipButtons"></slot>
|
|
35
|
+
</template>
|
|
36
|
+
</ib-toggle-tip>
|
|
37
|
+
</div>
|
|
38
|
+
|
|
39
|
+
<ib-icon-button
|
|
40
|
+
v-if="!hideSortingButton"
|
|
41
|
+
v-tooltip:[tooltipIconPosition]="tooltipIconText"
|
|
42
|
+
kind="white"
|
|
43
|
+
size="s"
|
|
44
|
+
@click="clickHandler"
|
|
45
|
+
>
|
|
17
46
|
<ion-icon :name="iconType"></ion-icon>
|
|
18
|
-
<ib-tooltip v-if="tooltipIconSorting" :text="tooltipIconSorting">
|
|
19
|
-
</ib-tooltip>
|
|
20
47
|
</ib-icon-button>
|
|
21
48
|
</div>
|
|
22
49
|
|
|
23
50
|
<button
|
|
24
51
|
v-else
|
|
52
|
+
v-tooltip:[tooltipPosition]="tooltipText"
|
|
25
53
|
class="sorting-button"
|
|
26
54
|
type="button"
|
|
27
|
-
:aria-label="sort"
|
|
28
55
|
@click="clickHandler"
|
|
56
|
+
:aria-label="sort"
|
|
29
57
|
:class="{
|
|
30
58
|
active: currentTypeSort,
|
|
31
|
-
disabled:
|
|
59
|
+
disabled: disable,
|
|
32
60
|
}"
|
|
33
61
|
>
|
|
34
62
|
{{ title }}
|
|
35
|
-
<ib-icon
|
|
36
|
-
v-if="iconType"
|
|
37
|
-
:name="iconType"
|
|
38
|
-
:style="{
|
|
39
|
-
fontSize: iconSize + 'px',
|
|
40
|
-
}"
|
|
41
|
-
></ib-icon>
|
|
42
|
-
<ib-tooltip v-if="tooltipTextSorting" :text="tooltipTextSorting">
|
|
43
|
-
</ib-tooltip>
|
|
63
|
+
<ib-icon v-if="iconType" :name="iconType"></ib-icon>
|
|
44
64
|
</button>
|
|
45
65
|
</div>
|
|
46
66
|
</template>
|
|
@@ -48,18 +68,35 @@
|
|
|
48
68
|
<script>
|
|
49
69
|
import IbIcon from "../Icon.vue";
|
|
50
70
|
import IbIconButton from "../IconButton/IconButton.vue";
|
|
51
|
-
import
|
|
71
|
+
import IbToggleTip from "../ToggleTip/ToggleTip.vue";
|
|
52
72
|
import { typesSorting, typesSortingView } from "./constants.js";
|
|
53
|
-
|
|
73
|
+
import { TooltipDirective as Tooltip } from "../../directives/tooltip/tooltip";
|
|
54
74
|
export default {
|
|
55
75
|
name: "IbSorting",
|
|
56
76
|
props: {
|
|
57
|
-
|
|
77
|
+
tooltipTitle: {
|
|
78
|
+
type: String,
|
|
79
|
+
default: ''
|
|
80
|
+
},
|
|
81
|
+
hideSortingButton: {
|
|
82
|
+
type: Boolean,
|
|
83
|
+
default: false,
|
|
84
|
+
},
|
|
85
|
+
tooltipText: {
|
|
86
|
+
type: String,
|
|
87
|
+
},
|
|
88
|
+
tooltipPosition: {
|
|
89
|
+
type: String,
|
|
90
|
+
},
|
|
91
|
+
tooltipIconPosition: {
|
|
58
92
|
type: String,
|
|
59
93
|
},
|
|
60
94
|
tooltipIconSorting: {
|
|
61
95
|
type: String,
|
|
62
96
|
},
|
|
97
|
+
toggleTipTitle: {
|
|
98
|
+
type: String,
|
|
99
|
+
},
|
|
63
100
|
title: {
|
|
64
101
|
type: String,
|
|
65
102
|
default: "",
|
|
@@ -68,40 +105,49 @@ export default {
|
|
|
68
105
|
type: String,
|
|
69
106
|
default: null,
|
|
70
107
|
},
|
|
71
|
-
|
|
108
|
+
view: {
|
|
72
109
|
type: String,
|
|
73
110
|
required: true,
|
|
74
111
|
},
|
|
75
|
-
|
|
112
|
+
disable: {
|
|
76
113
|
type: Boolean,
|
|
77
114
|
default: false,
|
|
78
115
|
},
|
|
116
|
+
tableName: {
|
|
117
|
+
type: String,
|
|
118
|
+
required: true,
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
mounted() {
|
|
122
|
+
this.$globalEvents.$on(`sorting:update:${this.tableName}`, (e) => {
|
|
123
|
+
if (!this.$el.contains(e.$el)) {
|
|
124
|
+
this.currentTypeSort = null;
|
|
125
|
+
}
|
|
126
|
+
});
|
|
79
127
|
},
|
|
80
128
|
data() {
|
|
81
129
|
return {
|
|
130
|
+
isOpenToggleTip: false,
|
|
82
131
|
sortingTypes: typesSorting,
|
|
83
132
|
sortingTypesView: typesSortingView,
|
|
84
133
|
currentTypeSort: this.sort,
|
|
85
134
|
};
|
|
86
135
|
},
|
|
87
|
-
watch: {
|
|
88
|
-
currentTypeSort: function () {
|
|
89
|
-
this.updateTypeSorting();
|
|
90
|
-
},
|
|
91
|
-
},
|
|
92
136
|
methods: {
|
|
93
137
|
clickHandler() {
|
|
94
138
|
if (!this.currentTypeSort) {
|
|
95
139
|
this.currentTypeSort = this.sortingTypes.TYPE_ASC;
|
|
96
|
-
return;
|
|
97
140
|
} else if (this.currentTypeSort === this.sortingTypes.TYPE_ASC) {
|
|
98
141
|
this.currentTypeSort = this.sortingTypes.TYPE_DESC;
|
|
99
|
-
|
|
142
|
+
} else {
|
|
143
|
+
this.currentTypeSort = null;
|
|
100
144
|
}
|
|
101
|
-
|
|
145
|
+
|
|
146
|
+
this.updateTypeSorting();
|
|
102
147
|
},
|
|
103
148
|
updateTypeSorting() {
|
|
104
|
-
this.$emit(
|
|
149
|
+
this.$globalEvents.$emit(`sorting:update:${this.tableName}`, this);
|
|
150
|
+
this.$emit("update-sorting", this.currentTypeSort);
|
|
105
151
|
},
|
|
106
152
|
},
|
|
107
153
|
computed: {
|
|
@@ -110,16 +156,58 @@ export default {
|
|
|
110
156
|
return "arrow-up";
|
|
111
157
|
} else if (this.currentTypeSort === this.sortingTypes.TYPE_DESC) {
|
|
112
158
|
return "arrow-down";
|
|
113
|
-
} else if (this.
|
|
159
|
+
} else if (this.view !== this.sortingTypesView.GRID_VIEW) {
|
|
114
160
|
return "swap-vertical";
|
|
115
161
|
}
|
|
116
162
|
return null;
|
|
117
163
|
},
|
|
164
|
+
sortingTooltipPosition() {
|
|
165
|
+
if (this.hasToggleTip) {
|
|
166
|
+
return 'bottomCenter'
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
return this.tooltipPosition;
|
|
170
|
+
},
|
|
171
|
+
sortingTooltipContent() {
|
|
172
|
+
if (this.hasToggleTip) {
|
|
173
|
+
return lang('click_to_view_details', this.langComponents?.COMPONENT_SYSTEM);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
return this.tooltipContent;
|
|
177
|
+
},
|
|
178
|
+
tooltipIconText() {
|
|
179
|
+
if (this.currentTypeSort === this.sortingTypes.TYPE_ASC) {
|
|
180
|
+
return lang("sort_descending", this.langComponents?.COMPONENT_SELECT);
|
|
181
|
+
} else if (this.currentTypeSort === this.sortingTypes.TYPE_DESC) {
|
|
182
|
+
return lang("reset_sorting", this.langComponents?.COMPONENT_SELECT);
|
|
183
|
+
} else if (this.view !== this.sortingTypesView.GRID_VIEW) {
|
|
184
|
+
return lang("sort_ascending", this.langComponents?.COMPONENT_SELECT);
|
|
185
|
+
}
|
|
186
|
+
return "";
|
|
187
|
+
},
|
|
188
|
+
tooltipContent() {
|
|
189
|
+
if (this.tooltipTitle.length) {
|
|
190
|
+
return {
|
|
191
|
+
title: this.tooltipTitle,
|
|
192
|
+
text: this.tooltipText
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
return this.tooltipText;
|
|
197
|
+
},
|
|
198
|
+
hasToggleTip() {
|
|
199
|
+
return (
|
|
200
|
+
this.toggleTipTitle &&
|
|
201
|
+
this.$slots.toggleTipBody &&
|
|
202
|
+
this.$slots.toggleTipButtons
|
|
203
|
+
);
|
|
204
|
+
},
|
|
118
205
|
},
|
|
206
|
+
directives: { Tooltip },
|
|
119
207
|
components: {
|
|
120
208
|
IbIcon,
|
|
121
209
|
IbIconButton,
|
|
122
|
-
|
|
210
|
+
IbToggleTip,
|
|
123
211
|
},
|
|
124
212
|
};
|
|
125
213
|
</script>
|
|
@@ -22,10 +22,10 @@ button {
|
|
|
22
22
|
|
|
23
23
|
.sorting-label {
|
|
24
24
|
border: solid 2px transparent;
|
|
25
|
-
padding: 0
|
|
25
|
+
padding: 0 2px;
|
|
26
26
|
border-radius: 4px;
|
|
27
27
|
margin-right: 2px;
|
|
28
|
-
@include Ib-H4-
|
|
28
|
+
@include Ib-H4-medium;
|
|
29
29
|
color: $neutral-900;
|
|
30
30
|
height: 24px;
|
|
31
31
|
display: flex;
|
|
@@ -33,19 +33,22 @@ button {
|
|
|
33
33
|
transition: background-color .3s;
|
|
34
34
|
transition: color .3s;
|
|
35
35
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
36
|
+
&.has-action {
|
|
37
|
+
&:hover {
|
|
38
|
+
color: $blue-700;
|
|
39
|
+
border-color: $blue-300;
|
|
40
|
+
cursor: pointer;
|
|
41
|
+
background-color: $blue-100;
|
|
42
|
+
}
|
|
42
43
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
44
|
+
&.sorting-label-active,
|
|
45
|
+
&:active {
|
|
46
|
+
border-color: transparent;
|
|
47
|
+
color: $blue-900;
|
|
48
|
+
background-color: $blue-200;
|
|
49
|
+
transition: background-color .3s;
|
|
50
|
+
transition: color .3s;
|
|
51
|
+
}
|
|
49
52
|
}
|
|
50
53
|
|
|
51
54
|
&:focus {
|
|
@@ -11,10 +11,11 @@
|
|
|
11
11
|
|
|
12
12
|
<a
|
|
13
13
|
v-else
|
|
14
|
-
:disabled="disabled"
|
|
15
14
|
class="split-button-main"
|
|
16
15
|
:class="{ disabled }"
|
|
16
|
+
:disabled="disabled"
|
|
17
17
|
v-bind="mainButtonAttrs"
|
|
18
|
+
@click="onClickLink"
|
|
18
19
|
>
|
|
19
20
|
{{ content }}
|
|
20
21
|
</a>
|
|
@@ -110,6 +111,12 @@ export default {
|
|
|
110
111
|
this.childList[this.activeElemIdx].classList.add("active");
|
|
111
112
|
this.content = this.childList[this.activeElemIdx].textContent;
|
|
112
113
|
},
|
|
114
|
+
onClickLink(e) {
|
|
115
|
+
if (this.disabled) {
|
|
116
|
+
e.preventDefault();
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
113
120
|
},
|
|
114
121
|
computed: {
|
|
115
122
|
classes() {
|
|
@@ -111,6 +111,7 @@ $danger-split-button-active-bg: $red-900;
|
|
|
111
111
|
&:disabled {
|
|
112
112
|
background-color: $split-button-disabled-bg;
|
|
113
113
|
color: $split-button-disabled-color;
|
|
114
|
+
cursor: not-allowed;
|
|
114
115
|
}
|
|
115
116
|
}
|
|
116
117
|
}
|
|
@@ -134,6 +135,7 @@ $danger-split-button-active-bg: $red-900;
|
|
|
134
135
|
&:disabled {
|
|
135
136
|
background-color: $split-button-disabled-bg;
|
|
136
137
|
color: $split-button-disabled-color;
|
|
138
|
+
cursor: not-allowed;
|
|
137
139
|
}
|
|
138
140
|
}
|
|
139
141
|
|
|
@@ -155,6 +157,7 @@ $danger-split-button-active-bg: $red-900;
|
|
|
155
157
|
&:disabled{
|
|
156
158
|
background-color: $split-button-disabled-bg;
|
|
157
159
|
color: $split-button-disabled-color;
|
|
160
|
+
cursor: not-allowed;
|
|
158
161
|
}
|
|
159
162
|
}
|
|
160
163
|
}
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
export const icons = {
|
|
2
|
-
new: `<svg width="
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
new: `<svg width="11" height="11" viewBox="0 0 11 11" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
3
|
+
<circle id="Ellipse" cx="5.5" cy="5.5" r="5" fill="#0369E8"/>
|
|
4
|
+
</svg>
|
|
5
5
|
`,
|
|
6
6
|
|
|
7
7
|
success: `
|
|
8
|
-
<svg width="
|
|
9
|
-
<circle cx="
|
|
10
|
-
</svg>
|
|
8
|
+
<svg width="11" height="11" viewBox="0 0 11 11" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
9
|
+
<circle id="Ellipse" cx="5.5" cy="5.5" r="5" fill="#0D7F39"/>
|
|
10
|
+
</svg>
|
|
11
11
|
`,
|
|
12
12
|
|
|
13
13
|
error: `
|
|
14
|
-
<svg width="
|
|
15
|
-
<path fill-rule="evenodd" clip-rule="evenodd" d="
|
|
14
|
+
<svg width="10" height="11" viewBox="0 0 10 11" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
15
|
+
<path id="Subtract" fill-rule="evenodd" clip-rule="evenodd" d="M9.1336 8.31393C9.68034 7.51234 10 6.5435 10 5.5C10 2.73858 7.76142 0.5 5 0.5C3.9565 0.5 2.98766 0.819661 2.18607 1.3664L9.1336 8.31393ZM0.866401 2.68607C0.319661 3.48766 0 4.4565 0 5.5C0 8.26142 2.23858 10.5 5 10.5C6.0435 10.5 7.01234 10.1803 7.81393 9.6336L0.866401 2.68607Z" fill="#C8182E"/>
|
|
16
16
|
</svg>
|
|
17
17
|
`,
|
|
18
18
|
|
|
19
19
|
warning: `
|
|
20
|
-
<svg width="
|
|
21
|
-
<path d="
|
|
22
|
-
</svg>
|
|
20
|
+
<svg width="12" height="11" viewBox="0 0 12 11" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
21
|
+
<path d="M6 0.5L12 10.5H0L6 0.5Z" fill="#F1BC19"/>
|
|
22
|
+
</svg>
|
|
23
23
|
`,
|
|
24
24
|
|
|
25
25
|
incomplete: `
|
|
@@ -36,14 +36,34 @@ import IbTabDropdown from "./TabDropdown.vue";
|
|
|
36
36
|
import getHrefFromId from "../../helpers/getHrefFromID";
|
|
37
37
|
export default {
|
|
38
38
|
name: "IbTabs",
|
|
39
|
+
props: {
|
|
40
|
+
selectedTabId: {
|
|
41
|
+
type: String,
|
|
42
|
+
default: "",
|
|
43
|
+
},
|
|
44
|
+
},
|
|
39
45
|
data() {
|
|
40
46
|
return {
|
|
41
47
|
tabs: [],
|
|
42
|
-
selectedTab:
|
|
48
|
+
selectedTab: this.selectTabId,
|
|
43
49
|
};
|
|
44
50
|
},
|
|
51
|
+
watch: {
|
|
52
|
+
selectedTabId(newId) {
|
|
53
|
+
this.selectTab(newId);
|
|
54
|
+
}
|
|
55
|
+
},
|
|
45
56
|
created() {
|
|
46
|
-
|
|
57
|
+
const slotItems = [];
|
|
58
|
+
this.$slots.default().forEach(item => {
|
|
59
|
+
if (item.type === Symbol.for('v-fgt')) {
|
|
60
|
+
return slotItems.push(...item.children);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
return slotItems.push(item);
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
slotItems.forEach((item) => {
|
|
47
67
|
if (!item.props.name) {
|
|
48
68
|
this.tabs.push(item.props);
|
|
49
69
|
} else {
|
|
@@ -75,18 +95,21 @@ export default {
|
|
|
75
95
|
}
|
|
76
96
|
}
|
|
77
97
|
}
|
|
98
|
+
|
|
78
99
|
},
|
|
79
100
|
methods: {
|
|
80
101
|
createHref(id) {
|
|
81
102
|
return getHrefFromId(id);
|
|
82
103
|
},
|
|
83
104
|
selectTab(id) {
|
|
105
|
+
this.$emit('changeTab', id);
|
|
84
106
|
this.selectedTab = id;
|
|
85
107
|
},
|
|
86
108
|
},
|
|
87
109
|
components: {
|
|
88
110
|
IbTabDropdown,
|
|
89
111
|
},
|
|
112
|
+
emits: ["changeTab"]
|
|
90
113
|
};
|
|
91
114
|
</script>
|
|
92
115
|
<style lang="scss" scoped>
|
|
@@ -5,8 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
$background: $white;
|
|
7
7
|
$textColor: $neutral-900;
|
|
8
|
-
$shadow: $ib-shadow-
|
|
9
|
-
|
|
8
|
+
$shadow: $ib-shadow-3;
|
|
10
9
|
|
|
11
10
|
.ib-toggle-tip {
|
|
12
11
|
position: absolute;
|
|
@@ -20,6 +19,7 @@ $shadow: $ib-shadow-4;
|
|
|
20
19
|
bottom: auto;
|
|
21
20
|
left: auto;
|
|
22
21
|
right: auto;
|
|
22
|
+
z-index: 100;
|
|
23
23
|
@include TooltipPosition;
|
|
24
24
|
|
|
25
25
|
&-head {
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<ib-popover
|
|
2
|
+
<ib-popover
|
|
3
|
+
:position="position"
|
|
4
|
+
:always-visible="alwaysVisible"
|
|
5
|
+
:class="classList"
|
|
6
|
+
>
|
|
3
7
|
<b v-if="title">{{ title }}</b>
|
|
4
8
|
<p>{{ text }}</p>
|
|
5
9
|
</ib-popover>
|
|
@@ -20,6 +24,21 @@ export default {
|
|
|
20
24
|
text: {
|
|
21
25
|
type: String,
|
|
22
26
|
},
|
|
27
|
+
alwaysVisible: {
|
|
28
|
+
type: Boolean,
|
|
29
|
+
default: false,
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
computed: {
|
|
33
|
+
classList() {
|
|
34
|
+
const classList = ["ib-tooltip"];
|
|
35
|
+
|
|
36
|
+
if (this.title) {
|
|
37
|
+
classList.push("ib-tooltip-large");
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return classList;
|
|
41
|
+
},
|
|
23
42
|
},
|
|
24
43
|
components: { IbPopover },
|
|
25
44
|
};
|
|
@@ -27,15 +46,17 @@ export default {
|
|
|
27
46
|
|
|
28
47
|
<style lang="scss" scoped>
|
|
29
48
|
@import "../../assets/scss/typography.scss";
|
|
49
|
+
@import "../../assets/scss/variables/shadows.scss";
|
|
30
50
|
@import "../../assets/scss/mixins.scss";
|
|
31
51
|
|
|
32
52
|
.ib-tooltip {
|
|
33
53
|
padding: 10px;
|
|
34
54
|
max-width: 240px;
|
|
55
|
+
box-shadow: $ib-shadow-1;
|
|
56
|
+
z-index: 10002;
|
|
35
57
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
@include lineClamp;
|
|
58
|
+
&.ib-tooltip-large {
|
|
59
|
+
box-shadow: $ib-shadow-2;
|
|
39
60
|
}
|
|
40
61
|
|
|
41
62
|
b {
|
|
@@ -43,7 +64,102 @@ export default {
|
|
|
43
64
|
}
|
|
44
65
|
|
|
45
66
|
p {
|
|
67
|
+
word-break: break-word;
|
|
46
68
|
@include Ib-H4-regular;
|
|
47
69
|
}
|
|
70
|
+
|
|
71
|
+
&::before {
|
|
72
|
+
content: "";
|
|
73
|
+
width: 0;
|
|
74
|
+
height: 0;
|
|
75
|
+
border-style: solid;
|
|
76
|
+
border-width: 4px 4px 0 4px;
|
|
77
|
+
border-color: #fff transparent transparent transparent;
|
|
78
|
+
position: absolute;
|
|
79
|
+
transform: none !important;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
&.top-left {
|
|
83
|
+
&::before {
|
|
84
|
+
bottom: -4px;
|
|
85
|
+
right: 10px;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
&.top-center {
|
|
89
|
+
&::before {
|
|
90
|
+
bottom: -4px;
|
|
91
|
+
right: 50%;
|
|
92
|
+
transform: translateX(50%) !important;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
&.top-right {
|
|
96
|
+
&::before {
|
|
97
|
+
bottom: -4px;
|
|
98
|
+
left: 10px;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
&.right-top {
|
|
102
|
+
&::before {
|
|
103
|
+
left: -6px;
|
|
104
|
+
bottom: 10px;
|
|
105
|
+
transform: rotate(90deg) !important;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
&.right-center {
|
|
109
|
+
&::before {
|
|
110
|
+
left: -8px;
|
|
111
|
+
top: 50%;
|
|
112
|
+
transform: rotate(90deg) translateY(-50%) !important;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
&.right-bottom {
|
|
116
|
+
&::before {
|
|
117
|
+
top: 10px;
|
|
118
|
+
left: -6px;
|
|
119
|
+
transform: rotate(90deg) !important;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
&.bottom-left {
|
|
123
|
+
&::before {
|
|
124
|
+
top: -4px;
|
|
125
|
+
right: 10px;
|
|
126
|
+
transform: rotate(180deg) !important;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
&.bottom-center {
|
|
130
|
+
&::before {
|
|
131
|
+
top: -4px;
|
|
132
|
+
right: 50%;
|
|
133
|
+
transform: rotate(180deg) translateX(-50%) !important;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
&.bottom-right {
|
|
137
|
+
&::before {
|
|
138
|
+
top: -4px;
|
|
139
|
+
left: 10px;
|
|
140
|
+
transform: rotate(180deg) !important;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
&.left-top {
|
|
144
|
+
&::before {
|
|
145
|
+
right: -6px;
|
|
146
|
+
bottom: 10px;
|
|
147
|
+
transform: rotate(-90deg) !important;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
&.left-center {
|
|
151
|
+
&::before {
|
|
152
|
+
right: -8px;
|
|
153
|
+
top: 50%;
|
|
154
|
+
transform: rotate(-90deg) translateY(-50%) !important;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
&.left-bottom {
|
|
158
|
+
&::before {
|
|
159
|
+
top: 10px;
|
|
160
|
+
right: -6px;
|
|
161
|
+
transform: rotate(-90deg) !important;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
48
164
|
}
|
|
49
165
|
</style>
|