aloha-vue 1.0.322 → 1.0.324
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/docs/package.json
CHANGED
package/package.json
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aloha-vue",
|
|
3
3
|
"description": "Project aloha",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.324",
|
|
5
5
|
"author": "Ilia Brykin",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"build-icons": "node scriptsNode/iconsSvgToJs.js bootstrap3 && node scriptsNode/iconsSvgToJs.js bootstrap-1-9-1"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@popperjs/core": "2.11.
|
|
11
|
-
"aloha-css": "1.0.
|
|
12
|
-
"axios": "
|
|
10
|
+
"@popperjs/core": "2.11.7",
|
|
11
|
+
"aloha-css": "1.0.97",
|
|
12
|
+
"axios": "1.4.0",
|
|
13
13
|
"dompurify": "2.4.1",
|
|
14
14
|
"fecha": "^4.2.3",
|
|
15
15
|
"lodash-es": "^4.17.21",
|
|
16
16
|
"tiny-emitter": "2.1.0",
|
|
17
17
|
"tinymce": "6.2.0",
|
|
18
|
-
"vue": "3.2.
|
|
18
|
+
"vue": "^3.2.47"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
21
|
"lodash": "^4.17.21"
|
package/src/ATable/ATable.js
CHANGED
|
@@ -352,6 +352,7 @@ export default {
|
|
|
352
352
|
},
|
|
353
353
|
setup(props, context) {
|
|
354
354
|
const tableGrandparentRef = ref(undefined);
|
|
355
|
+
const tableRef = ref(undefined);
|
|
355
356
|
const isMultipleActionsActive = ref(undefined);
|
|
356
357
|
|
|
357
358
|
const {
|
|
@@ -474,6 +475,7 @@ export default {
|
|
|
474
475
|
limit,
|
|
475
476
|
closePreviewAll,
|
|
476
477
|
setEmptySelectedRowsIndexes,
|
|
478
|
+
tableRef,
|
|
477
479
|
});
|
|
478
480
|
|
|
479
481
|
const {
|
|
@@ -611,6 +613,7 @@ export default {
|
|
|
611
613
|
startSearch,
|
|
612
614
|
tableChildRole,
|
|
613
615
|
tableGrandparentRef,
|
|
616
|
+
tableRef,
|
|
614
617
|
tableRoleAttributes,
|
|
615
618
|
toggleBtnAllRows,
|
|
616
619
|
toggleMultipleActionsActive,
|
|
@@ -720,6 +723,7 @@ export default {
|
|
|
720
723
|
onToggleBtnAllRows: this.toggleBtnAllRows,
|
|
721
724
|
}, this.$slots),
|
|
722
725
|
this.isViewTableVisible && h("div", {
|
|
726
|
+
ref: "tableRef",
|
|
723
727
|
class: "a_table",
|
|
724
728
|
...this.tableRoleAttributes,
|
|
725
729
|
}, [
|
|
@@ -8,10 +8,32 @@ export default function LimitOffsetAPI(props, { emit }, {
|
|
|
8
8
|
limit = ref(0),
|
|
9
9
|
closePreviewAll = () => {},
|
|
10
10
|
setEmptySelectedRowsIndexes = () => {},
|
|
11
|
+
tableRef = ref(undefined),
|
|
11
12
|
}) {
|
|
12
13
|
const offsetStart = toRef(props, "offsetStart");
|
|
13
14
|
|
|
15
|
+
const setFocusToTable = () => {
|
|
16
|
+
if (tableRef.value) {
|
|
17
|
+
tableRef.value.setAttribute("tabindex", "-1");
|
|
18
|
+
tableRef.value.focus();
|
|
19
|
+
tableRef.value.removeAttribute("tabindex");
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const scrollToTable = () => {
|
|
24
|
+
if (tableRef.value) {
|
|
25
|
+
const elementTop = tableRef.value.getBoundingClientRect().top + window.scrollY;
|
|
26
|
+
let scrollToPosition = elementTop - (window.innerHeight / 2);
|
|
27
|
+
if (scrollToPosition < 0) {
|
|
28
|
+
scrollToPosition = 0;
|
|
29
|
+
}
|
|
30
|
+
document.documentElement.scrollTop = scrollToPosition;
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
|
|
14
34
|
const changeOffset = offsetLocal => {
|
|
35
|
+
setFocusToTable();
|
|
36
|
+
scrollToTable();
|
|
15
37
|
offset.value = offsetLocal;
|
|
16
38
|
emit("changeOffset", {
|
|
17
39
|
offset: offsetLocal,
|
|
@@ -22,6 +44,8 @@ export default function LimitOffsetAPI(props, { emit }, {
|
|
|
22
44
|
};
|
|
23
45
|
|
|
24
46
|
const changeLimit = limitLocal => {
|
|
47
|
+
setFocusToTable();
|
|
48
|
+
scrollToTable();
|
|
25
49
|
limit.value = limitLocal;
|
|
26
50
|
offset.value = offsetStart.value;
|
|
27
51
|
emit("changeLimit", {
|
|
@@ -17,7 +17,7 @@ export default function PopperContainerAPI(props) {
|
|
|
17
17
|
POPPER_CONTAINER.id = popperContainerId.value;
|
|
18
18
|
POPPER_CONTAINER.className = "a_popup_container";
|
|
19
19
|
POPPER_CONTAINER.setAttribute("aria-hidden", "true");
|
|
20
|
-
document.body.
|
|
20
|
+
document.body.prepend(POPPER_CONTAINER);
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
23
|
|
package/src/styles/styles.scss
CHANGED
package/src/utils/utilsDOM.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export function scrollToElement({ element, isMiddleOfScreen = true }) {
|
|
1
|
+
export function scrollToElement({ element, isMiddleOfScreen = true, behavior = "smooth" }) {
|
|
2
2
|
if (isMiddleOfScreen) {
|
|
3
3
|
window.scroll({
|
|
4
4
|
top: element.offsetTop - window.innerHeight / 2,
|
|
5
|
-
behavior
|
|
5
|
+
behavior,
|
|
6
6
|
});
|
|
7
7
|
} else {
|
|
8
8
|
element.scrollIntoView();
|