aloha-vue 1.0.24 → 1.0.27
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 +1 -1
- package/docs/src/components/TheMenu/TheMenu.js +5 -0
- package/docs/src/main.js +2 -2
- package/docs/src/router/index.js +5 -0
- package/docs/src/views/PageTabs/PageTabs.js +30 -0
- package/docs/src/views/PageTabs/PageTabs.pug +25 -0
- package/docs/src/views/PageTabs/PageTabs.vue +2 -0
- package/docs/styles/styles.scss +0 -15
- package/package.json +3 -2
- package/src/AIcon/AIcon.js +2 -0
- package/src/AIcon/Icons/Home.js +10 -0
- package/src/AIcon/SVG-icons/home.svg +3 -0
- package/src/ATabs/ATabs.js +144 -0
- package/src/ATabs/ATabsContent.js +62 -0
- package/src/ATabs/ATabsTab.js +104 -0
- package/src/ATabs/compositionAPI/ATabAPI.js +37 -0
- package/src/compositionAPI/AHttpAPI.js +363 -0
- package/src/plugins/AHttpPlugin.js +12 -0
- package/src/plugins/{i18nPlugin.js → AI18nPlugin.js} +0 -0
- package/src/styles/components/ADropdown.scss +2 -2
- package/src/styles/components/ATabs.scss +146 -0
- package/src/styles/styles.scss +5 -0
package/docs/package.json
CHANGED
package/docs/src/main.js
CHANGED
|
@@ -2,7 +2,7 @@ import App from "./App/App.vue";
|
|
|
2
2
|
import { createApp } from "vue";
|
|
3
3
|
import store from "./store/index";
|
|
4
4
|
import router from "./router/index";
|
|
5
|
-
import
|
|
5
|
+
import AI18nPlugin from "../../src/plugins/AI18nPlugin";
|
|
6
6
|
// import alohaPlugin from "../src/plugins/alohaPlugin";
|
|
7
7
|
import AIconPlugin from "../../src/plugins/AIconPlugin";
|
|
8
8
|
|
|
@@ -23,7 +23,7 @@ const TRANSLATIONS = {
|
|
|
23
23
|
hr: { ...hrGlobal, ...hr },
|
|
24
24
|
ru: { ...ruGlobal, ...ru },
|
|
25
25
|
};
|
|
26
|
-
APP.use(
|
|
26
|
+
APP.use(AI18nPlugin, TRANSLATIONS, "de");
|
|
27
27
|
APP.use(AIconPlugin, {
|
|
28
28
|
Plus2: `<svg
|
|
29
29
|
xmlns="http://www.w3.org/2000/svg"
|
package/docs/src/router/index.js
CHANGED
|
@@ -99,6 +99,11 @@ const ROUTES = [
|
|
|
99
99
|
name: "PageDropdown",
|
|
100
100
|
component: () => import(/* webpackChunkName: "PageDropdown" */ "../views/PageDropdown/PageDropdown.vue"),
|
|
101
101
|
},
|
|
102
|
+
{
|
|
103
|
+
path: "/tabs",
|
|
104
|
+
name: "PageTabs",
|
|
105
|
+
component: () => import(/* webpackChunkName: "PageTabs" */ "../views/PageTabs/PageTabs.vue"),
|
|
106
|
+
},
|
|
102
107
|
{
|
|
103
108
|
// If the routing configuration '*' reports an error, replace it with '/: catchAll(. *)'
|
|
104
109
|
// caught Error: Catch all routes ("*") must now be defined using a param with a custom regexp
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import ATabs from "../../../../src/ATabs/ATabs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
name: "PageTabs",
|
|
5
|
+
components: {
|
|
6
|
+
ATabs,
|
|
7
|
+
},
|
|
8
|
+
data() {
|
|
9
|
+
return {
|
|
10
|
+
dataTabs1: [
|
|
11
|
+
{
|
|
12
|
+
label: "Tab 1",
|
|
13
|
+
id: "tab_1",
|
|
14
|
+
content: "CONTENT 1",
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
label: "Tab 2",
|
|
18
|
+
id: "tab_2",
|
|
19
|
+
content: "CONTENT 2",
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
label: "Tab 3",
|
|
23
|
+
id: "tab_3",
|
|
24
|
+
content: "CONTENT 3",
|
|
25
|
+
disabled: true,
|
|
26
|
+
},
|
|
27
|
+
],
|
|
28
|
+
};
|
|
29
|
+
},
|
|
30
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
div
|
|
2
|
+
h1 ATabs
|
|
3
|
+
a-tabs(
|
|
4
|
+
:data="dataTabs1"
|
|
5
|
+
)
|
|
6
|
+
br
|
|
7
|
+
a-tabs(
|
|
8
|
+
:data="dataTabs1"
|
|
9
|
+
:is-boxed="true"
|
|
10
|
+
)
|
|
11
|
+
br
|
|
12
|
+
a-tabs.a_tabs_small(
|
|
13
|
+
:data="dataTabs1"
|
|
14
|
+
:is-boxed="true"
|
|
15
|
+
)
|
|
16
|
+
br
|
|
17
|
+
a-tabs.a_tabs_medium(
|
|
18
|
+
:data="dataTabs1"
|
|
19
|
+
:is-boxed="true"
|
|
20
|
+
)
|
|
21
|
+
br
|
|
22
|
+
a-tabs.a_tabs_large(
|
|
23
|
+
:data="dataTabs1"
|
|
24
|
+
:is-boxed="true"
|
|
25
|
+
)
|
package/docs/styles/styles.scss
CHANGED
|
@@ -1,18 +1,3 @@
|
|
|
1
|
-
html {
|
|
2
|
-
box-sizing: border-box;
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
*, ::after, ::before {
|
|
6
|
-
box-sizing: inherit;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
body {
|
|
10
|
-
margin: 0;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
.a_search_highlight {
|
|
14
|
-
color: red;
|
|
15
|
-
}
|
|
16
1
|
@import "./node_modules/aloha-css/sass/aloha";
|
|
17
2
|
|
|
18
3
|
@import "../src/styles/styles";
|
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aloha-vue",
|
|
3
3
|
"description": "Project aloha",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.27",
|
|
5
5
|
"author": "Ilia Brykin",
|
|
6
6
|
"dependencies": {
|
|
7
7
|
"@popperjs/core": "2.11.5",
|
|
8
|
-
"aloha-css": "1.0.
|
|
8
|
+
"aloha-css": "1.0.35",
|
|
9
|
+
"axios": "^0.27.2",
|
|
9
10
|
"lodash-es": "^4.17.21",
|
|
10
11
|
"vue": "3.2.37"
|
|
11
12
|
}
|
package/src/AIcon/AIcon.js
CHANGED
|
@@ -22,6 +22,7 @@ import DoubleAngleRight from "./Icons/DoubleAngleRight";
|
|
|
22
22
|
import DoubleAngleUp from "./Icons/DoubleAngleUp";
|
|
23
23
|
import EyeClose from "./Icons/EyeClose";
|
|
24
24
|
import EyeOpen from "./Icons/EyeOpen";
|
|
25
|
+
import Home from "./Icons/Home";
|
|
25
26
|
import Lock from "./Icons/Lock";
|
|
26
27
|
import Minus from "./Icons/Minus";
|
|
27
28
|
import Ok from "./Icons/Ok";
|
|
@@ -73,6 +74,7 @@ export default {
|
|
|
73
74
|
DoubleAngleUp,
|
|
74
75
|
EyeClose,
|
|
75
76
|
EyeOpen,
|
|
77
|
+
Home,
|
|
76
78
|
Lock,
|
|
77
79
|
Minus,
|
|
78
80
|
Ok,
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export default `<svg
|
|
2
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
3
|
+
width="18"
|
|
4
|
+
height="18"
|
|
5
|
+
viewBox="0 0 1024 1024"
|
|
6
|
+
>
|
|
7
|
+
<path
|
|
8
|
+
d="M861.742 548.161l-349.742-303.724-349.727 303.724c-9.197 7.897-18.407 15.778-18.407 35.498v353.679c0 15.778 13.151 28.927 28.927 28.927h219.57v-277.427c0-15.778 11.837-27.602 27.602-27.602h184.073c15.778 0 27.602 11.837 27.602 27.602v278.735h219.57c15.778 0 28.927-13.151 28.927-28.927l-0.011-353.679c0-21.042-10.499-28.913-18.393-36.802zM1014.246 486.361l-178.803-156.467v-163.022c0-15.778-13.151-28.927-28.927-28.927h-47.337c-15.778 0-28.927 13.151-28.927 28.927v72.315l-198.514-174.876c-11.837-10.51-26.304-10.51-38.123 0l-483.848 422.052c-11.837 10.51-13.151 28.927-2.642 40.756l31.558 35.498c10.51 11.837 28.927 13.151 40.756 2.642l432.558-378.654 432.558 378.654c11.837 10.51 30.239 9.197 40.756-2.642l31.558-35.498c10.51-11.849 9.211-30.239-2.639-40.756z"
|
|
9
|
+
></path>
|
|
10
|
+
</svg>`;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="1024" height="1024" viewBox="0 0 1024 1024">
|
|
2
|
+
<path d="M861.742 548.161l-349.742-303.724-349.727 303.724c-9.197 7.897-18.407 15.778-18.407 35.498v353.679c0 15.778 13.151 28.927 28.927 28.927h219.57v-277.427c0-15.778 11.837-27.602 27.602-27.602h184.073c15.778 0 27.602 11.837 27.602 27.602v278.735h219.57c15.778 0 28.927-13.151 28.927-28.927l-0.011-353.679c0-21.042-10.499-28.913-18.393-36.802zM1014.246 486.361l-178.803-156.467v-163.022c0-15.778-13.151-28.927-28.927-28.927h-47.337c-15.778 0-28.927 13.151-28.927 28.927v72.315l-198.514-174.876c-11.837-10.51-26.304-10.51-38.123 0l-483.848 422.052c-11.837 10.51-13.151 28.927-2.642 40.756l31.558 35.498c10.51 11.837 28.927 13.151 40.756 2.642l432.558-378.654 432.558 378.654c11.837 10.51 30.239 9.197 40.756-2.642l31.558-35.498c10.51-11.849 9.211-30.239-2.639-40.756z"></path>
|
|
3
|
+
</svg>
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import {
|
|
2
|
+
h,
|
|
3
|
+
ref,
|
|
4
|
+
toRef,
|
|
5
|
+
watch,
|
|
6
|
+
} from "vue";
|
|
7
|
+
|
|
8
|
+
import ATabsContent from "./ATabsContent";
|
|
9
|
+
import ATabsTab from "./ATabsTab";
|
|
10
|
+
|
|
11
|
+
import {
|
|
12
|
+
forEach,
|
|
13
|
+
get,
|
|
14
|
+
isNil,
|
|
15
|
+
isUndefined,
|
|
16
|
+
uniqueId,
|
|
17
|
+
} from "lodash-es";
|
|
18
|
+
|
|
19
|
+
export default {
|
|
20
|
+
name: "ATabs",
|
|
21
|
+
props: {
|
|
22
|
+
id: {
|
|
23
|
+
type: String,
|
|
24
|
+
required: false,
|
|
25
|
+
default: () => uniqueId("a_tabs_"),
|
|
26
|
+
},
|
|
27
|
+
data: {
|
|
28
|
+
type: Array,
|
|
29
|
+
required: true,
|
|
30
|
+
},
|
|
31
|
+
idForActiveTab: {
|
|
32
|
+
type: [String, Number],
|
|
33
|
+
required: false,
|
|
34
|
+
default: undefined,
|
|
35
|
+
},
|
|
36
|
+
keyId: {
|
|
37
|
+
type: String,
|
|
38
|
+
required: false,
|
|
39
|
+
default: "id",
|
|
40
|
+
},
|
|
41
|
+
isChangeOutside: {
|
|
42
|
+
type: Boolean,
|
|
43
|
+
required: false,
|
|
44
|
+
},
|
|
45
|
+
isBoxed: {
|
|
46
|
+
type: Boolean,
|
|
47
|
+
required: false,
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
emits: [
|
|
51
|
+
"change",
|
|
52
|
+
],
|
|
53
|
+
setup(props, { emit }) {
|
|
54
|
+
const idForActiveTabLocal = ref(undefined);
|
|
55
|
+
|
|
56
|
+
const idForActiveTab = toRef(props, "idForActiveTab");
|
|
57
|
+
const data = toRef(props, "data");
|
|
58
|
+
const keyId = toRef(props, "keyId");
|
|
59
|
+
const initTabActiveId = () => {
|
|
60
|
+
if (!isNil(idForActiveTab.value)) {
|
|
61
|
+
idForActiveTabLocal.value = idForActiveTab.value;
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
forEach(data.value, item => {
|
|
66
|
+
if (item.active) {
|
|
67
|
+
idForActiveTabLocal.value = item.id;
|
|
68
|
+
return false;
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
if (isUndefined(idForActiveTabLocal.value)) {
|
|
72
|
+
idForActiveTabLocal.value = get(data.value[0], keyId.value);
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
const isChangeOutside = toRef(props, "isChangeOutside");
|
|
77
|
+
const onChangeTab = ({ $event, tab }) => {
|
|
78
|
+
const TAB_ID = get(tab, keyId.value);
|
|
79
|
+
if (idForActiveTabLocal.value === TAB_ID) {
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
if (!isChangeOutside.value) {
|
|
83
|
+
idForActiveTabLocal.value = TAB_ID;
|
|
84
|
+
}
|
|
85
|
+
emit("change", { $event, tab });
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
watch(idForActiveTab, () => {
|
|
89
|
+
if (idForActiveTab.value) {
|
|
90
|
+
idForActiveTabLocal.value = idForActiveTab.value;
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
initTabActiveId();
|
|
95
|
+
|
|
96
|
+
return {
|
|
97
|
+
idForActiveTabLocal,
|
|
98
|
+
onChangeTab,
|
|
99
|
+
};
|
|
100
|
+
},
|
|
101
|
+
render() {
|
|
102
|
+
return h("div", {
|
|
103
|
+
id: this.id,
|
|
104
|
+
class: ["a_tabs", {
|
|
105
|
+
a_tabs_boxed: this.isBoxed,
|
|
106
|
+
}],
|
|
107
|
+
}, [
|
|
108
|
+
h("div", {
|
|
109
|
+
class: "a_tabs__box",
|
|
110
|
+
}, [
|
|
111
|
+
h("ul", {
|
|
112
|
+
class: "a_tabs__list",
|
|
113
|
+
role: "tablist",
|
|
114
|
+
}, [
|
|
115
|
+
this.data.map((tab, tabIndex) => {
|
|
116
|
+
return h(ATabsTab, {
|
|
117
|
+
key: tabIndex,
|
|
118
|
+
tab,
|
|
119
|
+
index: tabIndex,
|
|
120
|
+
parentId: this.id,
|
|
121
|
+
idForActiveTab: this.idForActiveTabLocal,
|
|
122
|
+
keyId: this.keyId,
|
|
123
|
+
onChangeTab: this.onChangeTab,
|
|
124
|
+
});
|
|
125
|
+
}),
|
|
126
|
+
]),
|
|
127
|
+
]),
|
|
128
|
+
h("div", {
|
|
129
|
+
class: "a_tabs__contents",
|
|
130
|
+
}, [
|
|
131
|
+
this.data.map((tab, tabIndex) => {
|
|
132
|
+
return h(ATabsContent, {
|
|
133
|
+
key: tabIndex,
|
|
134
|
+
tab,
|
|
135
|
+
index: tabIndex,
|
|
136
|
+
parentId: this.id,
|
|
137
|
+
keyId: this.keyId,
|
|
138
|
+
idForActiveTab: this.idForActiveTabLocal,
|
|
139
|
+
}, this.$slots);
|
|
140
|
+
}),
|
|
141
|
+
]),
|
|
142
|
+
]);
|
|
143
|
+
},
|
|
144
|
+
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import {
|
|
2
|
+
h,
|
|
3
|
+
} from "vue";
|
|
4
|
+
|
|
5
|
+
import ATabAPI from "./compositionAPI/ATabAPI";
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
name: "ATabsContent",
|
|
9
|
+
props: {
|
|
10
|
+
parentId: {
|
|
11
|
+
type: String,
|
|
12
|
+
required: true,
|
|
13
|
+
},
|
|
14
|
+
tab: {
|
|
15
|
+
type: Object,
|
|
16
|
+
required: true,
|
|
17
|
+
},
|
|
18
|
+
index: {
|
|
19
|
+
type: Number,
|
|
20
|
+
required: true,
|
|
21
|
+
},
|
|
22
|
+
idForActiveTab: {
|
|
23
|
+
type: [String, Number],
|
|
24
|
+
required: true,
|
|
25
|
+
},
|
|
26
|
+
keyId: {
|
|
27
|
+
type: String,
|
|
28
|
+
required: true,
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
setup(props) {
|
|
32
|
+
const {
|
|
33
|
+
idForContent,
|
|
34
|
+
idLocal,
|
|
35
|
+
isActive,
|
|
36
|
+
} = ATabAPI(props);
|
|
37
|
+
|
|
38
|
+
return {
|
|
39
|
+
idForContent,
|
|
40
|
+
idLocal,
|
|
41
|
+
isActive,
|
|
42
|
+
};
|
|
43
|
+
},
|
|
44
|
+
render() {
|
|
45
|
+
return h("div", {
|
|
46
|
+
id: this.idForContent,
|
|
47
|
+
role: "tabpanel",
|
|
48
|
+
class: ["a_tabs__content", {
|
|
49
|
+
a_tabs__content_show: this.isActive,
|
|
50
|
+
}],
|
|
51
|
+
ariaLabelledby: this.idLocal,
|
|
52
|
+
}, [
|
|
53
|
+
this.tab.slotContent ?
|
|
54
|
+
this.$slots[this.tab.slotContent] &&
|
|
55
|
+
this.$slots[this.tab.slotContent]({ tab: this.tab }) :
|
|
56
|
+
this.tab.content &&
|
|
57
|
+
h("div", {
|
|
58
|
+
innerHTML: this.tab.content,
|
|
59
|
+
}),
|
|
60
|
+
]);
|
|
61
|
+
},
|
|
62
|
+
};
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import {
|
|
2
|
+
computed,
|
|
3
|
+
h,
|
|
4
|
+
toRef,
|
|
5
|
+
} from "vue";
|
|
6
|
+
|
|
7
|
+
import ATabAPI from "./compositionAPI/ATabAPI";
|
|
8
|
+
|
|
9
|
+
import AKeysCode from "../const/AKeysCode";
|
|
10
|
+
|
|
11
|
+
export default {
|
|
12
|
+
name: "ATabsTab",
|
|
13
|
+
props: {
|
|
14
|
+
parentId: {
|
|
15
|
+
type: String,
|
|
16
|
+
required: true,
|
|
17
|
+
},
|
|
18
|
+
tab: {
|
|
19
|
+
type: Object,
|
|
20
|
+
required: true,
|
|
21
|
+
},
|
|
22
|
+
index: {
|
|
23
|
+
type: Number,
|
|
24
|
+
required: true,
|
|
25
|
+
},
|
|
26
|
+
idForActiveTab: {
|
|
27
|
+
type: [String, Number],
|
|
28
|
+
required: true,
|
|
29
|
+
},
|
|
30
|
+
keyId: {
|
|
31
|
+
type: String,
|
|
32
|
+
required: true,
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
emits: [
|
|
36
|
+
"changeTab",
|
|
37
|
+
],
|
|
38
|
+
setup(props, { emit }) {
|
|
39
|
+
const {
|
|
40
|
+
idForContent,
|
|
41
|
+
idLocal,
|
|
42
|
+
isActive,
|
|
43
|
+
} = ATabAPI(props);
|
|
44
|
+
|
|
45
|
+
const tab = toRef(props, "tab");
|
|
46
|
+
const onChangeTabLocal = $event => {
|
|
47
|
+
if (tab.value.disabled) {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
emit("changeTab", { $event, tab: tab.value });
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
const tabindexLocal = computed(() => {
|
|
54
|
+
return tab.value.disabled ? -1 : 0;
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
const onKeydown = $event => {
|
|
58
|
+
if ($event.keyCode === AKeysCode.enter ||
|
|
59
|
+
$event.keyCode === AKeysCode.space) {
|
|
60
|
+
onChangeTabLocal($event);
|
|
61
|
+
$event.stopPropagation();
|
|
62
|
+
$event.preventDefault();
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
return {
|
|
67
|
+
idForContent,
|
|
68
|
+
idLocal,
|
|
69
|
+
isActive,
|
|
70
|
+
onChangeTabLocal,
|
|
71
|
+
onKeydown,
|
|
72
|
+
tabindexLocal,
|
|
73
|
+
};
|
|
74
|
+
},
|
|
75
|
+
render() {
|
|
76
|
+
return h("li", {
|
|
77
|
+
class: "a_tabs__list__item",
|
|
78
|
+
}, [
|
|
79
|
+
h("a", {
|
|
80
|
+
id: this.idLocal,
|
|
81
|
+
class: ["a_tabs__list__link", this.tab.class, {
|
|
82
|
+
a_tabs__list__link_active: this.isActive,
|
|
83
|
+
a_tabs__list__link_disabled: this.tab.disabled,
|
|
84
|
+
}],
|
|
85
|
+
role: "tab",
|
|
86
|
+
ariaDisabled: this.tab.disabled,
|
|
87
|
+
ariaControls: this.idForContent,
|
|
88
|
+
ariaSelected: this.isActive,
|
|
89
|
+
tabindex: this.tabindexLocal,
|
|
90
|
+
onClick: this.onChangeTabLocal,
|
|
91
|
+
onKeydown: this.onKeydown,
|
|
92
|
+
}, [
|
|
93
|
+
this.tab.title && h("span", {
|
|
94
|
+
class: "a_position_absolute_all",
|
|
95
|
+
title: this.tab.title,
|
|
96
|
+
ariaHidden: true,
|
|
97
|
+
}),
|
|
98
|
+
h("span", {
|
|
99
|
+
innerHTML: this.tab.label,
|
|
100
|
+
})
|
|
101
|
+
]),
|
|
102
|
+
]);
|
|
103
|
+
},
|
|
104
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import {
|
|
2
|
+
computed,
|
|
3
|
+
toRef,
|
|
4
|
+
} from "vue";
|
|
5
|
+
|
|
6
|
+
import {
|
|
7
|
+
get,
|
|
8
|
+
} from "lodash-es";
|
|
9
|
+
|
|
10
|
+
export default function ATabAPI(props) {
|
|
11
|
+
const parentId = toRef(props, "parentId");
|
|
12
|
+
const index = toRef(props, "index");
|
|
13
|
+
const idLocal = computed(() => {
|
|
14
|
+
return `${ parentId.value }_${ index.value }`;
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
const idForContent = computed(() => {
|
|
18
|
+
return `${ idLocal.value }_content`;
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
const tab = toRef(props, "tab");
|
|
22
|
+
const keyId = toRef(props, "keyId");
|
|
23
|
+
const tabId = computed(() => {
|
|
24
|
+
return get(tab.value, keyId.value);
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
const idForActiveTab = toRef(props, "idForActiveTab");
|
|
28
|
+
const isActive = computed(() => {
|
|
29
|
+
return idForActiveTab.value === tabId.value;
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
return {
|
|
33
|
+
idForContent,
|
|
34
|
+
idLocal,
|
|
35
|
+
isActive,
|
|
36
|
+
};
|
|
37
|
+
}
|
|
@@ -0,0 +1,363 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ref,
|
|
3
|
+
} from "vue";
|
|
4
|
+
|
|
5
|
+
import axios from "axios";
|
|
6
|
+
import {
|
|
7
|
+
forEach,
|
|
8
|
+
isArray,
|
|
9
|
+
isFunction,
|
|
10
|
+
isNil,
|
|
11
|
+
isPlainObject,
|
|
12
|
+
keyBy,
|
|
13
|
+
} from "lodash-es";
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
const BASE_URL = ref("/api/");
|
|
17
|
+
const API = ref(axios.create());
|
|
18
|
+
const API_SAVED = ref({});
|
|
19
|
+
const ERROR_CALLBACKS = ref({});
|
|
20
|
+
|
|
21
|
+
export function create({ axiosCreateOptions = {} }) {
|
|
22
|
+
API.value = axios.create(axiosCreateOptions);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export function setBaseUrl({ baseUrl = "" }) {
|
|
26
|
+
BASE_URL.value = baseUrl;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export function setErrorCallbacks({ errorCallbacks = {} }) {
|
|
30
|
+
ERROR_CALLBACKS.value = errorCallbacks;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export default function AHttpAPI() {
|
|
34
|
+
const checkErrorStatus = ({ error, showError, client, resolve, reject }) => {
|
|
35
|
+
if (!error) {
|
|
36
|
+
return true;
|
|
37
|
+
}
|
|
38
|
+
const ERROR_CALLBACK = () => {
|
|
39
|
+
const CALLBACK = ERROR_CALLBACKS[error.status];
|
|
40
|
+
if (isFunction(CALLBACK)) {
|
|
41
|
+
return CALLBACK({ error, showError, client, resolve, reject });
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
ERROR_CALLBACK();
|
|
46
|
+
// Let the promise handle the error
|
|
47
|
+
return true;
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
const callHttpRequestAndCheckSavedApi = ({
|
|
51
|
+
methodHttp,
|
|
52
|
+
url,
|
|
53
|
+
urlParams,
|
|
54
|
+
data,
|
|
55
|
+
headerParams,
|
|
56
|
+
responseType = "json",
|
|
57
|
+
apiSaveId,
|
|
58
|
+
keyId,
|
|
59
|
+
fullResponse,
|
|
60
|
+
showError = false,
|
|
61
|
+
expectedList
|
|
62
|
+
}) => {
|
|
63
|
+
let apiSavedData = undefined;
|
|
64
|
+
if (apiSaveId) {
|
|
65
|
+
apiSavedData = API_SAVED.value[apiSaveId];
|
|
66
|
+
if (apiSavedData) {
|
|
67
|
+
if (apiSavedData.loading) {
|
|
68
|
+
return apiSavedData.promise;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
const PROMISE = new Promise((resolve, reject) => {
|
|
74
|
+
if (apiSavedData) {
|
|
75
|
+
if (!apiSavedData.loading) {
|
|
76
|
+
if (keyId) {
|
|
77
|
+
if (apiSavedData.keyData) {
|
|
78
|
+
return resolve(apiSavedData.keyData);
|
|
79
|
+
}
|
|
80
|
+
const KEY_DATA = setKeyData({ data: apiSavedData.data, keyId });
|
|
81
|
+
API_SAVED.value[apiSaveId].keyData = KEY_DATA;
|
|
82
|
+
return resolve(KEY_DATA);
|
|
83
|
+
}
|
|
84
|
+
return resolve(apiSavedData.data);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
const URL_NEW = setUrlWithParams({ url, params: urlParams });
|
|
88
|
+
let url_full = `${ BASE_URL.value }${ URL_NEW }`;
|
|
89
|
+
url_full = url_full.replace(/\/\//g, "/");
|
|
90
|
+
API.value({
|
|
91
|
+
method: methodHttp,
|
|
92
|
+
url: url_full,
|
|
93
|
+
data,
|
|
94
|
+
headers: headerParams,
|
|
95
|
+
responseType,
|
|
96
|
+
}).then(
|
|
97
|
+
response => {
|
|
98
|
+
if (fullResponse) {
|
|
99
|
+
return resolve(response);
|
|
100
|
+
}
|
|
101
|
+
const DATA = checkedExpectedList({ expectedList, response });
|
|
102
|
+
const KEY_DATA = setKeyData({ data: DATA, keyId });
|
|
103
|
+
if (apiSaveId) {
|
|
104
|
+
API_SAVED.value[apiSaveId].data = DATA;
|
|
105
|
+
API_SAVED.value[apiSaveId].keyData = KEY_DATA;
|
|
106
|
+
API_SAVED.value[apiSaveId].loading = false;
|
|
107
|
+
}
|
|
108
|
+
if (keyId) {
|
|
109
|
+
return resolve(KEY_DATA);
|
|
110
|
+
}
|
|
111
|
+
return resolve(DATA);
|
|
112
|
+
},
|
|
113
|
+
error => {
|
|
114
|
+
if (checkErrorStatus({ error: error.response, showError, client: API, reject, resolve })) {
|
|
115
|
+
return reject(error.response);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
);
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
if (!apiSavedData) {
|
|
122
|
+
API_SAVED.value[apiSaveId] = API_SAVED.value[apiSaveId] || {};
|
|
123
|
+
API_SAVED.value[apiSaveId].loading = true;
|
|
124
|
+
API_SAVED.value[apiSaveId].promise = PROMISE;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
return PROMISE;
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
function getHttp({
|
|
131
|
+
url,
|
|
132
|
+
data,
|
|
133
|
+
urlParams = {},
|
|
134
|
+
headerParams,
|
|
135
|
+
responseType,
|
|
136
|
+
apiSaveId,
|
|
137
|
+
keyId,
|
|
138
|
+
fullResponse,
|
|
139
|
+
showError,
|
|
140
|
+
}) {
|
|
141
|
+
return callHttpRequestAndCheckSavedApi({
|
|
142
|
+
methodHttp: "get",
|
|
143
|
+
url,
|
|
144
|
+
urlParams,
|
|
145
|
+
data,
|
|
146
|
+
headerParams,
|
|
147
|
+
responseType,
|
|
148
|
+
apiSaveId,
|
|
149
|
+
keyId,
|
|
150
|
+
fullResponse,
|
|
151
|
+
showError,
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
function getListHttp({
|
|
156
|
+
url,
|
|
157
|
+
data,
|
|
158
|
+
urlParams = {},
|
|
159
|
+
headerParams,
|
|
160
|
+
responseType,
|
|
161
|
+
apiSaveId,
|
|
162
|
+
keyId,
|
|
163
|
+
fullResponse,
|
|
164
|
+
showError,
|
|
165
|
+
}) {
|
|
166
|
+
return callHttpRequestAndCheckSavedApi({
|
|
167
|
+
methodHttp: "get",
|
|
168
|
+
url,
|
|
169
|
+
urlParams,
|
|
170
|
+
data,
|
|
171
|
+
headerParams,
|
|
172
|
+
responseType,
|
|
173
|
+
apiSaveId,
|
|
174
|
+
keyId,
|
|
175
|
+
fullResponse,
|
|
176
|
+
showError,
|
|
177
|
+
expectedList: true,
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
function getOptionsHttp({
|
|
182
|
+
url,
|
|
183
|
+
data,
|
|
184
|
+
urlParams = {},
|
|
185
|
+
headerParams,
|
|
186
|
+
responseType,
|
|
187
|
+
keyId,
|
|
188
|
+
fullResponse,
|
|
189
|
+
showError,
|
|
190
|
+
}) {
|
|
191
|
+
return callHttpRequestAndCheckSavedApi({
|
|
192
|
+
methodHttp: "options",
|
|
193
|
+
url,
|
|
194
|
+
urlParams,
|
|
195
|
+
data,
|
|
196
|
+
headerParams,
|
|
197
|
+
responseType,
|
|
198
|
+
keyId,
|
|
199
|
+
fullResponse,
|
|
200
|
+
showError,
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
function postHttp({
|
|
205
|
+
url,
|
|
206
|
+
data,
|
|
207
|
+
urlParams = {},
|
|
208
|
+
headerParams,
|
|
209
|
+
responseType,
|
|
210
|
+
fullResponse,
|
|
211
|
+
showError,
|
|
212
|
+
}) {
|
|
213
|
+
return callHttpRequestAndCheckSavedApi({
|
|
214
|
+
methodHttp: "post",
|
|
215
|
+
url,
|
|
216
|
+
urlParams,
|
|
217
|
+
data,
|
|
218
|
+
headerParams,
|
|
219
|
+
responseType,
|
|
220
|
+
fullResponse,
|
|
221
|
+
showError,
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
function putHttp({
|
|
226
|
+
url,
|
|
227
|
+
data,
|
|
228
|
+
urlParams = {},
|
|
229
|
+
headerParams,
|
|
230
|
+
responseType,
|
|
231
|
+
fullResponse,
|
|
232
|
+
showError,
|
|
233
|
+
}) {
|
|
234
|
+
return callHttpRequestAndCheckSavedApi({
|
|
235
|
+
methodHttp: "put",
|
|
236
|
+
url,
|
|
237
|
+
urlParams,
|
|
238
|
+
data,
|
|
239
|
+
headerParams,
|
|
240
|
+
responseType,
|
|
241
|
+
fullResponse,
|
|
242
|
+
showError,
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
function patchHttp({
|
|
247
|
+
url,
|
|
248
|
+
data,
|
|
249
|
+
urlParams = {},
|
|
250
|
+
headerParams,
|
|
251
|
+
responseType,
|
|
252
|
+
fullResponse,
|
|
253
|
+
showError,
|
|
254
|
+
}) {
|
|
255
|
+
return callHttpRequestAndCheckSavedApi({
|
|
256
|
+
methodHttp: "patch",
|
|
257
|
+
url,
|
|
258
|
+
urlParams,
|
|
259
|
+
data,
|
|
260
|
+
headerParams,
|
|
261
|
+
responseType,
|
|
262
|
+
fullResponse,
|
|
263
|
+
showError,
|
|
264
|
+
});
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
function deleteHttp({
|
|
268
|
+
url,
|
|
269
|
+
data,
|
|
270
|
+
urlParams = {},
|
|
271
|
+
headerParams,
|
|
272
|
+
responseType,
|
|
273
|
+
fullResponse,
|
|
274
|
+
showError,
|
|
275
|
+
}) {
|
|
276
|
+
return callHttpRequestAndCheckSavedApi({
|
|
277
|
+
methodHttp: "delete",
|
|
278
|
+
url,
|
|
279
|
+
urlParams,
|
|
280
|
+
data,
|
|
281
|
+
headerParams,
|
|
282
|
+
responseType,
|
|
283
|
+
fullResponse,
|
|
284
|
+
showError,
|
|
285
|
+
});
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
return {
|
|
289
|
+
deleteHttp,
|
|
290
|
+
getHttp,
|
|
291
|
+
getListHttp,
|
|
292
|
+
getOptionsHttp,
|
|
293
|
+
patchHttp,
|
|
294
|
+
postHttp,
|
|
295
|
+
putHttp,
|
|
296
|
+
};
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
export function setUrlWithParams({ url, params }) {
|
|
300
|
+
const URL = url || "";
|
|
301
|
+
let urlParams = "";
|
|
302
|
+
forEach(params, (value, key) => {
|
|
303
|
+
if (isArray(value)) {
|
|
304
|
+
urlParams = setUrlForArray({ id: key, array: value, url: urlParams });
|
|
305
|
+
} else if (isPlainObject(value)) {
|
|
306
|
+
forEach(value, (v, k) => {
|
|
307
|
+
if (v) {
|
|
308
|
+
if (urlParams) {
|
|
309
|
+
urlParams += "&";
|
|
310
|
+
}
|
|
311
|
+
urlParams += `${ k }=${ v }`;
|
|
312
|
+
}
|
|
313
|
+
});
|
|
314
|
+
} else if (!isNil(value)) {
|
|
315
|
+
if (urlParams) {
|
|
316
|
+
urlParams += "&";
|
|
317
|
+
}
|
|
318
|
+
urlParams += `${ key }=${ value }`;
|
|
319
|
+
}
|
|
320
|
+
});
|
|
321
|
+
const prefix = urlParams && URL ? URL.indexOf("?") === -1 ? "?" : "&" : "";
|
|
322
|
+
|
|
323
|
+
return `${ URL }${ prefix }${ urlParams }`;
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
export function setUrlForArray({ array, url, id }) {
|
|
327
|
+
if (!array.length) {
|
|
328
|
+
return url;
|
|
329
|
+
}
|
|
330
|
+
let URL = url || "";
|
|
331
|
+
if (id === "fields") {
|
|
332
|
+
if (URL) {
|
|
333
|
+
URL += "&";
|
|
334
|
+
}
|
|
335
|
+
URL += `${ id }=`;
|
|
336
|
+
URL += array.join(",");
|
|
337
|
+
} else {
|
|
338
|
+
forEach(array, v => {
|
|
339
|
+
if (URL) {
|
|
340
|
+
URL += "&";
|
|
341
|
+
}
|
|
342
|
+
URL += `${ id }=${ v }`;
|
|
343
|
+
});
|
|
344
|
+
}
|
|
345
|
+
return URL;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
function setKeyData({ data, keyId }) {
|
|
349
|
+
if (!keyId) {
|
|
350
|
+
return undefined;
|
|
351
|
+
}
|
|
352
|
+
return keyBy(data, keyId);
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
function checkedExpectedList({ expectedList, response }) {
|
|
356
|
+
if (expectedList) {
|
|
357
|
+
if (isArray(response.data)) {
|
|
358
|
+
return response.data;
|
|
359
|
+
}
|
|
360
|
+
return response.data.results ? response.data.results : [];
|
|
361
|
+
}
|
|
362
|
+
return response.data;
|
|
363
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import {
|
|
2
|
+
create,
|
|
3
|
+
setBaseUrl, setErrorCallbacks,
|
|
4
|
+
} from "../compositionAPI/AHttpAPI";
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
install: (app, { axiosCreateOptions = {}, baseUrl = "/api/", errorCallbacks = {} } = {}) => {
|
|
8
|
+
create({ axiosCreateOptions });
|
|
9
|
+
setBaseUrl({ baseUrl });
|
|
10
|
+
setErrorCallbacks({ errorCallbacks });
|
|
11
|
+
},
|
|
12
|
+
};
|
|
File without changes
|
|
@@ -17,14 +17,14 @@
|
|
|
17
17
|
--a_dropdown_padding_y: 0.5rem;
|
|
18
18
|
--bs-dropdown-spacer: 0.125rem;
|
|
19
19
|
--a_dropdown_font_size: 1rem;
|
|
20
|
-
--a_dropdown_color: var(--
|
|
20
|
+
--a_dropdown_color: var(--a_color_text);
|
|
21
21
|
--a_dropdown_bg: #fff;
|
|
22
22
|
--a_dropdown_border_color: var(--a_border_color);
|
|
23
23
|
--a_dropdown_border_radius: var(--a_border_radius);
|
|
24
24
|
--a_dropdown_border_width: var(--a_border_width);
|
|
25
25
|
--a_dropdown_divider_color: var(--a_color_gray_500);
|
|
26
26
|
--a_dropdown_divider_margin_y: 0.5rem;
|
|
27
|
-
--a_dropdown_link_color: var(--
|
|
27
|
+
--a_dropdown_link_color: var(--a_color_text);
|
|
28
28
|
--a_dropdown_link_hover_color: #1e2125;
|
|
29
29
|
--a_dropdown_link_hover_bg: var(--a_color_gray_200);
|
|
30
30
|
--a_dropdown_link_active_color: #fff;
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
.a_tabs {
|
|
2
|
+
--a_tabs_border_width: var(--a_border_width);
|
|
3
|
+
--a_tabs_border_color: var(--a_border_color);
|
|
4
|
+
--a_tabs_link_border_width: var(--a_border_width);
|
|
5
|
+
--a_tabs_link_border_color: transparent transparent var(--a_border_color) transparent;
|
|
6
|
+
--a_tabs_link_color: var(--a_color_text);
|
|
7
|
+
--a_tabs_link_bg: inherit;
|
|
8
|
+
--a_tabs_link_padding_x: 1rem;
|
|
9
|
+
--a_tabs_link_padding_y: .5rem;
|
|
10
|
+
--a_tabs_link_cursor: pointer;
|
|
11
|
+
--a_tabs_font_size: 1rem;
|
|
12
|
+
--a_tabs_border_radius: var(--a_border_radius);
|
|
13
|
+
--a_tabs_link_color_active: var(--a_color_primary);
|
|
14
|
+
--a_tabs_boxed_link_active_border_color: var(--a_border_color) var(--a_border_color) var(--a_color_white) var(--a_border_color);
|
|
15
|
+
--a_tabs_boxed_link_active_bg: var(--a_color_white);
|
|
16
|
+
--a_tabs_boxed_link_active_color: var(--a_color_primary);
|
|
17
|
+
// hover
|
|
18
|
+
--a_tabs_botom_hover_color: var(--a_color_gray_700);
|
|
19
|
+
--a_tabs_link_hover_color: var(--a_color_gray_900);
|
|
20
|
+
--a_tabs_focus_color: var(--a_color_focus);
|
|
21
|
+
--a_tabs_boxed_link_bg_hover: var(--a_color_gray_100);
|
|
22
|
+
|
|
23
|
+
// disabled
|
|
24
|
+
--a_tabs_link_disabled_cursor: default;
|
|
25
|
+
--a_tabs_link_disabled_border_color: transparent transparent var(--a_border_color) transparent;
|
|
26
|
+
--a_tabs_link_disabled_color: var(--a_color_gray_600);
|
|
27
|
+
--a_tabs_link_disabled_bg: inherit;
|
|
28
|
+
|
|
29
|
+
padding: .5rem;
|
|
30
|
+
}
|
|
31
|
+
.a_tabs_small {
|
|
32
|
+
--a_tabs_font_size: .75rem;
|
|
33
|
+
--a_tabs_link_padding_x: 0.75rem;
|
|
34
|
+
--a_tabs_link_padding_y: 0.375rem;
|
|
35
|
+
}
|
|
36
|
+
.a_tabs_medium {
|
|
37
|
+
--a_tabs_font_size: 1.25rem;
|
|
38
|
+
--a_tabs_link_padding_x: 1.25rem;
|
|
39
|
+
--a_tabs_link_padding_y: 0.625rem;
|
|
40
|
+
}
|
|
41
|
+
.a_tabs_large {
|
|
42
|
+
--a_tabs_font_size: 1.5rem;
|
|
43
|
+
--a_tabs_link_padding_x: 1.5rem;
|
|
44
|
+
--a_tabs_link_padding_y: 0.75rem;
|
|
45
|
+
}
|
|
46
|
+
.a_tabs__box {
|
|
47
|
+
align-items: stretch;
|
|
48
|
+
display: flex;
|
|
49
|
+
font-size: var(--a_tabs_font_size);
|
|
50
|
+
justify-content: space-between;
|
|
51
|
+
overflow: hidden;
|
|
52
|
+
overflow-x: auto;
|
|
53
|
+
white-space: nowrap;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.a_tabs__list {
|
|
57
|
+
list-style: none;
|
|
58
|
+
align-items: center;
|
|
59
|
+
border-bottom-color: var(--a_tabs_border_color);
|
|
60
|
+
border-bottom-style: solid;
|
|
61
|
+
border-bottom-width: var(--a_tabs_border_width);
|
|
62
|
+
display: flex;
|
|
63
|
+
flex-grow: 1;
|
|
64
|
+
flex-shrink: 0;
|
|
65
|
+
justify-content: flex-start;
|
|
66
|
+
padding: 0;
|
|
67
|
+
margin: 0;
|
|
68
|
+
}
|
|
69
|
+
.a_tabs__list__item {
|
|
70
|
+
display: block;
|
|
71
|
+
}
|
|
72
|
+
.a_tabs__list__link {
|
|
73
|
+
align-items: center;
|
|
74
|
+
border-width: var(--a_tabs_link_border_width);
|
|
75
|
+
border-color: var(--a_tabs_link_border_color);
|
|
76
|
+
border-style: solid;
|
|
77
|
+
color: var(--a_tabs_link_color);
|
|
78
|
+
display: flex;
|
|
79
|
+
justify-content: center;
|
|
80
|
+
margin-bottom: calc(-1 * var(--a_tabs_border_width));
|
|
81
|
+
padding: var(--a_tabs_link_padding_y) var(--a_tabs_link_padding_x);
|
|
82
|
+
vertical-align: top;
|
|
83
|
+
background-color: var(--a_tabs_link_bg);
|
|
84
|
+
position: relative;
|
|
85
|
+
cursor: var(--a_tabs_link_cursor);
|
|
86
|
+
border-radius: var(--a_tabs_border_radius) var(--a_tabs_border_radius) 0 0;
|
|
87
|
+
&:hover {
|
|
88
|
+
--a_tabs_link_border_color: transparent transparent var(--a_tabs_botom_hover_color) transparent;
|
|
89
|
+
--a_tabs_link_color: var(--a_tabs_link_hover_color);
|
|
90
|
+
}
|
|
91
|
+
&:focus {
|
|
92
|
+
box-shadow: inset 0 0 1px 3px var(--a_tabs_focus_color);
|
|
93
|
+
outline: none;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
.a_tabs__list__link_active {
|
|
97
|
+
--a_tabs_link_border_color: transparent transparent var(--a_color_primary) transparent;
|
|
98
|
+
--a_tabs_link_color: var(--a_tabs_link_color_active);
|
|
99
|
+
z-index: 1;
|
|
100
|
+
&:hover {
|
|
101
|
+
--a_tabs_link_color: var(--a_tabs_link_color_active);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.a_tabs_boxed {
|
|
106
|
+
|
|
107
|
+
//.a_tabs__list__link {
|
|
108
|
+
// &:hover {
|
|
109
|
+
// --a_tabs_link_bg: var(--a_tabs_boxed_link_bg_hover);
|
|
110
|
+
// }
|
|
111
|
+
//
|
|
112
|
+
// //&:focus,
|
|
113
|
+
// //.a_tabs__list__item_active &:focus {
|
|
114
|
+
// //
|
|
115
|
+
// //}
|
|
116
|
+
//}
|
|
117
|
+
.a_tabs__list__link:hover {
|
|
118
|
+
--a_tabs_link_bg: var(--a_tabs_boxed_link_bg_hover);
|
|
119
|
+
}
|
|
120
|
+
.a_tabs__list__link_active {
|
|
121
|
+
--a_tabs_link_border_color: var(--a_tabs_boxed_link_active_border_color);
|
|
122
|
+
--a_tabs_link_bg: var(--a_tabs_boxed_link_active_bg);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.a_tabs {
|
|
127
|
+
& .a_tabs__list__link_disabled,
|
|
128
|
+
&.a_tabs_boxed .a_tabs__list__link_disabled {
|
|
129
|
+
--a_tabs_link_cursor: var(--a_tabs_link_disabled_cursor);
|
|
130
|
+
--a_tabs_link_border_color: var(--a_tabs_link_disabled_border_color);
|
|
131
|
+
--a_tabs_link_color: var(--a_tabs_link_disabled_color);
|
|
132
|
+
--a_tabs_link_bg: var(--a_tabs_link_disabled_bg);
|
|
133
|
+
box-shadow: none;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
.a_tabs__contents {
|
|
137
|
+
border: var(--a_tabs_border_width) solid var(--a_tabs_border_color);
|
|
138
|
+
margin-top: -1px;
|
|
139
|
+
}
|
|
140
|
+
.a_tabs__content {
|
|
141
|
+
padding: var(--a_tabs_link_padding_y) var(--a_tabs_link_padding_x);
|
|
142
|
+
display: none;
|
|
143
|
+
}
|
|
144
|
+
.a_tabs__content_show {
|
|
145
|
+
display: block;
|
|
146
|
+
}
|
package/src/styles/styles.scss
CHANGED