aloha-vue 1.2.74 → 1.2.76
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/src/views/PageConfirm/PageConfirm.js +15 -0
- package/docs/src/views/PageConfirm/PageConfirm.pug +7 -0
- package/package.json +1 -1
- package/src/AMenu2/AMenuPanel/AMenuPanel.js +20 -0
- package/src/AMenu2/AMenuPanel/compositionAPI/HeaderAPI.js +36 -0
- package/src/AMenu2/AMenuPanelLink/AMenuPanelLink.js +1 -1
- package/src/AModal/AModal.js +13 -2
- package/src/AModal/compositionAPI/CloseFromOutsideAPI.js +29 -0
- package/src/AModalConfirm/AModalConfirm.js +15 -1
- package/src/AModalConfirm/compositionAPI/CloseFromOutsideAPI.js +26 -0
- package/src/plugins/AIconPlugin.js +6 -4
- package/src/styles/components/AMenu2.scss +33 -8
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import AModal from "../../../../src/AModal/AModal";
|
|
2
2
|
|
|
3
3
|
import AConfirmAPI from "../../../../src/compositionAPI/AConfirmAPI";
|
|
4
|
+
import EventBus from "../../../../src/utils/EventBus";
|
|
4
5
|
|
|
5
6
|
export default {
|
|
6
7
|
name: "PageConfirm",
|
|
@@ -30,8 +31,22 @@ export default {
|
|
|
30
31
|
});
|
|
31
32
|
};
|
|
32
33
|
|
|
34
|
+
const openConfirmWithTimeout = () => {
|
|
35
|
+
openConfirm({
|
|
36
|
+
headerText: "Aloha",
|
|
37
|
+
bodyHtml: "<div>Aloha <strong>Hola</strong></div>",
|
|
38
|
+
save: save,
|
|
39
|
+
selectorClose: "#btn_confirm_timeout",
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
setTimeout(() => {
|
|
43
|
+
EventBus.$emit("closeModalConfirm");
|
|
44
|
+
}, 5000);
|
|
45
|
+
};
|
|
46
|
+
|
|
33
47
|
return {
|
|
34
48
|
openConfirmLocal,
|
|
49
|
+
openConfirmWithTimeout,
|
|
35
50
|
};
|
|
36
51
|
},
|
|
37
52
|
};
|
package/package.json
CHANGED
|
@@ -6,8 +6,10 @@ import {
|
|
|
6
6
|
|
|
7
7
|
import AMenuBreadcrumbs from "../AMenuBreadcrumbs/AMenuBreadcrumbs";
|
|
8
8
|
import AMenuPanelGroup from "../AMenuPanelGroup/AMenuPanelGroup";
|
|
9
|
+
import ATranslation from "../../ATranslation/ATranslation";
|
|
9
10
|
|
|
10
11
|
import GroupAPI from "./compositionAPI/GroupAPI";
|
|
12
|
+
import HeaderAPI from "./compositionAPI/HeaderAPI";
|
|
11
13
|
import IdAPI from "./compositionAPI/IdAPI";
|
|
12
14
|
import LevelAPI from "./compositionAPI/LevelAPI";
|
|
13
15
|
import PanelOpenAPI from "./compositionAPI/PanelOpenAPI";
|
|
@@ -103,15 +105,24 @@ export default {
|
|
|
103
105
|
openedLevelIndex,
|
|
104
106
|
});
|
|
105
107
|
|
|
108
|
+
const {
|
|
109
|
+
isHeaderPanelVisible,
|
|
110
|
+
parentLabel,
|
|
111
|
+
} = HeaderAPI(props, {
|
|
112
|
+
openedLevelIndex,
|
|
113
|
+
});
|
|
114
|
+
|
|
106
115
|
provide("isChildPanelOpen", isChildPanelOpen);
|
|
107
116
|
provide("isPanelMain", isPanelMain);
|
|
108
117
|
|
|
109
118
|
return {
|
|
110
119
|
isChildPanelOpen,
|
|
120
|
+
isHeaderPanelVisible,
|
|
111
121
|
isItemsWithoutGroup,
|
|
112
122
|
isPanelOpen,
|
|
113
123
|
itemsGroup,
|
|
114
124
|
panelId,
|
|
125
|
+
parentLabel,
|
|
115
126
|
styleZIndex,
|
|
116
127
|
};
|
|
117
128
|
},
|
|
@@ -135,6 +146,15 @@ export default {
|
|
|
135
146
|
isSearchActive: this.isSearchActive,
|
|
136
147
|
panelParentsOpen: this.panelParentsOpen,
|
|
137
148
|
}),
|
|
149
|
+
(this.isHeaderPanelVisible) && h("div", {
|
|
150
|
+
class: "a_menu_2__panel_header",
|
|
151
|
+
}, [
|
|
152
|
+
h(ATranslation, {
|
|
153
|
+
class: "a_menu_2__panel_header__text",
|
|
154
|
+
html: this.parentLabel,
|
|
155
|
+
tag: "strong",
|
|
156
|
+
}),
|
|
157
|
+
]),
|
|
138
158
|
h("ul", {
|
|
139
159
|
class: "a_menu_2__listview",
|
|
140
160
|
}, [
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import {
|
|
2
|
+
computed,
|
|
3
|
+
inject,
|
|
4
|
+
toRef,
|
|
5
|
+
} from "vue";
|
|
6
|
+
|
|
7
|
+
import AKeyLabel from "../../../const/AKeyLabel";
|
|
8
|
+
|
|
9
|
+
import {
|
|
10
|
+
get,
|
|
11
|
+
} from "lodash-es";
|
|
12
|
+
|
|
13
|
+
export default function HeaderAPI(props, {
|
|
14
|
+
openedLevelIndex = computed(() => 0),
|
|
15
|
+
}) {
|
|
16
|
+
const dataKeyById = toRef(props, "dataKeyById");
|
|
17
|
+
const isPanelMain = toRef(props, "isPanelMain");
|
|
18
|
+
const parentId = toRef(props, "parentId");
|
|
19
|
+
|
|
20
|
+
const isMenuOpen = inject("isMenuOpen");
|
|
21
|
+
|
|
22
|
+
const isHeaderPanelVisible = computed(() => {
|
|
23
|
+
return !isPanelMain.value &&
|
|
24
|
+
!isMenuOpen.value &&
|
|
25
|
+
openedLevelIndex.value === 0;
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
const parentLabel = computed(() => {
|
|
29
|
+
return get(dataKeyById.value, `${ parentId.value }.${ AKeyLabel }`);
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
return {
|
|
33
|
+
isHeaderPanelVisible,
|
|
34
|
+
parentLabel,
|
|
35
|
+
};
|
|
36
|
+
}
|
package/src/AModal/AModal.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
h,
|
|
3
|
+
onBeforeUnmount,
|
|
3
4
|
onMounted,
|
|
4
5
|
onUnmounted,
|
|
5
6
|
Teleport,
|
|
@@ -10,6 +11,7 @@ import {
|
|
|
10
11
|
import AButton from "../AButton/AButton";
|
|
11
12
|
import ATranslation from "../ATranslation/ATranslation";
|
|
12
13
|
|
|
14
|
+
import CloseFromOutsideAPI from "./compositionAPI/CloseFromOutsideAPI";
|
|
13
15
|
import DisabledAPI from "./compositionAPI/DisabledAPI";
|
|
14
16
|
import EscapeAPI from "./compositionAPI/EscapeAPI";
|
|
15
17
|
import FocusAPI from "./compositionAPI/FocusAPI";
|
|
@@ -167,6 +169,11 @@ export default {
|
|
|
167
169
|
setup(props) {
|
|
168
170
|
const isModalHidden = toRef(props, "isModalHidden");
|
|
169
171
|
|
|
172
|
+
const {
|
|
173
|
+
destroyEventBusCloseFromOutside,
|
|
174
|
+
initEventBusCloseFromOutside,
|
|
175
|
+
} = CloseFromOutsideAPI(props);
|
|
176
|
+
|
|
170
177
|
const {
|
|
171
178
|
sizeClass,
|
|
172
179
|
} = SizeAPI(props);
|
|
@@ -220,10 +227,16 @@ export default {
|
|
|
220
227
|
}
|
|
221
228
|
});
|
|
222
229
|
|
|
230
|
+
initEventBusCloseFromOutside();
|
|
231
|
+
|
|
223
232
|
onMounted(() => {
|
|
224
233
|
showModal();
|
|
225
234
|
});
|
|
226
235
|
|
|
236
|
+
onBeforeUnmount(() => {
|
|
237
|
+
destroyEventBusCloseFromOutside();
|
|
238
|
+
});
|
|
239
|
+
|
|
227
240
|
onUnmounted(() => {
|
|
228
241
|
hideModal();
|
|
229
242
|
});
|
|
@@ -236,8 +249,6 @@ export default {
|
|
|
236
249
|
sizeClass,
|
|
237
250
|
};
|
|
238
251
|
},
|
|
239
|
-
computed: {
|
|
240
|
-
},
|
|
241
252
|
render() {
|
|
242
253
|
return h(Teleport, {
|
|
243
254
|
to: "body",
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import {
|
|
2
|
+
toRef,
|
|
3
|
+
} from "vue";
|
|
4
|
+
|
|
5
|
+
import EventBus from "../../utils/EventBus";
|
|
6
|
+
|
|
7
|
+
export default function CloseFromOutsideAPI(props) {
|
|
8
|
+
const close = toRef(props, "close");
|
|
9
|
+
const isConfirm = toRef(props, "isConfirm");
|
|
10
|
+
|
|
11
|
+
const closeModalFromOutside = () => {
|
|
12
|
+
if (!isConfirm.value) {
|
|
13
|
+
close.value();
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
const initEventBusCloseFromOutside = () => {
|
|
18
|
+
EventBus.$on("closeModal", closeModalFromOutside);
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const destroyEventBusCloseFromOutside = () => {
|
|
22
|
+
EventBus.$off("closeModal", closeModalFromOutside);
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
return {
|
|
26
|
+
destroyEventBusCloseFromOutside,
|
|
27
|
+
initEventBusCloseFromOutside,
|
|
28
|
+
};
|
|
29
|
+
}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
computed,
|
|
3
|
-
h,
|
|
3
|
+
h, onBeforeUnmount,
|
|
4
4
|
} from "vue";
|
|
5
5
|
|
|
6
6
|
import AModal from "../AModal/AModal";
|
|
7
7
|
|
|
8
8
|
import AConfirmAPI from "../compositionAPI/AConfirmAPI";
|
|
9
|
+
import CloseFromOutsideAPI from "./compositionAPI/CloseFromOutsideAPI";
|
|
9
10
|
|
|
10
11
|
// @vue/component
|
|
11
12
|
export default {
|
|
@@ -17,6 +18,13 @@ export default {
|
|
|
17
18
|
isModalHidden,
|
|
18
19
|
} = AConfirmAPI();
|
|
19
20
|
|
|
21
|
+
const {
|
|
22
|
+
destroyEventBusCloseFromOutside,
|
|
23
|
+
initEventBusCloseFromOutside,
|
|
24
|
+
} = CloseFromOutsideAPI({
|
|
25
|
+
isModalHidden,
|
|
26
|
+
});
|
|
27
|
+
|
|
20
28
|
const modalProps = computed(() => {
|
|
21
29
|
return {
|
|
22
30
|
isModalHidden: isModalHidden.value,
|
|
@@ -26,6 +34,12 @@ export default {
|
|
|
26
34
|
};
|
|
27
35
|
});
|
|
28
36
|
|
|
37
|
+
initEventBusCloseFromOutside();
|
|
38
|
+
|
|
39
|
+
onBeforeUnmount(() => {
|
|
40
|
+
destroyEventBusCloseFromOutside();
|
|
41
|
+
});
|
|
42
|
+
|
|
29
43
|
return {
|
|
30
44
|
modalProps,
|
|
31
45
|
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ref,
|
|
3
|
+
} from "vue";
|
|
4
|
+
|
|
5
|
+
import EventBus from "../../utils/EventBus";
|
|
6
|
+
|
|
7
|
+
export default function CloseFromOutsideAPI({
|
|
8
|
+
isModalHidden = ref(false),
|
|
9
|
+
}) {
|
|
10
|
+
const closeModalFromOutside = () => {
|
|
11
|
+
isModalHidden.value = true;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const initEventBusCloseFromOutside = () => {
|
|
15
|
+
EventBus.$on("closeModalConfirm", closeModalFromOutside);
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
const destroyEventBusCloseFromOutside = () => {
|
|
19
|
+
EventBus.$off("closeModalConfirm", closeModalFromOutside);
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
return {
|
|
23
|
+
destroyEventBusCloseFromOutside,
|
|
24
|
+
initEventBusCloseFromOutside,
|
|
25
|
+
};
|
|
26
|
+
}
|
|
@@ -18,6 +18,7 @@ import CheckLg from "../AIcon/Icons/CheckLg";
|
|
|
18
18
|
import ChevronDown from "../AIcon/Icons/ChevronDown";
|
|
19
19
|
import ChevronLeft from "../AIcon/Icons/ChevronLeft";
|
|
20
20
|
import ChevronRight from "../AIcon/Icons/ChevronRight";
|
|
21
|
+
import ChevronRightThin from "../AIcon/Icons/bootstrap-1-9-1/ChevronRight";
|
|
21
22
|
import ChevronUp from "../AIcon/Icons/ChevronUp";
|
|
22
23
|
import Close from "../AIcon/Icons/Close";
|
|
23
24
|
import Cog from "../AIcon/Icons/Cog";
|
|
@@ -48,11 +49,12 @@ import Trash from "../AIcon/Icons/Trash";
|
|
|
48
49
|
|
|
49
50
|
export const iconPluginOptions = ref({
|
|
50
51
|
icons: {
|
|
51
|
-
|
|
52
|
+
_NoImage,
|
|
52
53
|
AlertDanger,
|
|
53
|
-
AlertSuccess,
|
|
54
54
|
AlertInfo,
|
|
55
|
+
AlertSuccess,
|
|
55
56
|
AlertWarning,
|
|
57
|
+
Aloha,
|
|
56
58
|
AngleDown,
|
|
57
59
|
AngleLeft,
|
|
58
60
|
AngleRight,
|
|
@@ -64,8 +66,8 @@ export const iconPluginOptions = ref({
|
|
|
64
66
|
ChevronLeft,
|
|
65
67
|
ChevronRight,
|
|
66
68
|
ChevronUp,
|
|
67
|
-
Cog,
|
|
68
69
|
Close,
|
|
70
|
+
Cog,
|
|
69
71
|
Cross,
|
|
70
72
|
Dnd,
|
|
71
73
|
DoubleAngleDown,
|
|
@@ -78,6 +80,7 @@ export const iconPluginOptions = ref({
|
|
|
78
80
|
FloppyDisk,
|
|
79
81
|
Home,
|
|
80
82
|
Lock,
|
|
83
|
+
MenuChevronRight: ChevronRightThin,
|
|
81
84
|
Minus,
|
|
82
85
|
Ok,
|
|
83
86
|
OptionHorizontal,
|
|
@@ -90,7 +93,6 @@ export const iconPluginOptions = ref({
|
|
|
90
93
|
ThList,
|
|
91
94
|
ThreeDots,
|
|
92
95
|
Trash,
|
|
93
|
-
_NoImage,
|
|
94
96
|
},
|
|
95
97
|
});
|
|
96
98
|
|
|
@@ -24,28 +24,38 @@
|
|
|
24
24
|
--a_menu_2_panel_iconpanel_size: var(--a_menu_2_width_collapsed);
|
|
25
25
|
--a_menu_2_panel_color: var(--a_color_gray_600);
|
|
26
26
|
--a_menu_2_link_color: var(--a_color_gray_900);
|
|
27
|
+
--a_menu_2_link_hover_color: var(--a_color_gray_900);
|
|
28
|
+
--a_menu_2_link_hover_bg: var(--a_color_gray_200);
|
|
27
29
|
--a_menu_2_listitem_padding: .3rem;
|
|
28
30
|
--a_menu_2_listitem_panel_secondary_padding_x: .6rem;
|
|
29
31
|
--a_menu_2_listitem_panel_secondary_padding_y: .3rem;
|
|
30
32
|
--a_menu_2_link_padding_x: .7rem;
|
|
31
|
-
--a_menu_2_link_padding_y: .
|
|
33
|
+
--a_menu_2_link_padding_y: .5rem;
|
|
32
34
|
--a_menu_2_link_selected_bg: var(--a_color_gray_200);
|
|
33
35
|
--a_menu_2_link_selected_color: inherit;
|
|
34
36
|
--a_menu_2_link_border_color: transparent;
|
|
35
37
|
--a_menu_2_link_border_radius: .3rem;
|
|
38
|
+
--a_menu_2_link_focus_size: 0 0 1px 3px;
|
|
36
39
|
--a_menu_2_icon_color: var(--a_menu_2_link_color);
|
|
37
|
-
--
|
|
40
|
+
--a_menu_2_focus_shadow_color: var(--a_color_focus);
|
|
38
41
|
--a_menu_2_list_header_bg: var(--a_color_gray_200);
|
|
39
|
-
--a_menu_2_breadcrumb_min_height:
|
|
42
|
+
--a_menu_2_breadcrumb_min_height: 65px;
|
|
40
43
|
--a_menu_2_breadcrumb_border_bottom_width: 1px;
|
|
41
44
|
--a_menu_2_submenu_open_bg: var(--a_color_primary);
|
|
42
45
|
--a_menu_2_submenu_open_color: var(--a_color_white);
|
|
43
46
|
--a_menu_2_submenu_border_radius: 1rem;
|
|
44
47
|
--a_menu_2_submenu_border_width: 2px;
|
|
45
48
|
--a_menu_2_search_height: 50px;
|
|
49
|
+
--a_menu_2_search_link_focus_size: inset 0 0 1px 2px;
|
|
46
50
|
--a_menu_2_close_panel_width: 300px;
|
|
47
51
|
--a_menu_2_close_panel_max_height: 400px;
|
|
48
52
|
--a_menu_2_close_panel_border_radius: .3rem;
|
|
53
|
+
--a_menu_2_close_panel_box_shadow_color: var(--a_color_gray_600);
|
|
54
|
+
--a_menu_2_close_panel_box_shadow_size: 0 0 7px 3px;
|
|
55
|
+
--a_menu_2_close_panel_header_color: var(--a_color_gray_900);
|
|
56
|
+
--a_menu_2_close_panel_header_border_bottom_color: var(--a_color_gray_600);
|
|
57
|
+
--a_menu_2_close_panel_header_border_bottom_width: 1px;
|
|
58
|
+
--a_menu_2_link_line_horizontal_display: none;
|
|
49
59
|
|
|
50
60
|
width: var(--a_menu_2_width);
|
|
51
61
|
position: absolute;
|
|
@@ -101,7 +111,7 @@
|
|
|
101
111
|
border-color: inherit;
|
|
102
112
|
border-bottom-width: 1px;
|
|
103
113
|
border-bottom-style: solid;
|
|
104
|
-
display:
|
|
114
|
+
display: var(--a_menu_2_link_line_horizontal_display);
|
|
105
115
|
position: absolute;
|
|
106
116
|
inset-inline-start: 20px;
|
|
107
117
|
inset-inline-end: 0;
|
|
@@ -135,11 +145,15 @@
|
|
|
135
145
|
text-decoration: none;
|
|
136
146
|
color: var(--a_menu_2_link_color);
|
|
137
147
|
}
|
|
138
|
-
&:focus
|
|
148
|
+
&:focus {
|
|
149
|
+
outline: 0;
|
|
150
|
+
box-shadow: var(--a_menu_2_link_focus_size) var(--a_menu_2_focus_shadow_color);
|
|
151
|
+
color: var(--a_menu_2_link_color);
|
|
152
|
+
}
|
|
139
153
|
&:hover {
|
|
140
154
|
outline: 0;
|
|
141
|
-
box-shadow: inset 0 0 1px 4px var(--a_menu_2_icon_focus_shadow_color);
|
|
142
155
|
color: var(--a_menu_2_link_color);
|
|
156
|
+
background-color: var(--a_menu_2_link_hover_bg);
|
|
143
157
|
}
|
|
144
158
|
&.a_menu_2__link_active {
|
|
145
159
|
--a_menu_2_icon_color: var(--a_menu_2_submenu_open_bg);
|
|
@@ -480,7 +494,8 @@
|
|
|
480
494
|
top: auto;
|
|
481
495
|
border: none;
|
|
482
496
|
border-radius: var(--a_menu_2_close_panel_border_radius);
|
|
483
|
-
|
|
497
|
+
// Aloha
|
|
498
|
+
box-shadow: var(--a_menu_2_close_panel_box_shadow_size) var(--a_color_gray_600);
|
|
484
499
|
max-height: var(--a_menu_2_close_panel_max_height);
|
|
485
500
|
overflow-y: auto;
|
|
486
501
|
z-index: 2;
|
|
@@ -545,7 +560,7 @@
|
|
|
545
560
|
padding: 0.2rem 0.3rem;
|
|
546
561
|
&:focus,
|
|
547
562
|
&:hover {
|
|
548
|
-
box-shadow:
|
|
563
|
+
box-shadow: var(--a_menu_2_search_link_focus_size) var(--a_menu_2_focus_shadow_color);
|
|
549
564
|
}
|
|
550
565
|
}
|
|
551
566
|
.a_menu_2__breadcrumbs__item__divider {
|
|
@@ -568,4 +583,14 @@
|
|
|
568
583
|
.a_menu_2__breadcrumb__ul_truncated__dropdown {
|
|
569
584
|
padding: .2rem;
|
|
570
585
|
min-width: auto;
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
.a_menu_2__panel_header {
|
|
589
|
+
color: var(--a_menu_2_close_panel_header_color);
|
|
590
|
+
border-bottom: var(--a_menu_2_close_panel_header_border_bottom_width) solid var(--a_menu_2_close_panel_header_border_bottom_color);
|
|
591
|
+
padding: var(--a_menu_2_listitem_panel_secondary_padding_y) var(--a_menu_2_listitem_panel_secondary_padding_x);
|
|
592
|
+
}
|
|
593
|
+
.a_menu_2__panel_header__text {
|
|
594
|
+
display: inline-block;
|
|
595
|
+
padding: var(--a_menu_2_link_padding_y) var(--a_menu_2_link_padding_x);
|
|
571
596
|
}
|