@avakhula/ui 0.0.505 → 0.0.510-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.es.js +22382 -0
- package/dist/index.umd.js +238 -0
- package/package.json +11 -10
- package/src/App.vue +16 -127
- package/src/assets/scss/mixins/dropdown-list-item.scss +9 -4
- package/src/assets/scss/mixins/tooltip-position.scss +7 -0
- package/src/assets/scss/mixins.scss +2 -2
- package/src/assets/scss/style.scss +4 -4
- 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 +3 -3
- package/src/components/Accordion/Accordion.stories.js +0 -0
- package/src/components/Accordion/Accordion.vue +2 -2
- 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 +6 -1
- package/src/components/Alert/alert.scss +8 -3
- 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 +27 -4
- package/src/components/Avatar/constants.js +6 -0
- package/src/components/Badge/Badge.spec.js +0 -0
- package/src/components/Badge/Badge.vue +2 -2
- package/src/components/Badge/readme.mdx +0 -0
- package/src/components/Breadcrumbs/Breadcrumbs.vue +24 -9
- package/src/components/Breadcrumbs/breadcrumbs.scss +5 -5
- package/src/components/Breadcrumbs/breadcrumbs.stories.js +0 -0
- package/src/components/Button/Button.spec.js +0 -0
- package/src/components/Button/Button.vue +20 -4
- package/src/components/Button/button.scss +8 -3
- 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 +3 -3
- package/src/components/Dropdown/DropdownDivider.vue +1 -1
- package/src/components/Dropdown/DropdownItem.vue +27 -5
- package/src/components/Dropdown/DropdownList.stories.js +0 -0
- package/src/components/Dropdown/DropdownList.vue +6 -2
- package/src/components/Dropdown/readme.mdx +0 -0
- package/src/components/Form/CharactersCount.vue +12 -9
- package/src/components/Form/Checkbox/Checkbox.scss +4 -4
- package/src/components/Form/Checkbox/Checkbox.stories.js +0 -0
- package/src/components/Form/Checkbox/Checkbox.vue +25 -12
- 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 +356 -265
- package/src/components/Form/DatePicker/DatePicker.stories.js +0 -0
- package/src/components/Form/DatePicker/DatePicker.vue +73 -18
- package/src/components/Form/DatePicker/readme.mdx +0 -0
- package/src/components/Form/FormGroup/FormGroup.vue +5 -5
- package/src/components/Form/FormGroup/FormGroupSet.vue +1 -1
- package/src/components/Form/Input/Input.stories.js +0 -0
- package/src/components/Form/Input/Input.vue +120 -14
- package/src/components/Form/Input/constants.js +0 -0
- package/src/components/Form/Input/input.scss +64 -5
- 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 +24 -12
- 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 +77 -28
- package/src/components/Form/PhoneInput/phoneInput.scss +42 -10
- 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 +17 -45
- package/src/components/Form/Radio/radio.scss +8 -5
- 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 +92 -138
- 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 +15 -339
- 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 +28 -10
- package/src/components/Form/Textarea/readme.mdx +0 -0
- package/src/components/Form/Textarea/textarea.scss +33 -5
- package/src/components/Form/Toggle/Toggle.stories.js +0 -0
- package/src/components/Form/Toggle/Toggle.vue +1 -1
- package/src/components/Form/Toggle/readme.mdx +0 -0
- package/src/components/Form/Toggle/toggle.scss +3 -3
- package/src/components/IconButton/IconButton.scss +13 -2
- package/src/components/IconButton/IconButton.vue +11 -4
- package/src/components/IconButton/readme.mdx +0 -0
- package/src/components/List.vue +1 -1
- package/src/components/Modal/Modal.stories.js +0 -0
- package/src/components/Modal/Modal.vue +109 -40
- 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 +37 -5
- package/src/components/Pagination/pagination.scss +20 -4
- package/src/components/Panel/Panel.stories.js +0 -0
- package/src/components/Panel/Panel.vue +72 -6
- package/src/components/Popover/Popover.vue +27 -10
- package/src/components/Popover/constants.js +0 -0
- package/src/components/Popover/popover.scss +4 -4
- package/src/components/Popover/readme.mdx +0 -0
- package/src/components/ProgressBar/ProgressBar.vue +1 -1
- package/src/components/ProgressBar/constants.js +0 -0
- package/src/components/ProgressBar/progressBar.scss +1 -1
- package/src/components/ProgressBar/readme.mdx +0 -0
- package/src/components/Sorting/Sorting.stories.js +0 -0
- package/src/components/Sorting/Sorting.vue +25 -27
- package/src/components/Sorting/sorting.scss +5 -5
- package/src/components/SplitButton/SplitButton.stories.js +0 -0
- package/src/components/SplitButton/SplitButton.vue +52 -9
- package/src/components/SplitButton/SplitButtonItem.vue +14 -2
- package/src/components/SplitButton/readme.mdx +0 -0
- package/src/components/SplitButton/splitButton.scss +3 -3
- package/src/components/StatusIndicator/StatusIndicator.stories.js +0 -0
- package/src/components/StatusIndicator/StatusIndicator.vue +2 -2
- 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 +2 -2
- package/src/components/Table/Cells/CheckboxCell.vue +0 -0
- package/src/components/Table/Row.vue +1 -1
- 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 +1 -1
- package/src/components/Tabs/Tabs.stories.js +0 -0
- package/src/components/Tabs/Tabs.vue +21 -6
- package/src/components/Tabs/tabs.scss +12 -6
- package/src/components/TagPill/TagPill.stories.js +0 -0
- package/src/components/TagPill/TagPill.vue +8 -2
- package/src/components/TagPill/readme.mdx +0 -0
- package/src/components/ToggleTip/ToggleTip.vue +1 -1
- package/src/components/ToggleTip/constants.js +0 -0
- package/src/components/ToggleTip/readme.mdx +0 -0
- package/src/components/ToggleTip/toggleTip.scss +5 -5
- package/src/components/Tooltip/Tooltip.vue +4 -4
- package/src/components/Tooltip/readme.mdx +0 -0
- package/src/components/TreeSelect/Option.vue +59 -25
- package/src/components/TreeSelect/Select.stories.js +0 -0
- package/src/components/TreeSelect/Select.vue +283 -148
- 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 +37 -6
- package/src/components/TreeSelect/scss/select.scss +97 -6
- 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 +3 -9
- package/dist/index.js +0 -20786
- package/dist/index.umd.cjs +0 -227
- package/dist/style.css +0 -1
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
@
|
|
2
|
-
@
|
|
1
|
+
@use "../../assets/scss/variables/colors.scss" as *;
|
|
2
|
+
@use "../../assets/scss/mixins.scss" as *;
|
|
3
|
+
|
|
4
|
+
// Disabled button colors
|
|
5
|
+
$disabled-btn-background: $gray-100;
|
|
6
|
+
$disabled-btn-color: $neutral-500;
|
|
3
7
|
|
|
4
8
|
.ib-icon-button {
|
|
5
9
|
padding: 0;
|
|
@@ -93,6 +97,13 @@
|
|
|
93
97
|
color: $blue-900;
|
|
94
98
|
background-color: $blue-200;
|
|
95
99
|
}
|
|
100
|
+
|
|
101
|
+
&:disabled {
|
|
102
|
+
background: $disabled-btn-background;
|
|
103
|
+
color: $disabled-btn-color;
|
|
104
|
+
cursor: auto;
|
|
105
|
+
border-color: transparent;
|
|
106
|
+
}
|
|
96
107
|
}
|
|
97
108
|
}
|
|
98
109
|
}
|
|
@@ -2,18 +2,19 @@
|
|
|
2
2
|
<ib-button
|
|
3
3
|
v-bind="attrs"
|
|
4
4
|
:href="href"
|
|
5
|
+
:to="to"
|
|
5
6
|
:kind="kind"
|
|
6
7
|
:disabled="disabled"
|
|
7
8
|
:prevent-default="preventDefault"
|
|
9
|
+
v-tooltip="helpText"
|
|
8
10
|
>
|
|
9
11
|
<slot></slot>
|
|
10
|
-
<ib-tooltip v-if="helpText.length" :text="helpText" />
|
|
11
12
|
</ib-button>
|
|
12
13
|
</template>
|
|
13
14
|
|
|
14
15
|
<script>
|
|
15
16
|
import IbButton from "../Button/Button.vue";
|
|
16
|
-
import
|
|
17
|
+
import { TooltipDirective as Tooltip } from "../../directives/tooltip/tooltip"
|
|
17
18
|
import { iconButtonKindOptions, iconButtonSize } from "./constants.js";
|
|
18
19
|
|
|
19
20
|
export default {
|
|
@@ -43,6 +44,10 @@ export default {
|
|
|
43
44
|
type: String,
|
|
44
45
|
default: "",
|
|
45
46
|
},
|
|
47
|
+
to: {
|
|
48
|
+
type: [String, Object],
|
|
49
|
+
default: "",
|
|
50
|
+
},
|
|
46
51
|
helpText: {
|
|
47
52
|
type: String,
|
|
48
53
|
default: "",
|
|
@@ -90,12 +95,14 @@ export default {
|
|
|
90
95
|
},
|
|
91
96
|
components: {
|
|
92
97
|
IbButton,
|
|
93
|
-
|
|
98
|
+
},
|
|
99
|
+
directives: {
|
|
100
|
+
Tooltip,
|
|
94
101
|
},
|
|
95
102
|
inheritAttrs: false,
|
|
96
103
|
};
|
|
97
104
|
</script>
|
|
98
105
|
|
|
99
106
|
<style lang="scss">
|
|
100
|
-
@
|
|
107
|
+
@use "./IconButton.scss" as *;
|
|
101
108
|
</style>
|
|
File without changes
|
package/src/components/List.vue
CHANGED
|
File without changes
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
<slot name="trigger"></slot>
|
|
10
10
|
</div>
|
|
11
11
|
|
|
12
|
-
<Teleport to="body">
|
|
13
|
-
<div
|
|
12
|
+
<Teleport to="body" v-if="isActive">
|
|
13
|
+
<div :class="classes" ref="modal">
|
|
14
14
|
<div :class="bodyClassList" :style="bodyStyles" v-outside="clickOutside">
|
|
15
15
|
<ib-icon-button
|
|
16
16
|
v-if="showCloseButton"
|
|
@@ -76,32 +76,18 @@ export default {
|
|
|
76
76
|
watch: {
|
|
77
77
|
active(val) {
|
|
78
78
|
this.isActive = val;
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
focusableItems[focusableItems.length - 1].focus();
|
|
90
|
-
}
|
|
91
|
-
});
|
|
92
|
-
|
|
93
|
-
focusableItems[focusableItems.length - 1]?.addEventListener(
|
|
94
|
-
"keydown",
|
|
95
|
-
(e) => {
|
|
96
|
-
if (e.keyCode === TAB_KEY_CODE && !e.shiftKey) {
|
|
97
|
-
e.preventDefault();
|
|
98
|
-
focusableItems[0].focus();
|
|
99
|
-
}
|
|
79
|
+
if (val) {
|
|
80
|
+
this.$nextTick(() => {
|
|
81
|
+
this.setupFocusTrap();
|
|
82
|
+
});
|
|
83
|
+
document.addEventListener("keydown", this.onKeydown);
|
|
84
|
+
document.addEventListener("blur", this.setFocusOnModal, true);
|
|
85
|
+
} else {
|
|
86
|
+
this.cleanupFocusTrap();
|
|
87
|
+
document.removeEventListener("keydown", this.onKeydown);
|
|
88
|
+
document.removeEventListener("blur", this.setFocusOnModal, true);
|
|
100
89
|
}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
document.addEventListener("keydown", this.onKeydown);
|
|
104
|
-
document.addEventListener("blur", this.setFocusOnModal, true);
|
|
90
|
+
},
|
|
105
91
|
},
|
|
106
92
|
data() {
|
|
107
93
|
return {
|
|
@@ -109,6 +95,53 @@ export default {
|
|
|
109
95
|
};
|
|
110
96
|
},
|
|
111
97
|
methods: {
|
|
98
|
+
setupFocusTrap() {
|
|
99
|
+
this.focusableItems =
|
|
100
|
+
this.$refs?.modal?.querySelectorAll(
|
|
101
|
+
"[tabindex], a, button, input, select, textarea"
|
|
102
|
+
) || [];
|
|
103
|
+
|
|
104
|
+
if (this.focusableItems.length === 0) return;
|
|
105
|
+
|
|
106
|
+
const firstItem = this.focusableItems[0];
|
|
107
|
+
const lastItem = this.focusableItems[this.focusableItems.length - 1];
|
|
108
|
+
|
|
109
|
+
this.firstFocusableHandler = (e) => {
|
|
110
|
+
if (e.keyCode === TAB_KEY_CODE && e.shiftKey) {
|
|
111
|
+
e.preventDefault();
|
|
112
|
+
lastItem.focus();
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
this.lastFocusableHandler = (e) => {
|
|
117
|
+
if (e.keyCode === TAB_KEY_CODE && !e.shiftKey) {
|
|
118
|
+
e.preventDefault();
|
|
119
|
+
firstItem.focus();
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
firstItem.addEventListener("keydown", this.firstFocusableHandler);
|
|
124
|
+
lastItem.addEventListener("keydown", this.lastFocusableHandler);
|
|
125
|
+
|
|
126
|
+
firstItem.focus();
|
|
127
|
+
},
|
|
128
|
+
cleanupFocusTrap() {
|
|
129
|
+
if (this.focusableItems.length === 0) return;
|
|
130
|
+
|
|
131
|
+
const firstItem = this.focusableItems[0];
|
|
132
|
+
const lastItem = this.focusableItems[this.focusableItems.length - 1];
|
|
133
|
+
|
|
134
|
+
if (this.firstFocusableHandler) {
|
|
135
|
+
firstItem?.removeEventListener("keydown", this.firstFocusableHandler);
|
|
136
|
+
}
|
|
137
|
+
if (this.lastFocusableHandler) {
|
|
138
|
+
lastItem?.removeEventListener("keydown", this.lastFocusableHandler);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
this.firstFocusableHandler = null;
|
|
142
|
+
this.lastFocusableHandler = null;
|
|
143
|
+
this.focusableItems = [];
|
|
144
|
+
},
|
|
112
145
|
showModal(value) {
|
|
113
146
|
if (value) {
|
|
114
147
|
this.open();
|
|
@@ -116,8 +149,10 @@ export default {
|
|
|
116
149
|
this.close();
|
|
117
150
|
}
|
|
118
151
|
},
|
|
119
|
-
onTriggerBlur() {
|
|
120
|
-
this.$refs.modal?.
|
|
152
|
+
onTriggerBlur(e) {
|
|
153
|
+
if (!this.$refs.modal?.contains(e.relatedTarget) && this.isActive) {
|
|
154
|
+
this.$refs.modal?.querySelector("a, button, [tabindex]")?.focus();
|
|
155
|
+
}
|
|
121
156
|
},
|
|
122
157
|
open() {
|
|
123
158
|
this.isActive = true;
|
|
@@ -125,16 +160,34 @@ export default {
|
|
|
125
160
|
this.$emit("open");
|
|
126
161
|
},
|
|
127
162
|
close() {
|
|
128
|
-
this.isActive = false;
|
|
129
163
|
this.$refs.trigger?.querySelector("a, button, [tabindex]")?.focus();
|
|
130
164
|
document.body.classList.remove("modal-open");
|
|
131
165
|
this.$emit("close");
|
|
132
166
|
},
|
|
133
167
|
setFocusOnModal(e) {
|
|
134
|
-
if(!this
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
168
|
+
if (!this.isActive) return;
|
|
169
|
+
|
|
170
|
+
const openModals = Array.from(
|
|
171
|
+
document.querySelectorAll(".modal.is-active")
|
|
172
|
+
);
|
|
173
|
+
|
|
174
|
+
const topModal = openModals
|
|
175
|
+
.sort(
|
|
176
|
+
(a, b) =>
|
|
177
|
+
+(getComputedStyle(a).zIndex || 0) -
|
|
178
|
+
+(getComputedStyle(b).zIndex || 0)
|
|
179
|
+
)
|
|
180
|
+
.at(-1);
|
|
181
|
+
|
|
182
|
+
if (topModal !== this.$refs.modal) return;
|
|
183
|
+
|
|
184
|
+
if (!topModal.contains(e.target) && !topModal.contains(e.relatedTarget)) {
|
|
185
|
+
const focusable = topModal.querySelector(
|
|
186
|
+
`a[href], button:not([disabled]),
|
|
187
|
+
textarea, input:not([type="hidden"]),
|
|
188
|
+
select, [tabindex]:not([tabindex="-1"])`
|
|
189
|
+
);
|
|
190
|
+
focusable?.focus();
|
|
138
191
|
}
|
|
139
192
|
},
|
|
140
193
|
clickOutside(e) {
|
|
@@ -147,15 +200,31 @@ export default {
|
|
|
147
200
|
}
|
|
148
201
|
},
|
|
149
202
|
onKeydown(e) {
|
|
150
|
-
if (
|
|
203
|
+
if (
|
|
204
|
+
e.keyCode === ESC_KEY_CODE &&
|
|
205
|
+
!this.stopPropagation &&
|
|
206
|
+
this.isActive
|
|
207
|
+
) {
|
|
151
208
|
this.close();
|
|
152
209
|
}
|
|
153
|
-
}
|
|
210
|
+
},
|
|
154
211
|
},
|
|
155
212
|
computed: {
|
|
213
|
+
classes() {
|
|
214
|
+
const classList = ["modal"];
|
|
215
|
+
|
|
216
|
+
if (this.classList.length) {
|
|
217
|
+
classList.push(this.classList);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
if (this.isActive) {
|
|
221
|
+
classList.push("is-active");
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
return classList;
|
|
225
|
+
},
|
|
156
226
|
bodyStyles() {
|
|
157
227
|
const styleList = {};
|
|
158
|
-
|
|
159
228
|
if (this.size === modalSizes.S) {
|
|
160
229
|
styleList.width = "380px";
|
|
161
230
|
styleList.minHeight = "160px";
|
|
@@ -226,9 +295,9 @@ export default {
|
|
|
226
295
|
</script>
|
|
227
296
|
|
|
228
297
|
<style lang="scss" scoped>
|
|
229
|
-
@
|
|
230
|
-
@
|
|
231
|
-
@
|
|
298
|
+
@use "../../assets/scss/variables/colors.scss" as *;
|
|
299
|
+
@use "../../assets/scss/variables/shadows.scss" as *;
|
|
300
|
+
@use "../../assets/scss/typography.scss" as *;
|
|
232
301
|
|
|
233
302
|
$backdrop-bg: $black-t20;
|
|
234
303
|
$modal-title-color: $neutral-900;
|
|
File without changes
|
|
File without changes
|
|
@@ -4,9 +4,11 @@
|
|
|
4
4
|
<ib-select
|
|
5
5
|
classList="report-limit-selector-select"
|
|
6
6
|
:value="value"
|
|
7
|
+
:vertical="vertical"
|
|
7
8
|
:options="prepareOptions"
|
|
8
9
|
:is-multiple="false"
|
|
9
10
|
:show-clear-button="false"
|
|
11
|
+
aria-label="Pagination"
|
|
10
12
|
@input="selectItem"
|
|
11
13
|
/>
|
|
12
14
|
</div>
|
|
@@ -25,6 +27,9 @@ export default {
|
|
|
25
27
|
value: {
|
|
26
28
|
type: Number,
|
|
27
29
|
},
|
|
30
|
+
vertical: {
|
|
31
|
+
type: String
|
|
32
|
+
},
|
|
28
33
|
options: {
|
|
29
34
|
type: Array,
|
|
30
35
|
default: () => [10, 25, 50, 100],
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="report-controls">
|
|
2
|
+
<div ref="paginationControl" class="report-controls" :class="{ 'simple-pagination': !showLimitSelector }">
|
|
3
3
|
<ib-limit-selector
|
|
4
|
+
v-if="showLimitSelector"
|
|
4
5
|
@select="changeLimit"
|
|
5
6
|
:value="limitValue"
|
|
7
|
+
:vertical="vertical"
|
|
6
8
|
:label-select="labelSelect"
|
|
7
9
|
></ib-limit-selector>
|
|
8
10
|
|
|
9
11
|
<div class="repot-pagination">
|
|
10
12
|
<template v-if="showPaginationInput">
|
|
11
|
-
<ib-label>{{ labelInput }}</ib-label>
|
|
13
|
+
<ib-label for="goToPage">{{ labelInput }}</ib-label>
|
|
12
14
|
<div class="pagination-input">
|
|
13
|
-
<ib-input type="number" :debounce="500" @input="onInput"></ib-input>
|
|
15
|
+
<ib-input id="goToPage" type="number" hide-number-actions :debounce="500" @input="onInput"></ib-input>
|
|
14
16
|
</div>
|
|
15
17
|
</template>
|
|
16
18
|
|
|
@@ -28,7 +30,10 @@
|
|
|
28
30
|
<ib-tooltip v-if="tooltipTextPrev" :text="tooltipTextPrev"></ib-tooltip>
|
|
29
31
|
</ib-icon-button>
|
|
30
32
|
|
|
31
|
-
<
|
|
33
|
+
<p v-if="isShort" class="pagination-text">
|
|
34
|
+
{{ currentPage }} Page
|
|
35
|
+
</p>
|
|
36
|
+
<ul v-else class="pagination-wrapper">
|
|
32
37
|
<li
|
|
33
38
|
v-for="(item, index) of countPagePagination"
|
|
34
39
|
v-show="showItem(index + 1)"
|
|
@@ -68,6 +73,9 @@ import IbInput from "../Form/Input/Input.vue";
|
|
|
68
73
|
import IbLabel from "../Form/Label/Label.vue";
|
|
69
74
|
import IbIcon from "../Icon.vue";
|
|
70
75
|
import IbTooltip from "../Tooltip/Tooltip.vue";
|
|
76
|
+
|
|
77
|
+
const MIN_FULL_WIDTH = 475;
|
|
78
|
+
|
|
71
79
|
export default {
|
|
72
80
|
name: "IbPagination",
|
|
73
81
|
props: {
|
|
@@ -104,9 +112,18 @@ export default {
|
|
|
104
112
|
type: Boolean,
|
|
105
113
|
default: true,
|
|
106
114
|
},
|
|
115
|
+
showLimitSelector: {
|
|
116
|
+
type: Boolean,
|
|
117
|
+
default: true,
|
|
118
|
+
},
|
|
119
|
+
vertical: {
|
|
120
|
+
type: String
|
|
121
|
+
}
|
|
107
122
|
},
|
|
108
123
|
data() {
|
|
109
124
|
return {
|
|
125
|
+
isShort: false,
|
|
126
|
+
resizeObserver: null,
|
|
110
127
|
currentPage: this.current,
|
|
111
128
|
indexSpaceLeft: null,
|
|
112
129
|
indexSpaceRight: null,
|
|
@@ -117,11 +134,22 @@ export default {
|
|
|
117
134
|
current(newVal) {
|
|
118
135
|
this.onSelect(newVal);
|
|
119
136
|
},
|
|
137
|
+
limitSelector(newVal) {
|
|
138
|
+
this.limitValue = newVal;
|
|
139
|
+
},
|
|
120
140
|
limitValue() {
|
|
121
141
|
this.currentPage = 1;
|
|
122
142
|
},
|
|
123
143
|
},
|
|
144
|
+
mounted() {
|
|
145
|
+
this.handleResize();
|
|
146
|
+
this.resizeObserver = new ResizeObserver(this.handleResize);
|
|
147
|
+
this.resizeObserver.observe(this.$refs.paginationControl);
|
|
148
|
+
},
|
|
124
149
|
methods: {
|
|
150
|
+
handleResize() {
|
|
151
|
+
this.isShort = this.$refs.paginationControl.clientWidth < MIN_FULL_WIDTH;
|
|
152
|
+
},
|
|
125
153
|
changeLimit(val) {
|
|
126
154
|
if (Number.isInteger(val)) {
|
|
127
155
|
this.limitValue = val;
|
|
@@ -222,6 +250,10 @@ export default {
|
|
|
222
250
|
return Math.ceil(this.countRows / this.limitValue);
|
|
223
251
|
},
|
|
224
252
|
},
|
|
253
|
+
beforeUnmount() {
|
|
254
|
+
this.resizeObserver.disconnect();
|
|
255
|
+
this.resizeObserver = null;
|
|
256
|
+
},
|
|
225
257
|
components: {
|
|
226
258
|
IbIconButton,
|
|
227
259
|
IbIcon,
|
|
@@ -233,5 +265,5 @@ export default {
|
|
|
233
265
|
};
|
|
234
266
|
</script>
|
|
235
267
|
<style lang="scss">
|
|
236
|
-
@
|
|
268
|
+
@use "./pagination.scss" as *;
|
|
237
269
|
</style>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
@
|
|
2
|
-
@
|
|
3
|
-
@
|
|
1
|
+
@use "../../assets/scss/variables/colors.scss" as *;
|
|
2
|
+
@use "../../assets/scss/typography.scss" as *;
|
|
3
|
+
@use "../../assets/scss/mixins.scss" as *;
|
|
4
4
|
|
|
5
5
|
.report-limit-selector {
|
|
6
6
|
display: flex;
|
|
@@ -29,12 +29,28 @@
|
|
|
29
29
|
justify-content: space-between;
|
|
30
30
|
align-items: center;
|
|
31
31
|
|
|
32
|
+
&.simple-pagination {
|
|
33
|
+
width: 100%;
|
|
34
|
+
|
|
35
|
+
.repot-pagination {
|
|
36
|
+
width: 100%;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.row-count {
|
|
40
|
+
margin-right: auto;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
32
43
|
.row-count {
|
|
33
44
|
margin-right: 10px;
|
|
34
45
|
@include Ib-H4-regular;
|
|
35
46
|
color: $gray-600;
|
|
36
47
|
}
|
|
37
48
|
|
|
49
|
+
.pagination-text {
|
|
50
|
+
@include Ib-H4-regular;
|
|
51
|
+
color: $gray-600;
|
|
52
|
+
margin: 0 8px;
|
|
53
|
+
}
|
|
38
54
|
.repot-pagination {
|
|
39
55
|
display: flex;
|
|
40
56
|
align-items: center;
|
|
@@ -180,4 +196,4 @@
|
|
|
180
196
|
}
|
|
181
197
|
}
|
|
182
198
|
}
|
|
183
|
-
}
|
|
199
|
+
}
|
|
File without changes
|
|
@@ -4,10 +4,26 @@
|
|
|
4
4
|
<div class="head-title">
|
|
5
5
|
<slot name="title" />
|
|
6
6
|
</div>
|
|
7
|
-
|
|
7
|
+
|
|
8
|
+
<div v-show="!hideHeaderDivider" class="divider"></div>
|
|
9
|
+
|
|
8
10
|
<div class="head-content">
|
|
9
11
|
<slot name="head-content" />
|
|
10
12
|
</div>
|
|
13
|
+
|
|
14
|
+
<icon-button
|
|
15
|
+
v-if="showExpandButton"
|
|
16
|
+
:class="{
|
|
17
|
+
'toggle-visible-button': true,
|
|
18
|
+
'active': isOpenVal,
|
|
19
|
+
}"
|
|
20
|
+
kind="ghost"
|
|
21
|
+
type="button"
|
|
22
|
+
v-tooltip="expandButtonTooltip"
|
|
23
|
+
@click="isOpenVal = !isOpenVal"
|
|
24
|
+
>
|
|
25
|
+
<icon name="chevron-down-outline" />
|
|
26
|
+
</icon-button>
|
|
11
27
|
</div>
|
|
12
28
|
<Transition
|
|
13
29
|
name="expand"
|
|
@@ -15,7 +31,7 @@
|
|
|
15
31
|
@after-enter="afterEnter"
|
|
16
32
|
@leave="leave"
|
|
17
33
|
>
|
|
18
|
-
<div v-show="
|
|
34
|
+
<div v-show="isOpenVal" class="panel-body">
|
|
19
35
|
<slot name="body"></slot>
|
|
20
36
|
</div>
|
|
21
37
|
</Transition>
|
|
@@ -23,12 +39,23 @@
|
|
|
23
39
|
</template>
|
|
24
40
|
|
|
25
41
|
<script>
|
|
42
|
+
import IconButton from "../IconButton/IconButton.vue";
|
|
43
|
+
import Icon from "../Icon.vue";
|
|
26
44
|
import expandAnimation from "../../mixins/expandAnimation";
|
|
45
|
+
import { TooltipDirective as Tooltip } from "../../directives/tooltip/tooltip";
|
|
27
46
|
|
|
28
47
|
export default {
|
|
29
48
|
name: "IbPanel",
|
|
30
49
|
mixins: [expandAnimation],
|
|
31
50
|
props: {
|
|
51
|
+
showExpandButton: {
|
|
52
|
+
type: Boolean,
|
|
53
|
+
default: false,
|
|
54
|
+
},
|
|
55
|
+
expandButtonTooltip: {
|
|
56
|
+
type: String,
|
|
57
|
+
default: "",
|
|
58
|
+
},
|
|
32
59
|
isOpen: {
|
|
33
60
|
type: Boolean,
|
|
34
61
|
default: true,
|
|
@@ -37,13 +64,38 @@ export default {
|
|
|
37
64
|
type: Boolean,
|
|
38
65
|
default: false,
|
|
39
66
|
},
|
|
67
|
+
hideHeaderDivider: {
|
|
68
|
+
type: Boolean,
|
|
69
|
+
default: false,
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
watch: {
|
|
73
|
+
isOpen() {
|
|
74
|
+
this.isOpenVal = this.isOpen;
|
|
75
|
+
},
|
|
76
|
+
isOpenVal() {
|
|
77
|
+
this.$emit("update:isOpen", this.isOpenVal);
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
data() {
|
|
81
|
+
return {
|
|
82
|
+
isOpenVal: this.isOpen,
|
|
83
|
+
};
|
|
40
84
|
},
|
|
85
|
+
components: {
|
|
86
|
+
IconButton,
|
|
87
|
+
Icon,
|
|
88
|
+
},
|
|
89
|
+
directives: {
|
|
90
|
+
Tooltip,
|
|
91
|
+
},
|
|
92
|
+
emits: ["update:isOpen"],
|
|
41
93
|
};
|
|
42
94
|
</script>
|
|
43
95
|
|
|
44
96
|
<style lang="scss" scoped>
|
|
45
|
-
@
|
|
46
|
-
@
|
|
97
|
+
@use "../../assets/scss/variables/colors.scss" as *;
|
|
98
|
+
@use "../../assets/scss/typography.scss" as *;
|
|
47
99
|
|
|
48
100
|
.expand-enter-active,
|
|
49
101
|
.expand-leave-active {
|
|
@@ -69,6 +121,20 @@ $panel-divider-color: $gray-300;
|
|
|
69
121
|
outline: 2px solid $panel-error-outline-color;
|
|
70
122
|
}
|
|
71
123
|
|
|
124
|
+
.toggle-visible-button {
|
|
125
|
+
margin-left: 10px;
|
|
126
|
+
|
|
127
|
+
ion-icon {
|
|
128
|
+
transition: transform 0.5s;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
&.active {
|
|
132
|
+
ion-icon {
|
|
133
|
+
transform: rotate(180deg);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
72
138
|
.panel-head {
|
|
73
139
|
display: inline-flex;
|
|
74
140
|
width: 100%;
|
|
@@ -98,8 +164,8 @@ $panel-divider-color: $gray-300;
|
|
|
98
164
|
</style>
|
|
99
165
|
|
|
100
166
|
<style lang="scss">
|
|
101
|
-
@
|
|
102
|
-
@
|
|
167
|
+
@use "../../assets/scss/variables/colors.scss" as *;
|
|
168
|
+
@use "../../assets/scss/typography.scss" as *;
|
|
103
169
|
|
|
104
170
|
$description-color: $gray-700;
|
|
105
171
|
|
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
<Teleport :to="attachToBody ? 'body' : attachTo" v-if="attachToBody || attachTo">
|
|
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>
|
|
@@ -20,6 +28,14 @@ export default {
|
|
|
20
28
|
type: Boolean,
|
|
21
29
|
default: false,
|
|
22
30
|
},
|
|
31
|
+
attachToBody: {
|
|
32
|
+
type: Boolean,
|
|
33
|
+
default: false,
|
|
34
|
+
},
|
|
35
|
+
attachTo: {
|
|
36
|
+
type: String,
|
|
37
|
+
default: null
|
|
38
|
+
}
|
|
23
39
|
},
|
|
24
40
|
data() {
|
|
25
41
|
return {
|
|
@@ -33,10 +49,10 @@ export default {
|
|
|
33
49
|
this.parentNode = this.$el.parentNode;
|
|
34
50
|
|
|
35
51
|
if (!this.alwaysVisible) {
|
|
36
|
-
this.parentNode
|
|
37
|
-
this.parentNode
|
|
38
|
-
this.parentNode
|
|
39
|
-
this.parentNode
|
|
52
|
+
this.parentNode?.addEventListener("focus", this.showPopover, true);
|
|
53
|
+
this.parentNode?.addEventListener("blur", this.hidePopover, true);
|
|
54
|
+
this.parentNode?.addEventListener("mouseover", this.showPopover);
|
|
55
|
+
this.parentNode?.addEventListener("mouseleave", this.hidePopover);
|
|
40
56
|
}
|
|
41
57
|
});
|
|
42
58
|
},
|
|
@@ -93,6 +109,8 @@ export default {
|
|
|
93
109
|
</script>
|
|
94
110
|
|
|
95
111
|
<style lang="scss" scoped>
|
|
112
|
+
@use "./popover.scss" as *;
|
|
113
|
+
|
|
96
114
|
// Transition
|
|
97
115
|
.v-enter-active,
|
|
98
116
|
.v-leave-active {
|
|
@@ -103,5 +121,4 @@ export default {
|
|
|
103
121
|
.v-leave-to {
|
|
104
122
|
opacity: 0;
|
|
105
123
|
}
|
|
106
|
-
@import "./popover.scss";
|
|
107
124
|
</style>
|
|
File without changes
|