@avakhula/ui 0.0.10
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 +14 -0
- package/.eslintrc.cjs +15 -0
- package/.nvmrc +1 -0
- package/.prettierrc.json +1 -0
- package/.storybook/intelliboardTheme.js +10 -0
- package/.storybook/main.js +25 -0
- package/.storybook/manager.js +7 -0
- package/.storybook/preview-head.html +11 -0
- package/.storybook/preview.js +24 -0
- package/.storybook/scss-loader.scss +6 -0
- package/.storybook/withSource.js +97 -0
- package/README.md +35 -0
- package/dist/favicon.ico +0 -0
- package/dist/index.mjs +19366 -0
- package/dist/index.umd.js +209 -0
- package/dist/style.css +1 -0
- package/index.html +21 -0
- package/package.json +63 -0
- package/public/favicon.ico +0 -0
- package/src/App.vue +37 -0
- package/src/EventEmmiter.js +19 -0
- package/src/assets/scss/mixins/dropdown-list-item.scss +45 -0
- package/src/assets/scss/mixins/tooltip-position.scss +147 -0
- package/src/assets/scss/mixins.scss +21 -0
- package/src/assets/scss/reset.scss +12 -0
- package/src/assets/scss/style.scss +73 -0
- package/src/assets/scss/typography.scss +155 -0
- package/src/assets/scss/variables/colors.scss +115 -0
- package/src/assets/scss/variables/shadows.scss +17 -0
- package/src/components/Accordion/Accordion.scss +94 -0
- package/src/components/Accordion/Accordion.stories.js +41 -0
- package/src/components/Accordion/Accordion.vue +104 -0
- package/src/components/Accordion/readme.mdx +38 -0
- package/src/components/Alert/Alert.stories.js +69 -0
- package/src/components/Alert/Alert.vue +131 -0
- package/src/components/Alert/alert.scss +166 -0
- package/src/components/Alert/constants.js +6 -0
- package/src/components/Alert/readme.mdx +63 -0
- package/src/components/Badge/Badge.stories.js +53 -0
- package/src/components/Badge/Badge.vue +58 -0
- package/src/components/Badge/readme.mdx +38 -0
- package/src/components/Breadcrumbs/Breadcrumbs.vue +98 -0
- package/src/components/Breadcrumbs/breadcrumbs.scss +77 -0
- package/src/components/Breadcrumbs/breadcrumbs.stories.js +37 -0
- package/src/components/Button/Button.stories.js +124 -0
- package/src/components/Button/Button.vue +165 -0
- package/src/components/Button/button.scss +217 -0
- package/src/components/Button/constants.js +8 -0
- package/src/components/Button/readme.mdx +118 -0
- package/src/components/ButtonGroup/ButtonGroup.stories.js +27 -0
- package/src/components/ButtonGroup/ButtonGroup.vue +24 -0
- package/src/components/ButtonGroup/readme.mdx +10 -0
- package/src/components/Dropdown/Dropdown.spec.js +90 -0
- package/src/components/Dropdown/Dropdown.stories.js +48 -0
- package/src/components/Dropdown/Dropdown.vue +313 -0
- package/src/components/Dropdown/DropdownDivider.vue +15 -0
- package/src/components/Dropdown/DropdownItem.vue +59 -0
- package/src/components/Dropdown/DropdownList.stories.js +174 -0
- package/src/components/Dropdown/DropdownList.vue +93 -0
- package/src/components/Dropdown/constants.js +10 -0
- package/src/components/Dropdown/readme.mdx +88 -0
- package/src/components/Form/CharactersCount.vue +55 -0
- package/src/components/Form/Checkbox/Checkbox.scss +226 -0
- package/src/components/Form/Checkbox/Checkbox.stories.js +63 -0
- package/src/components/Form/Checkbox/Checkbox.vue +128 -0
- package/src/components/Form/Checkbox/readme.mdx +69 -0
- package/src/components/Form/CheckboxGroup/CheckboxGroup.stories.js +64 -0
- package/src/components/Form/CheckboxGroup/CheckboxGroup.vue +87 -0
- package/src/components/Form/CheckboxGroup/readme.mdx +56 -0
- package/src/components/Form/DatePicker/DatePicker.scss +479 -0
- package/src/components/Form/DatePicker/DatePicker.stories.js +78 -0
- package/src/components/Form/DatePicker/DatePicker.vue +284 -0
- package/src/components/Form/DatePicker/Icons/chevron-back.js +5 -0
- package/src/components/Form/DatePicker/Icons/chevron-forward.js +5 -0
- package/src/components/Form/DatePicker/readme.mdx +115 -0
- package/src/components/Form/FormGroup/FormGroup.stories.js +48 -0
- package/src/components/Form/FormGroup/FormGroup.vue +61 -0
- package/src/components/Form/FormGroup/FormGroupSet.stories.js +32 -0
- package/src/components/Form/FormGroup/FormGroupSet.vue +75 -0
- package/src/components/Form/Input/Input.stories.js +137 -0
- package/src/components/Form/Input/Input.vue +231 -0
- package/src/components/Form/Input/constants.js +5 -0
- package/src/components/Form/Input/input.scss +133 -0
- package/src/components/Form/Input/readme.mdx +68 -0
- package/src/components/Form/Label/Label.stories.js +29 -0
- package/src/components/Form/Label/Label.vue +87 -0
- package/src/components/Form/Label/readme.mdx +25 -0
- package/src/components/Form/PhoneInput/PhoneInput.stories.js +43 -0
- package/src/components/Form/PhoneInput/PhoneInput.vue +105 -0
- package/src/components/Form/PhoneInput/phoneInput.scss +197 -0
- package/src/components/Form/PhoneInput/readme.mdx +37 -0
- package/src/components/Form/Radio/Radio.stories.js +34 -0
- package/src/components/Form/Radio/Radio.vue +109 -0
- package/src/components/Form/Radio/radio.scss +187 -0
- package/src/components/Form/Radio/readme.mdx +48 -0
- package/src/components/Form/TextEditor/TextEditor.stories.js +58 -0
- package/src/components/Form/TextEditor/TextEditor.vue +305 -0
- package/src/components/Form/TextEditor/icons/svg/chevron-down.svg +3 -0
- package/src/components/Form/TextEditor/icons/toolbarIcons.js +111 -0
- package/src/components/Form/TextEditor/plugins/alphabetList.js +43 -0
- package/src/components/Form/TextEditor/readme.mdx +59 -0
- package/src/components/Form/TextEditor/textEditor.scss +684 -0
- package/src/components/Form/Textarea/Textarea.spec.js +107 -0
- package/src/components/Form/Textarea/Textarea.stories.js +68 -0
- package/src/components/Form/Textarea/Textarea.vue +102 -0
- package/src/components/Form/Textarea/readme.mdx +45 -0
- package/src/components/Form/Textarea/textarea.scss +84 -0
- package/src/components/Form/Toggle/Toggle.stories.js +44 -0
- package/src/components/Form/Toggle/Toggle.vue +122 -0
- package/src/components/Form/Toggle/readme.mdx +39 -0
- package/src/components/Form/Toggle/toggle.scss +166 -0
- package/src/components/Icon.vue +41 -0
- package/src/components/IconButton/IconButton.scss +91 -0
- package/src/components/IconButton/IconButton.stories.js +115 -0
- package/src/components/IconButton/IconButton.vue +100 -0
- package/src/components/IconButton/constants.js +14 -0
- package/src/components/IconButton/readme.mdx +66 -0
- package/src/components/List.vue +150 -0
- package/src/components/Modal/Modal.stories.js +48 -0
- package/src/components/Modal/Modal.vue +231 -0
- package/src/components/Modal/readme.mdx +76 -0
- package/src/components/Pagination/LimitSelector.vue +73 -0
- package/src/components/Pagination/Pagination.stories.js +54 -0
- package/src/components/Pagination/Pagination.vue +227 -0
- package/src/components/Pagination/pagination.scss +189 -0
- package/src/components/Popover/Popover.stories.js +46 -0
- package/src/components/Popover/Popover.vue +81 -0
- package/src/components/Popover/constants.js +14 -0
- package/src/components/Popover/popover.scss +26 -0
- package/src/components/Popover/readme.mdx +42 -0
- package/src/components/ProgressBar/ProgressBar.stories.js +90 -0
- package/src/components/ProgressBar/ProgressBar.vue +58 -0
- package/src/components/ProgressBar/constants.js +6 -0
- package/src/components/ProgressBar/progressBar.scss +116 -0
- package/src/components/ProgressBar/readme.mdx +67 -0
- package/src/components/Sorting/Sorting.stories.js +35 -0
- package/src/components/Sorting/Sorting.vue +128 -0
- package/src/components/Sorting/constants.js +10 -0
- package/src/components/Sorting/sorting.scss +87 -0
- package/src/components/SplitButton/SplitButton.stories.js +39 -0
- package/src/components/SplitButton/SplitButton.vue +132 -0
- package/src/components/SplitButton/SplitButtonItem.vue +34 -0
- package/src/components/SplitButton/constants.js +4 -0
- package/src/components/SplitButton/readme.mdx +77 -0
- package/src/components/SplitButton/splitButton.scss +161 -0
- package/src/components/StatusIndicator/StatusIndicator.stories.js +40 -0
- package/src/components/StatusIndicator/StatusIndicator.vue +52 -0
- package/src/components/StatusIndicator/constants.js +10 -0
- package/src/components/StatusIndicator/icons.js +48 -0
- package/src/components/StatusIndicator/readme.mdx +21 -0
- package/src/components/Table/Cells/Cell.vue +71 -0
- package/src/components/Table/Cells/CheckboxCell.vue +48 -0
- package/src/components/Table/Row.vue +26 -0
- package/src/components/Table/Table.stories.js +59 -0
- package/src/components/Table/Table.vue +36 -0
- package/src/components/Tabs/Tab.vue +37 -0
- package/src/components/Tabs/TabDropdown.vue +93 -0
- package/src/components/Tabs/Tabs.stories.js +57 -0
- package/src/components/Tabs/Tabs.vue +94 -0
- package/src/components/Tabs/tabs.scss +157 -0
- package/src/components/TagPill/TagPill.stories.js +30 -0
- package/src/components/TagPill/TagPill.vue +133 -0
- package/src/components/TagPill/constants.js +9 -0
- package/src/components/TagPill/readme.mdx +37 -0
- package/src/components/ToggleTip/ToggleTip.stories.js +98 -0
- package/src/components/ToggleTip/ToggleTip.vue +112 -0
- package/src/components/ToggleTip/constants.js +14 -0
- package/src/components/ToggleTip/readme.mdx +46 -0
- package/src/components/ToggleTip/toggleTip.scss +55 -0
- package/src/components/Tooltip/Tooltip.stories.js +56 -0
- package/src/components/Tooltip/Tooltip.vue +49 -0
- package/src/components/Tooltip/readme.mdx +43 -0
- package/src/components/TreeSelect/Option.vue +325 -0
- package/src/components/TreeSelect/Select.stories.js +349 -0
- package/src/components/TreeSelect/Select.vue +909 -0
- package/src/components/TreeSelect/TreeSelect.stories.js +270 -0
- package/src/components/TreeSelect/scss/option.scss +204 -0
- package/src/components/TreeSelect/scss/select.scss +166 -0
- package/src/constants/events.js +2 -0
- package/src/constants/keyCodes.js +8 -0
- package/src/directives/outside/outside.js +81 -0
- package/src/directives/outside/outside.stories.js +29 -0
- package/src/directives/outside/readme.mdx +24 -0
- package/src/helpers/generateUID.js +3 -0
- package/src/helpers/getHrefFromID.js +3 -0
- package/src/helpers/multiLineOverflows.js +3 -0
- package/src/helpers/removeEvents.js +9 -0
- package/src/index.js +49 -0
- package/src/main.js +12 -0
- package/src/stories/link.readme.mdx +57 -0
- package/src/stories/link.stories.js +59 -0
- package/static/Logo.svg +25 -0
- package/static/docks/button.pdf +147566 -0
- package/vite.config.js +47 -0
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="report-controls">
|
|
3
|
+
<ib-limit-selector
|
|
4
|
+
@select="changeLimit"
|
|
5
|
+
:value="limitValue"
|
|
6
|
+
:label-select="labelSelect"
|
|
7
|
+
></ib-limit-selector>
|
|
8
|
+
|
|
9
|
+
<div class="repot-pagination">
|
|
10
|
+
<ib-label>{{ labelInput }}</ib-label>
|
|
11
|
+
<div class="pagination-input">
|
|
12
|
+
<ib-input type="number" :debounce="500" @input="onInput"></ib-input>
|
|
13
|
+
</div>
|
|
14
|
+
<div class="row-count">
|
|
15
|
+
{{ setCountOfRows + " of " + countRows }}
|
|
16
|
+
</div>
|
|
17
|
+
<ib-icon-button
|
|
18
|
+
kind="tertiary"
|
|
19
|
+
size="m"
|
|
20
|
+
class="toggle-children button-prev"
|
|
21
|
+
:disabled="currentPage === 1"
|
|
22
|
+
@click="onSelect(currentPage - 1)"
|
|
23
|
+
>
|
|
24
|
+
<ib-icon name="chevron-back-outline"></ib-icon>
|
|
25
|
+
<ib-tooltip v-if="tooltipTextPrev" :text="tooltipTextPrev"></ib-tooltip>
|
|
26
|
+
</ib-icon-button>
|
|
27
|
+
|
|
28
|
+
<ul class="pagination-wrapper">
|
|
29
|
+
<li
|
|
30
|
+
v-for="(item, index) of countPagePagination"
|
|
31
|
+
v-show="showItem(index + 1)"
|
|
32
|
+
:key="index"
|
|
33
|
+
class="pagination-item"
|
|
34
|
+
:class="{
|
|
35
|
+
active: index + 1 === currentPage,
|
|
36
|
+
'dots-left': indexSpaceLeft === index + 1,
|
|
37
|
+
'dots-right': indexSpaceRight === index + 1,
|
|
38
|
+
}"
|
|
39
|
+
@click="onSelect(index + 1)"
|
|
40
|
+
>
|
|
41
|
+
<button>
|
|
42
|
+
{{ index + 1 }}
|
|
43
|
+
</button>
|
|
44
|
+
</li>
|
|
45
|
+
</ul>
|
|
46
|
+
|
|
47
|
+
<ib-icon-button
|
|
48
|
+
kind="tertiary"
|
|
49
|
+
size="m"
|
|
50
|
+
class="toggle-children button-next"
|
|
51
|
+
:disabled="currentPage === countPagePagination"
|
|
52
|
+
@click="onSelect(currentPage + 1)"
|
|
53
|
+
>
|
|
54
|
+
<ib-icon name="chevron-forward-outline"></ib-icon>
|
|
55
|
+
<ib-tooltip v-if="tooltipTextNext" :text="tooltipTextNext"></ib-tooltip>
|
|
56
|
+
</ib-icon-button>
|
|
57
|
+
</div>
|
|
58
|
+
</div>
|
|
59
|
+
</template>
|
|
60
|
+
|
|
61
|
+
<script>
|
|
62
|
+
import IbLimitSelector from "./LimitSelector.vue";
|
|
63
|
+
import IbIconButton from "../IconButton/IconButton.vue";
|
|
64
|
+
import IbInput from "../Form/Input/Input.vue";
|
|
65
|
+
import IbLabel from "../Form/Label/Label.vue";
|
|
66
|
+
import IbIcon from "../Icon.vue";
|
|
67
|
+
import IbTooltip from "../Tooltip/Tooltip.vue";
|
|
68
|
+
export default {
|
|
69
|
+
name: "IbPagination",
|
|
70
|
+
props: {
|
|
71
|
+
tooltipTextPrev: {
|
|
72
|
+
type: String,
|
|
73
|
+
},
|
|
74
|
+
tooltipTextNext: {
|
|
75
|
+
type: String,
|
|
76
|
+
},
|
|
77
|
+
labelInput: {
|
|
78
|
+
type: String,
|
|
79
|
+
required: true,
|
|
80
|
+
},
|
|
81
|
+
labelSelect: {
|
|
82
|
+
type: String,
|
|
83
|
+
required: true,
|
|
84
|
+
},
|
|
85
|
+
countRows: {
|
|
86
|
+
type: Number,
|
|
87
|
+
required: true,
|
|
88
|
+
},
|
|
89
|
+
pageCount: {
|
|
90
|
+
type: Number,
|
|
91
|
+
default: null,
|
|
92
|
+
},
|
|
93
|
+
current: {
|
|
94
|
+
type: Number,
|
|
95
|
+
default: 1,
|
|
96
|
+
},
|
|
97
|
+
limitSelector: {
|
|
98
|
+
type: Number,
|
|
99
|
+
default: 10,
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
data() {
|
|
103
|
+
return {
|
|
104
|
+
currentPage: this.current,
|
|
105
|
+
indexSpaceLeft: null,
|
|
106
|
+
indexSpaceRight: null,
|
|
107
|
+
limitValue: this.limitSelector,
|
|
108
|
+
};
|
|
109
|
+
},
|
|
110
|
+
watch: {
|
|
111
|
+
current(newVal) {
|
|
112
|
+
this.currentPage = newVal;
|
|
113
|
+
},
|
|
114
|
+
currentPage(newVal) {
|
|
115
|
+
this.onSelect(newVal);
|
|
116
|
+
},
|
|
117
|
+
limitValue() {
|
|
118
|
+
this.currentPage = 1;
|
|
119
|
+
this.onSelect(this.currentPage);
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
methods: {
|
|
123
|
+
changeLimit(val) {
|
|
124
|
+
if (Number.isInteger(val)) {
|
|
125
|
+
this.limitValue = val;
|
|
126
|
+
this.$emit("set-limit", val);
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
onInput(val) {
|
|
130
|
+
if (val && val <= this.countPagePagination) {
|
|
131
|
+
this.currentPage = Number(val);
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
onSelect(page) {
|
|
135
|
+
if (Number.isInteger(page)) {
|
|
136
|
+
this.currentPage = page;
|
|
137
|
+
this.$emit("select", page);
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
showItem(index) {
|
|
141
|
+
if (this.countPagePagination <= 5) {
|
|
142
|
+
this.indexSpaceLeft = null;
|
|
143
|
+
this.indexSpaceRight = null;
|
|
144
|
+
return true;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
if (index === 1) {
|
|
148
|
+
return true;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
if (index === this.countPagePagination) {
|
|
152
|
+
return true;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
if (this.countPagePagination >= 7) {
|
|
156
|
+
if (this.currentPage <= 3 && index <= 5 ) {
|
|
157
|
+
this.indexSpaceLeft = this.countPagePagination;
|
|
158
|
+
this.indexSpaceRight = null;
|
|
159
|
+
return true;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
if (
|
|
163
|
+
this.currentPage >= this.countPagePagination - 2 &&
|
|
164
|
+
index >= this.countPagePagination - 4
|
|
165
|
+
) {
|
|
166
|
+
this.indexSpaceLeft = null;
|
|
167
|
+
this.indexSpaceRight = 1;
|
|
168
|
+
return true;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
if (
|
|
172
|
+
3 < this.currentPage < this.countPagePagination - 3 &&
|
|
173
|
+
(index === this.currentPage + 1 ||
|
|
174
|
+
index === this.currentPage - 1 ||
|
|
175
|
+
index === this.currentPage)
|
|
176
|
+
) {
|
|
177
|
+
this.indexSpaceLeft = this.countPagePagination;
|
|
178
|
+
this.indexSpaceRight = 1;
|
|
179
|
+
|
|
180
|
+
return true;
|
|
181
|
+
}
|
|
182
|
+
} else {
|
|
183
|
+
return true;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
return false;
|
|
187
|
+
},
|
|
188
|
+
},
|
|
189
|
+
computed: {
|
|
190
|
+
setCountOfRows() {
|
|
191
|
+
if (this.currentPage === 1 || this.countPagePagination === 1) {
|
|
192
|
+
return (
|
|
193
|
+
"1 - " +
|
|
194
|
+
(this.countPagePagination > 1 ? this.limitValue : this.countRows)
|
|
195
|
+
);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
if (this.countPagePagination === this.currentPage) {
|
|
199
|
+
return (
|
|
200
|
+
(this.currentPage - 1) * this.limitValue + " - " + this.countRows
|
|
201
|
+
);
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
return (
|
|
205
|
+
(this.currentPage - 1) * this.limitValue +
|
|
206
|
+
1 +
|
|
207
|
+
" - " +
|
|
208
|
+
this.currentPage * this.limitValue
|
|
209
|
+
);
|
|
210
|
+
},
|
|
211
|
+
countPagePagination() {
|
|
212
|
+
return Math.ceil(this.countRows / this.limitValue);
|
|
213
|
+
},
|
|
214
|
+
},
|
|
215
|
+
components: {
|
|
216
|
+
IbIconButton,
|
|
217
|
+
IbIcon,
|
|
218
|
+
IbInput,
|
|
219
|
+
IbLabel,
|
|
220
|
+
IbLimitSelector,
|
|
221
|
+
IbTooltip,
|
|
222
|
+
},
|
|
223
|
+
};
|
|
224
|
+
</script>
|
|
225
|
+
<style lang="scss">
|
|
226
|
+
@import "./pagination.scss";
|
|
227
|
+
</style>
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
@import "../../assets/scss/variables/colors.scss";
|
|
2
|
+
@import "../../assets/scss/typography.scss";
|
|
3
|
+
@import "../../assets/scss/mixins.scss";
|
|
4
|
+
|
|
5
|
+
.report-limit-selector {
|
|
6
|
+
display: flex;
|
|
7
|
+
align-items: center;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.report-limit-selector {
|
|
11
|
+
|
|
12
|
+
label {
|
|
13
|
+
margin-bottom: 0;
|
|
14
|
+
margin-right: 5px;
|
|
15
|
+
@include Ib-H4-regular;
|
|
16
|
+
color: $neutral-900;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.dropdown-list-wrapper {
|
|
20
|
+
display: flex;
|
|
21
|
+
&:hover input {
|
|
22
|
+
cursor: pointer;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.report-controls {
|
|
28
|
+
display: flex;
|
|
29
|
+
justify-content: space-between;
|
|
30
|
+
align-items: center;
|
|
31
|
+
|
|
32
|
+
.row-count {
|
|
33
|
+
margin-right: 10px;
|
|
34
|
+
@include Ib-H4-regular;
|
|
35
|
+
color: $gray-600;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.repot-pagination {
|
|
39
|
+
display: flex;
|
|
40
|
+
align-items: center;
|
|
41
|
+
|
|
42
|
+
.ib-label {
|
|
43
|
+
margin-right: 5px;
|
|
44
|
+
white-space: nowrap;
|
|
45
|
+
margin-bottom: 0;
|
|
46
|
+
@include Ib-H4-regular;
|
|
47
|
+
color: $neutral-900;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.pagination-input{
|
|
51
|
+
width: 64px;
|
|
52
|
+
margin-right: 10px;
|
|
53
|
+
|
|
54
|
+
/* Chrome, Safari, Edge, Opera */
|
|
55
|
+
input::-webkit-outer-spin-button,
|
|
56
|
+
input::-webkit-inner-spin-button {
|
|
57
|
+
-webkit-appearance: none;
|
|
58
|
+
margin: 0;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/* Firefox */
|
|
62
|
+
input[type=number] {
|
|
63
|
+
-moz-appearance: textfield;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.button-prev {
|
|
69
|
+
margin-right: 5px;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.button-next {
|
|
73
|
+
margin-left: 5px;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.ib-icon-button.ib-btn-disabled.ib-icon-btn-tertiary:hover {
|
|
77
|
+
cursor: not-allowed;
|
|
78
|
+
border-color: transparent;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.ib-icon-button.ib-btn-disabled.ib-icon-btn-tertiary:active {
|
|
82
|
+
background-color: $gray-100;
|
|
83
|
+
color: $neutral-500;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.icon-button-wrapper.button-next,
|
|
87
|
+
.icon-button-wrapper.button-prev {
|
|
88
|
+
&.disabled {
|
|
89
|
+
pointer-events: none;
|
|
90
|
+
|
|
91
|
+
button {
|
|
92
|
+
color: $neutral-500;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
.pagination-wrapper {
|
|
99
|
+
display: flex;
|
|
100
|
+
padding-left: 0;
|
|
101
|
+
margin: 0;
|
|
102
|
+
position: relative;
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
.pagination-item {
|
|
107
|
+
list-style: none;
|
|
108
|
+
@include Ib-H4-medium;
|
|
109
|
+
margin: 0 5px;
|
|
110
|
+
height: 36px;
|
|
111
|
+
width: 36px;
|
|
112
|
+
background: $gray-100;
|
|
113
|
+
border-radius: 4px;
|
|
114
|
+
@include Ib-H4-medium;
|
|
115
|
+
color: $neutral-900;
|
|
116
|
+
|
|
117
|
+
&.dots-left {
|
|
118
|
+
position: relative;
|
|
119
|
+
margin-left: 29px;
|
|
120
|
+
|
|
121
|
+
&::before {
|
|
122
|
+
content: '...';
|
|
123
|
+
position: absolute;
|
|
124
|
+
bottom: 0;
|
|
125
|
+
@include Ib-H4-medium;
|
|
126
|
+
color: $neutral-900;
|
|
127
|
+
left: -17px;
|
|
128
|
+
transform: translateX(-50%);
|
|
129
|
+
width: 14px;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
&.dots-right {
|
|
135
|
+
position: relative;
|
|
136
|
+
margin-right: 29px;
|
|
137
|
+
|
|
138
|
+
&::after {
|
|
139
|
+
content: '...';
|
|
140
|
+
position: absolute;
|
|
141
|
+
right: -17px;
|
|
142
|
+
bottom: 0;
|
|
143
|
+
@include Ib-H4-medium;
|
|
144
|
+
color: $neutral-900;
|
|
145
|
+
transform: translateX(50%);
|
|
146
|
+
width: 14px;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
&.active button {
|
|
152
|
+
color: $blue-800;
|
|
153
|
+
background-color: $blue-200;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
button {
|
|
157
|
+
height: inherit;
|
|
158
|
+
width: inherit;
|
|
159
|
+
border: none;
|
|
160
|
+
background: $gray-100;
|
|
161
|
+
border-radius: 4px;
|
|
162
|
+
border: 2px solid transparent;
|
|
163
|
+
transition: border 0.3s;
|
|
164
|
+
color: $neutral-900;
|
|
165
|
+
@include Ib-H4-regular;
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
&:hover {
|
|
169
|
+
border-color: $blue-300;
|
|
170
|
+
cursor: pointer;
|
|
171
|
+
color: $blue-700;
|
|
172
|
+
background: $blue-100;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
&:active {
|
|
176
|
+
border-color: transparent;
|
|
177
|
+
color: $blue-900;
|
|
178
|
+
background-color: $blue-200;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
&:focus {
|
|
182
|
+
@include focus(2px);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import IbPopover from "./Popover.vue";
|
|
2
|
+
import IbButton from "../Button/Button.vue";
|
|
3
|
+
import IbTagPill from "../TagPill/TagPill.vue";
|
|
4
|
+
import { popoverPosition } from "./constants";
|
|
5
|
+
import readme from "./readme.mdx";
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
title: "Popover",
|
|
9
|
+
component: IbPopover,
|
|
10
|
+
argTypes: {
|
|
11
|
+
position: {
|
|
12
|
+
control: { type: "select" },
|
|
13
|
+
options: Object.values(popoverPosition),
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
parameters: {
|
|
17
|
+
docs: {
|
|
18
|
+
page: readme,
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const Template = (args) => ({
|
|
24
|
+
components: { IbPopover, IbButton, IbTagPill },
|
|
25
|
+
setup() {
|
|
26
|
+
return { args };
|
|
27
|
+
},
|
|
28
|
+
template: `
|
|
29
|
+
<ib-button>
|
|
30
|
+
Test
|
|
31
|
+
<ib-popover v-bind="args">
|
|
32
|
+
<p class="ib-H4-medium" style="margin-bottom: 7px;">Learner success and progress. Title in two lines</p>
|
|
33
|
+
<ib-tag-pill style="margin-bottom: 5px;">Assignments</ib-tag-pill>
|
|
34
|
+
<p class="ib-H4-regular">Test of "participation" data focusing on</p>
|
|
35
|
+
</ib-popover>
|
|
36
|
+
</ib-button>
|
|
37
|
+
`,
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
export const Default = Template.bind({});
|
|
41
|
+
Default.decorators = [
|
|
42
|
+
() => ({
|
|
43
|
+
template:
|
|
44
|
+
'<div style="display: flex; align-items:center; justify-content: center; width: 400px; height: 400px; margin: 0 auto"><story /></div>',
|
|
45
|
+
}),
|
|
46
|
+
];
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<Transition>
|
|
3
|
+
<div v-show="isVisible" :class="classes">
|
|
4
|
+
<slot></slot>
|
|
5
|
+
</div>
|
|
6
|
+
</Transition>
|
|
7
|
+
</template>
|
|
8
|
+
|
|
9
|
+
<script>
|
|
10
|
+
import { popoverPosition } from "./constants";
|
|
11
|
+
|
|
12
|
+
export default {
|
|
13
|
+
name: "IbPopover",
|
|
14
|
+
props: {
|
|
15
|
+
position: {
|
|
16
|
+
type: String,
|
|
17
|
+
default: popoverPosition.topCenter,
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
data() {
|
|
21
|
+
return {
|
|
22
|
+
parentNode: null,
|
|
23
|
+
isVisible: false,
|
|
24
|
+
};
|
|
25
|
+
},
|
|
26
|
+
mounted() {
|
|
27
|
+
this.$nextTick(() => {
|
|
28
|
+
this.parentNode = this.$el.parentNode;
|
|
29
|
+
|
|
30
|
+
if (getComputedStyle(this.parentNode).position !== "absolute") {
|
|
31
|
+
this.parentNode.style.position = "relative";
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
this.parentNode.addEventListener("focus", this.showPopover, true);
|
|
35
|
+
this.parentNode.addEventListener("blur", this.hidePopover, true);
|
|
36
|
+
this.parentNode.addEventListener("mouseover", this.showPopover, true);
|
|
37
|
+
this.parentNode.addEventListener("mouseleave", this.hidePopover, true);
|
|
38
|
+
});
|
|
39
|
+
},
|
|
40
|
+
methods: {
|
|
41
|
+
showPopover() {
|
|
42
|
+
this.isVisible = true;
|
|
43
|
+
},
|
|
44
|
+
hidePopover() {
|
|
45
|
+
this.isVisible = false;
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
computed: {
|
|
49
|
+
classes() {
|
|
50
|
+
const classList = ["ib-popover"];
|
|
51
|
+
classList.push(`ib-${this.position}`);
|
|
52
|
+
|
|
53
|
+
if (this.isVisible) {
|
|
54
|
+
classList.push("active");
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
return classList;
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
beforeUnmount() {
|
|
61
|
+
this.parentNode.removeEventListener("focus", this.showPopover, true);
|
|
62
|
+
this.parentNode.removeEventListener("blur", this.hidePopover, true);
|
|
63
|
+
this.parentNode.removeEventListener("mouseover", this.showPopover, true);
|
|
64
|
+
this.parentNode.removeEventListener("mouseleave", this.hidePopover, true);
|
|
65
|
+
},
|
|
66
|
+
};
|
|
67
|
+
</script>
|
|
68
|
+
|
|
69
|
+
<style lang="scss" scoped>
|
|
70
|
+
// Transition
|
|
71
|
+
.v-enter-active,
|
|
72
|
+
.v-leave-active {
|
|
73
|
+
transition: opacity 0.3s ease;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.v-enter-from,
|
|
77
|
+
.v-leave-to {
|
|
78
|
+
opacity: 0;
|
|
79
|
+
}
|
|
80
|
+
@import "./popover.scss";
|
|
81
|
+
</style>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export const popoverPosition = {
|
|
2
|
+
topLeft: "top-Left",
|
|
3
|
+
topCenter: "top-center",
|
|
4
|
+
topRight: "top-right",
|
|
5
|
+
rightTop: "right-top",
|
|
6
|
+
rightCenter: "right-center",
|
|
7
|
+
rightBottom: "right-bottom",
|
|
8
|
+
bottomLeft: "bottom-left",
|
|
9
|
+
bottomCenter: "bottom-center",
|
|
10
|
+
bottomRight: "bottom-right",
|
|
11
|
+
leftTop: "left-top",
|
|
12
|
+
leftCenter: "left-center",
|
|
13
|
+
leftBottom: "left-bottom",
|
|
14
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
@import "../../assets/scss/typography.scss";
|
|
2
|
+
@import "../../assets/scss/mixins/tooltip-position.scss";
|
|
3
|
+
@import "../../assets/scss/variables/colors.scss";
|
|
4
|
+
@import "../../assets/scss/variables/shadows.scss";
|
|
5
|
+
|
|
6
|
+
$background: $white;
|
|
7
|
+
$textColor: $neutral-900;
|
|
8
|
+
$shadow: $ib-shadow-4;
|
|
9
|
+
|
|
10
|
+
.ib-popover {
|
|
11
|
+
position: absolute;
|
|
12
|
+
padding: 20px;
|
|
13
|
+
max-width: 300px;
|
|
14
|
+
width: max-content;
|
|
15
|
+
background-color: $background;
|
|
16
|
+
color: $textColor;
|
|
17
|
+
border-radius: 4px;
|
|
18
|
+
box-shadow: $shadow;
|
|
19
|
+
top: auto;
|
|
20
|
+
bottom: auto;
|
|
21
|
+
left: auto;
|
|
22
|
+
right: auto;
|
|
23
|
+
@include TooltipPosition;
|
|
24
|
+
z-index: 100;
|
|
25
|
+
text-align: start;
|
|
26
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# IbPopover
|
|
2
|
+
import { Story, Canvas } from "@storybook/addon-docs";
|
|
3
|
+
|
|
4
|
+
A popover is a layer that pops up over all other elements on a page and has wide variation of passive content to display.
|
|
5
|
+
|
|
6
|
+
## Overview
|
|
7
|
+
|
|
8
|
+
A popover is a layer that appears above all other content on the page. Only one popover can appear at a time and can contain varying text and interactive elements. Popovers are used as an expanded version of Large tooltip but also can depict other visual information like Gif's, Images, Badges, etc.
|
|
9
|
+
This component appears on Hover, therefore it can't hold clickable components. Clickable components can be placed in [Toggletip](?path=/story/toggletip--default) only (this rule is specific for IntelliBord Next system, other systems put different rules for this component).
|
|
10
|
+
|
|
11
|
+
### When to use
|
|
12
|
+
|
|
13
|
+
- Use when placing interactive elements, like links, buttons, or rich media to make the component more accessible. Disclosures that contain interactive elements use popovers as a base container layer to achieve this accessibility standard.
|
|
14
|
+
- Use when you need to display additional details for specific elements on a page.
|
|
15
|
+
|
|
16
|
+
### Popover with trigger button
|
|
17
|
+
|
|
18
|
+
A popover is controlled by a trigger button. By default, we use an icon button to trigger a popover to open. However, as long as the trigger button is interactive it can visually change its shape and size depending on the usecase.
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
### Usage
|
|
22
|
+
For correct use component `<ib-popover>`, need to insert inside the element that should show this `<ib-popover>` when hovering and focusing.
|
|
23
|
+
<Canvas>
|
|
24
|
+
<Story id="popover--default" />
|
|
25
|
+
</Canvas>
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
### Props
|
|
29
|
+
|
|
30
|
+
| Name | type | Default Value | required | Description |
|
|
31
|
+
| -------- | ------ | -------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
32
|
+
| position | String | '`top-center`' | No | The position of tooltip. Possible values are: '`top-left`', '`top-center`', '`top-right`', '`right-top`', '`right-center`', '`right-bottom`', '`bottom-left`', '`bottom-center`', '`bottom-right`', '`left-top`', '`left-center`', '`left-bottom`'. |
|
|
33
|
+
|
|
34
|
+
### Events
|
|
35
|
+
|
|
36
|
+
This component not suports events.
|
|
37
|
+
|
|
38
|
+
### Slots
|
|
39
|
+
|
|
40
|
+
| Slot name | Description |
|
|
41
|
+
| --------- | ------------------------------------------- |
|
|
42
|
+
| default | Content to be displayed inside the popover. |
|