@sit-onyx/headless 1.0.0-beta.2 → 1.0.0-beta.3
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 +1 -1
- package/src/composables/comboBox/SelectOnlyCombobox.vue +6 -2
- package/src/composables/comboBox/TestCombobox.vue +1 -2
- package/src/composables/comboBox/createComboBox.ts +0 -6
- package/src/composables/navigationMenu/createMenu.testing.ts +2 -13
- package/src/playwright.ts +1 -0
package/package.json
CHANGED
|
@@ -26,7 +26,6 @@ const onToggle = () => (isExpanded.value = !isExpanded.value);
|
|
|
26
26
|
const onTypeAhead = () => {};
|
|
27
27
|
|
|
28
28
|
const comboBox = createComboBox({
|
|
29
|
-
inputValue: selectedOption,
|
|
30
29
|
autocomplete: "none",
|
|
31
30
|
label: "some label",
|
|
32
31
|
listLabel: "List",
|
|
@@ -51,7 +50,12 @@ defineExpose({ comboBox });
|
|
|
51
50
|
|
|
52
51
|
<template>
|
|
53
52
|
<div ref="comboboxRef">
|
|
54
|
-
<input
|
|
53
|
+
<input
|
|
54
|
+
v-bind="input"
|
|
55
|
+
v-model="selectedOption"
|
|
56
|
+
readonly
|
|
57
|
+
@keydown.arrow-down="isExpanded = true"
|
|
58
|
+
/>
|
|
55
59
|
|
|
56
60
|
<button v-bind="button">
|
|
57
61
|
<template v-if="isExpanded">⬆️</template>
|
|
@@ -30,7 +30,6 @@ const onAutocomplete = (input: string) => (searchTerm.value = input);
|
|
|
30
30
|
const onToggle = () => (isExpanded.value = !isExpanded.value);
|
|
31
31
|
|
|
32
32
|
const comboBox = createComboBox({
|
|
33
|
-
inputValue: searchTerm,
|
|
34
33
|
autocomplete: "list",
|
|
35
34
|
label: "some label",
|
|
36
35
|
listLabel: "List",
|
|
@@ -55,7 +54,7 @@ defineExpose({ comboBox });
|
|
|
55
54
|
|
|
56
55
|
<template>
|
|
57
56
|
<div ref="comboboxRef">
|
|
58
|
-
<input v-bind="input" @keydown.arrow-down="isExpanded = true" />
|
|
57
|
+
<input v-bind="input" v-model="searchTerm" @keydown.arrow-down="isExpanded = true" />
|
|
59
58
|
|
|
60
59
|
<button v-bind="button">
|
|
61
60
|
<template v-if="isExpanded">⬆️</template>
|
|
@@ -41,10 +41,6 @@ export type CreateComboboxOptions<
|
|
|
41
41
|
* Labels the listbox which displays the available options. E.g. the list label could be "Countries" for a combobox which is labelled "Country".
|
|
42
42
|
*/
|
|
43
43
|
listLabel: MaybeRef<string>;
|
|
44
|
-
/**
|
|
45
|
-
* The current value of the combobox. Is updated when an option from the controlled listbox is selected or by typing into it.
|
|
46
|
-
*/
|
|
47
|
-
inputValue: Ref<string | undefined>;
|
|
48
44
|
/**
|
|
49
45
|
* Controls the opened/visible state of the associated pop-up. When expanded the activeOption can be controlled via the keyboard.
|
|
50
46
|
*/
|
|
@@ -105,7 +101,6 @@ export const createComboBox = createBuilder(
|
|
|
105
101
|
TAutoComplete extends ComboboxAutoComplete,
|
|
106
102
|
TMultiple extends boolean = false,
|
|
107
103
|
>({
|
|
108
|
-
inputValue,
|
|
109
104
|
autocomplete: autocompleteRef,
|
|
110
105
|
onAutocomplete,
|
|
111
106
|
onTypeAhead,
|
|
@@ -250,7 +245,6 @@ export const createComboBox = createBuilder(
|
|
|
250
245
|
* The input MAY be either a single-line text field that supports editing and typing or an element that only displays the current value of the combobox.
|
|
251
246
|
*/
|
|
252
247
|
input: computed(() => ({
|
|
253
|
-
value: inputValue.value,
|
|
254
248
|
role: "combobox",
|
|
255
249
|
"aria-expanded": isExpanded.value,
|
|
256
250
|
"aria-controls": controlsId,
|
|
@@ -22,22 +22,11 @@ export const navigationTesting = async ({ nav, buttons }: NavigationMenuTestingO
|
|
|
22
22
|
*/
|
|
23
23
|
await expect(nav).toHaveRole("navigation");
|
|
24
24
|
await expect(nav).toHaveAttribute("aria-label");
|
|
25
|
-
|
|
26
|
-
* Disclosure buttons should have aria attributes
|
|
27
|
-
*/
|
|
28
|
-
for (const button of await buttons.all()) {
|
|
29
|
-
await expect(button, "button must have arial-controls attribute").toHaveAttribute(
|
|
30
|
-
"aria-controls",
|
|
31
|
-
);
|
|
32
|
-
await expect(button, "button must have aria-expanded attribute").toHaveAttribute(
|
|
33
|
-
"aria-expanded",
|
|
34
|
-
);
|
|
35
|
-
}
|
|
25
|
+
|
|
36
26
|
/**
|
|
37
27
|
* Focus first button
|
|
38
28
|
*/
|
|
39
|
-
await
|
|
40
|
-
await expect(buttons.nth(0)).toBeFocused();
|
|
29
|
+
await buttons.first().focus();
|
|
41
30
|
/**
|
|
42
31
|
* Move keyboard focus among top-level buttons using arrow keys
|
|
43
32
|
*/
|
package/src/playwright.ts
CHANGED