nuxt-ui-tools 1.16.4 → 1.16.5
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/dist/module.json
CHANGED
|
@@ -31,6 +31,7 @@ const {
|
|
|
31
31
|
{ omit: ["createItem", "max", "searchable", "clearable"] }
|
|
32
32
|
);
|
|
33
33
|
const searchTerm = ref("");
|
|
34
|
+
const open = ref(false);
|
|
34
35
|
const model = computed({
|
|
35
36
|
get: () => {
|
|
36
37
|
const value = form.getValue(props.path);
|
|
@@ -76,8 +77,9 @@ watch(searchTerm, (term) => {
|
|
|
76
77
|
options.setSearch(term);
|
|
77
78
|
}
|
|
78
79
|
});
|
|
79
|
-
function handleOpen(
|
|
80
|
-
|
|
80
|
+
function handleOpen(next) {
|
|
81
|
+
open.value = next;
|
|
82
|
+
if (next) {
|
|
81
83
|
options.activate();
|
|
82
84
|
}
|
|
83
85
|
}
|
|
@@ -85,7 +87,11 @@ async function handleCreate(label) {
|
|
|
85
87
|
await options.create(label);
|
|
86
88
|
}
|
|
87
89
|
async function handleCreateAction() {
|
|
88
|
-
|
|
90
|
+
const label = searchTerm.value.trim() || void 0;
|
|
91
|
+
if (!fieldProps.value.multiple) {
|
|
92
|
+
open.value = false;
|
|
93
|
+
}
|
|
94
|
+
await options.create(label);
|
|
89
95
|
}
|
|
90
96
|
async function handleNativeCreate(label) {
|
|
91
97
|
const normalizedLabel = label.trim();
|
|
@@ -107,6 +113,7 @@ function isOptionValue(value) {
|
|
|
107
113
|
v-if="bare"
|
|
108
114
|
v-model="model"
|
|
109
115
|
v-model:search-term="searchTerm"
|
|
116
|
+
:open="open"
|
|
110
117
|
v-bind="controlProps"
|
|
111
118
|
class="w-full"
|
|
112
119
|
value-key="value"
|
|
@@ -152,6 +159,7 @@ function isOptionValue(value) {
|
|
|
152
159
|
<USelectMenu
|
|
153
160
|
v-model="model"
|
|
154
161
|
v-model:search-term="searchTerm"
|
|
162
|
+
:open="open"
|
|
155
163
|
v-bind="controlProps"
|
|
156
164
|
class="w-full"
|
|
157
165
|
value-key="value"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nuxt-ui-tools",
|
|
3
|
-
"version": "1.16.
|
|
3
|
+
"version": "1.16.5",
|
|
4
4
|
"description": "Nuxt module and runtime toolkit for UI-heavy Nuxt applications",
|
|
5
5
|
"homepage": "https://github.com/ChronicStone/nuxt-ui-tools#readme",
|
|
6
6
|
"bugs": "https://github.com/ChronicStone/nuxt-ui-tools/issues",
|