@signal24/vue-foundation 4.19.0 → 4.19.2
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/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@signal24/vue-foundation",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "4.19.
|
|
4
|
+
"version": "4.19.2",
|
|
5
5
|
"description": "Common components, directives, and helpers for Vue 3 apps",
|
|
6
6
|
"module": "./dist/vue-foundation.es.js",
|
|
7
7
|
"exports": {
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"uuid": "^11.0.3"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
|
-
"@signal24/openapi-client-codegen": "^2.1.
|
|
40
|
+
"@signal24/openapi-client-codegen": "^2.1.1",
|
|
41
41
|
"date-fns": "^3.0.6",
|
|
42
42
|
"lodash": "^4.17.21",
|
|
43
43
|
"vue": "^3.4.0"
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@eslint/js": "9.14.0",
|
|
47
47
|
"@nabla/vite-plugin-eslint": "^2.0.4",
|
|
48
|
-
"@signal24/openapi-client-codegen": "^2.1.
|
|
48
|
+
"@signal24/openapi-client-codegen": "^2.1.1",
|
|
49
49
|
"@tsconfig/node22": "^22.0.0",
|
|
50
50
|
"@types/eslint__js": "^8.42.3",
|
|
51
51
|
"@types/jsdom": "^21.1.7",
|
|
@@ -81,6 +81,7 @@ const props = defineProps<{
|
|
|
81
81
|
optionsListId?: string;
|
|
82
82
|
debug?: boolean;
|
|
83
83
|
required?: boolean;
|
|
84
|
+
showCreateTextOnNewItem?: boolean;
|
|
84
85
|
}>();
|
|
85
86
|
|
|
86
87
|
const emit = defineEmits<{
|
|
@@ -106,6 +107,7 @@ const selectedOptionTitle = ref<string | null>(null);
|
|
|
106
107
|
const shouldDisplayOptions = ref(false);
|
|
107
108
|
const highlightedOptionKey = ref<string | symbol | null>(null);
|
|
108
109
|
const shouldShowCreateOption = ref(false);
|
|
110
|
+
const shouldShowCreateTextOnNewItem = computed(() => props.showCreateTextOnNewItem ?? true);
|
|
109
111
|
|
|
110
112
|
const effectivePrependOptions = computed(() => props.prependOptions ?? []);
|
|
111
113
|
const effectiveAppendOptions = computed(() => props.appendOptions ?? []);
|
|
@@ -190,7 +192,9 @@ const effectiveOptions = computed(() => {
|
|
|
190
192
|
if (!hasExactMatch) {
|
|
191
193
|
options.push({
|
|
192
194
|
key: CreateSymbol,
|
|
193
|
-
title:
|
|
195
|
+
title: shouldShowCreateTextOnNewItem.value
|
|
196
|
+
? 'Create <strong>' + searchText.value.trim() + '</strong>...'
|
|
197
|
+
: searchText.value.trim()
|
|
194
198
|
});
|
|
195
199
|
}
|
|
196
200
|
}
|
|
@@ -303,6 +307,7 @@ function handleKeyDown(e: KeyboardEvent) {
|
|
|
303
307
|
if (e.key == 'Escape') {
|
|
304
308
|
e.stopPropagation();
|
|
305
309
|
(e.target as HTMLInputElement).blur();
|
|
310
|
+
focusNextInput();
|
|
306
311
|
return;
|
|
307
312
|
}
|
|
308
313
|
|
|
@@ -496,6 +501,7 @@ function selectOption(option: OptionDescriptor) {
|
|
|
496
501
|
}
|
|
497
502
|
|
|
498
503
|
searchField.value?.blur();
|
|
504
|
+
focusNextInput();
|
|
499
505
|
}
|
|
500
506
|
|
|
501
507
|
function handleValueChanged() {
|
|
@@ -515,6 +521,21 @@ function handleValueChanged() {
|
|
|
515
521
|
function addRemoteOption(option: T) {
|
|
516
522
|
loadedOptions.value.unshift(option);
|
|
517
523
|
}
|
|
524
|
+
|
|
525
|
+
function focusNextInput() {
|
|
526
|
+
let parent = el.value?.parentElement;
|
|
527
|
+
while (parent && parent.tagName !== 'FORM' && parent.tagName !== 'BODY') {
|
|
528
|
+
parent = parent.parentElement;
|
|
529
|
+
}
|
|
530
|
+
if (!parent) return;
|
|
531
|
+
|
|
532
|
+
const allFocusableElements = parent.querySelectorAll('input, button, textarea, select, [tabindex]:not([tabindex="-1"])');
|
|
533
|
+
if (!allFocusableElements) return;
|
|
534
|
+
|
|
535
|
+
const currentInputIndex = Array.from(allFocusableElements).findIndex(el => el === searchField.value);
|
|
536
|
+
const nextInput = allFocusableElements[currentInputIndex + 1] as HTMLElement;
|
|
537
|
+
if (nextInput) setTimeout(() => nextInput.focus(), 0);
|
|
538
|
+
}
|
|
518
539
|
</script>
|
|
519
540
|
|
|
520
541
|
<style lang="scss">
|