aloha-vue 1.0.308 → 1.0.310
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/PageSelect/PageSelect.js +1 -1
- package/docs/src/views/PageSelect/PageSelect.pug +16 -13
- package/docs/src/views/PageTinyMce/PageTinyMce.js +6 -0
- package/docs/src/views/PageTinyMce/PageTinyMce.pug +9 -0
- package/package.json +1 -1
- package/src/styles/components/ui/ASelect.scss +9 -3
- package/src/ui/ASelect/ASelect.js +24 -7
- package/src/ui/ASelect/compositionAPI/ASelectToggleAPI.js +20 -18
- package/src/ui/ATinymce/compositionAPI/ATinymceAPI.js +5 -0
|
@@ -37,7 +37,7 @@ export default {
|
|
|
37
37
|
group: "group 2",
|
|
38
38
|
},
|
|
39
39
|
{
|
|
40
|
-
label: "
|
|
40
|
+
label: "AlohaAlohaAlohaAlohaAlohaAlohaAl ohaAlohaAlohaAlohaAlohaAloha AlohaAlohaAlohaAlohaAlohaAlohaAloha 6",
|
|
41
41
|
id: "aloha_6",
|
|
42
42
|
group: "group 2",
|
|
43
43
|
},
|
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
div
|
|
2
2
|
h1 ASelect
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
3
|
+
.a_columns.a_columns_count_12
|
|
4
|
+
.a_column.a_column_6
|
|
5
|
+
a-select(
|
|
6
|
+
v-model="model"
|
|
7
|
+
:data="data"
|
|
8
|
+
key-id="id"
|
|
9
|
+
key-label="label"
|
|
10
|
+
label="Test label"
|
|
11
|
+
type="select"
|
|
12
|
+
:search="true"
|
|
13
|
+
key-group="group"
|
|
14
|
+
sort-order-group="desc"
|
|
15
|
+
:is-menu-width-as-button="false"
|
|
16
|
+
menu-width-type="by_content"
|
|
17
|
+
)
|
|
18
|
+
div model: {{ model }}
|
|
16
19
|
a-select(
|
|
17
20
|
v-model="model"
|
|
18
21
|
:data="data"
|
package/package.json
CHANGED
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
--a_select_divider_bg: var(--a_color_gray_300);
|
|
36
36
|
--a_select_border_radius: var(--a_border_radius);
|
|
37
37
|
--a_select_menu_max_height: 250px;
|
|
38
|
+
--a_select_menu_max_width: 400px;
|
|
38
39
|
--a_select_menu_link_color: var(--a_color_text);
|
|
39
40
|
--a_select_menu_link_hover_color: var(--a_color_text);
|
|
40
41
|
--a_select_menu_link_hover_bg: var(--a_color_gray_200);
|
|
@@ -43,7 +44,7 @@
|
|
|
43
44
|
display: block;
|
|
44
45
|
position: relative;
|
|
45
46
|
min-width: 200px;
|
|
46
|
-
max-width:
|
|
47
|
+
max-width: var(--a_select_menu_max_width);
|
|
47
48
|
z-index: 1055;
|
|
48
49
|
background-color: #fff;
|
|
49
50
|
border: 1px solid grey;
|
|
@@ -54,6 +55,12 @@
|
|
|
54
55
|
pointer-events: none !important;
|
|
55
56
|
}
|
|
56
57
|
}
|
|
58
|
+
.a_select_menu_by_content {
|
|
59
|
+
--a_select_menu_max_width: 100vw;
|
|
60
|
+
.a_select__menu__link {
|
|
61
|
+
white-space: nowrap;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
57
64
|
.a_select_menu_right {
|
|
58
65
|
right: 0;
|
|
59
66
|
left: auto;
|
|
@@ -79,8 +86,7 @@
|
|
|
79
86
|
|
|
80
87
|
.a_select__menu__link {
|
|
81
88
|
position: relative;
|
|
82
|
-
|
|
83
|
-
display: inline-block;
|
|
89
|
+
display: block;
|
|
84
90
|
text-align: left;
|
|
85
91
|
padding: 2px 4px 2px 25px;
|
|
86
92
|
border: none;
|
|
@@ -26,9 +26,10 @@ import ASelectModelChangeAPI from "./compositionAPI/ASelectModelChangeAPI";
|
|
|
26
26
|
import ASelectSearchAPI from "./compositionAPI/ASelectSearchAPI";
|
|
27
27
|
import ASelectSelectedTitleAPI from "./compositionAPI/ASelectSelectedTitleAPI";
|
|
28
28
|
import ASelectToggleAPI from "./compositionAPI/ASelectToggleAPI";
|
|
29
|
+
import PopperContainerAPI from "../../ATooltip/compositionAPI/PopperContainerAPI";
|
|
29
30
|
import UiAPI from "../compositionApi/UiAPI";
|
|
30
|
-
import UiDataWithKeyIdAndLabelAPI from "../compositionApi/UiDataWithKeyIdAndLabelAPI";
|
|
31
31
|
import UiDataWatchEmitAPI from "../compositionApi/UiDataWatchEmitAPI";
|
|
32
|
+
import UiDataWithKeyIdAndLabelAPI from "../compositionApi/UiDataWithKeyIdAndLabelAPI";
|
|
32
33
|
import UiStyleHideAPI from "../compositionApi/UiStyleHideAPI";
|
|
33
34
|
|
|
34
35
|
import AKeyId from "../const/AKeyId";
|
|
@@ -75,11 +76,7 @@ export default {
|
|
|
75
76
|
type: Boolean,
|
|
76
77
|
required: false,
|
|
77
78
|
},
|
|
78
|
-
|
|
79
|
-
type: Boolean,
|
|
80
|
-
required: false,
|
|
81
|
-
default: true,
|
|
82
|
-
},
|
|
79
|
+
|
|
83
80
|
isSelectAll: {
|
|
84
81
|
type: Boolean,
|
|
85
82
|
required: false,
|
|
@@ -183,6 +180,17 @@ export default {
|
|
|
183
180
|
default: "select",
|
|
184
181
|
validator: value => ["select", "multiselect"].indexOf(value) !== -1,
|
|
185
182
|
},
|
|
183
|
+
popperContainerId: {
|
|
184
|
+
type: String,
|
|
185
|
+
required: false,
|
|
186
|
+
default: "a_select_container",
|
|
187
|
+
},
|
|
188
|
+
menuWidthType: {
|
|
189
|
+
type: String,
|
|
190
|
+
required: false,
|
|
191
|
+
default: "as_button",
|
|
192
|
+
validator: value => ["as_button", "by_content"].indexOf(value) !== -1,
|
|
193
|
+
},
|
|
186
194
|
},
|
|
187
195
|
emits: [
|
|
188
196
|
"onSearchOutside",
|
|
@@ -211,6 +219,11 @@ export default {
|
|
|
211
219
|
dataLocal,
|
|
212
220
|
} = UiDataWithKeyIdAndLabelAPI(props);
|
|
213
221
|
|
|
222
|
+
const {
|
|
223
|
+
addPopperContainerInBody,
|
|
224
|
+
popperContainerIdSelector,
|
|
225
|
+
} = PopperContainerAPI(props);
|
|
226
|
+
|
|
214
227
|
UiDataWatchEmitAPI(props, context, {
|
|
215
228
|
dataKeyByKeyIdLocal,
|
|
216
229
|
});
|
|
@@ -338,7 +351,10 @@ export default {
|
|
|
338
351
|
return ATTRIBUTES;
|
|
339
352
|
});
|
|
340
353
|
|
|
354
|
+
addPopperContainerInBody();
|
|
355
|
+
|
|
341
356
|
return {
|
|
357
|
+
popperContainerIdSelector,
|
|
342
358
|
componentStyleHide,
|
|
343
359
|
|
|
344
360
|
ariaDescribedbyLocal,
|
|
@@ -495,7 +511,7 @@ export default {
|
|
|
495
511
|
}, this.$slots)
|
|
496
512
|
: "",
|
|
497
513
|
h(Teleport, {
|
|
498
|
-
to:
|
|
514
|
+
to: this.popperContainerIdSelector,
|
|
499
515
|
}, [
|
|
500
516
|
h("div", {
|
|
501
517
|
ref: "menuParentRef",
|
|
@@ -507,6 +523,7 @@ export default {
|
|
|
507
523
|
ref: "menuRef",
|
|
508
524
|
class: ["a_select_menu", {
|
|
509
525
|
a_select_menu_right: this.menuRightLocal,
|
|
526
|
+
a_select_menu_by_content: this.menuWidthType === "by_content",
|
|
510
527
|
}],
|
|
511
528
|
role: "listbox",
|
|
512
529
|
ariaLabelledby: this.htmlIdLocal,
|
|
@@ -103,9 +103,9 @@ export default function ASelectToggleAPI(props, {
|
|
|
103
103
|
emit("open");
|
|
104
104
|
};
|
|
105
105
|
|
|
106
|
-
const
|
|
106
|
+
const menuWidthType = toRef(props, "menuWidthType");
|
|
107
107
|
const setMenuWidth = () => {
|
|
108
|
-
if (
|
|
108
|
+
if (menuWidthType.value === "as_button") {
|
|
109
109
|
const BUTTON_WIDTH = buttonRef.value.clientWidth;
|
|
110
110
|
const BUTTON_WIDTH_STRING = `${ BUTTON_WIDTH }px`;
|
|
111
111
|
menuRef.value.style.minWidth = BUTTON_WIDTH_STRING;
|
|
@@ -141,23 +141,25 @@ export default function ASelectToggleAPI(props, {
|
|
|
141
141
|
const placement = toRef(props, "placement");
|
|
142
142
|
const openPopoverWithPopperjs = () => {
|
|
143
143
|
if (!popper.value) {
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
144
|
+
setTimeout(() => {
|
|
145
|
+
popper.value = createPopper(
|
|
146
|
+
buttonRef.value,
|
|
147
|
+
menuRef.value,
|
|
148
|
+
{
|
|
149
|
+
placement: placement.value,
|
|
150
|
+
removeOnDestroy: true,
|
|
151
|
+
modifiers: [
|
|
152
|
+
{
|
|
153
|
+
name: "offset",
|
|
154
|
+
options: {
|
|
155
|
+
offset: [0, 0],
|
|
156
|
+
},
|
|
155
157
|
},
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
158
|
+
],
|
|
159
|
+
},
|
|
160
|
+
);
|
|
161
|
+
onShow();
|
|
162
|
+
});
|
|
161
163
|
}
|
|
162
164
|
};
|
|
163
165
|
|
|
@@ -52,6 +52,7 @@ export default function ATinymceAPI(props, context, {
|
|
|
52
52
|
const promotion = toRef(props, "promotion");
|
|
53
53
|
const toolbar = toRef(props, "toolbar");
|
|
54
54
|
const toolbarMode = toRef(props, "toolbarMode");
|
|
55
|
+
const modelValue = toRef(props, "modelValue");
|
|
55
56
|
|
|
56
57
|
let vueEditor = null;
|
|
57
58
|
|
|
@@ -92,6 +93,10 @@ export default function ATinymceAPI(props, context, {
|
|
|
92
93
|
}
|
|
93
94
|
});
|
|
94
95
|
|
|
96
|
+
watch(modelValue, newValue => {
|
|
97
|
+
tinymce.get(htmlIdLocal.value).setContent(newValue);
|
|
98
|
+
});
|
|
99
|
+
|
|
95
100
|
onBeforeUnmount(() => {
|
|
96
101
|
tinymce.remove(vueEditor);
|
|
97
102
|
});
|