Skip to content

Commit 956e2f2

Browse files
committed
chore: run prettier
1 parent a47e524 commit 956e2f2

File tree

6 files changed

+28
-28
lines changed

6 files changed

+28
-28
lines changed

apps/website/src/routes/docs/headless/(components)/combobox/examples.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ const objectExample: Array<Trainer> = [
4242
{ testValue: 'joe', testLabel: 'Joe', disabled: false },
4343
{ testValue: 'randy', testLabel: 'Randy', disabled: false },
4444
{ testValue: 'david', testLabel: 'David', disabled: true },
45-
{ testValue: 'joseph', testLabel: 'Joseph', disabled: false }
45+
{ testValue: 'joseph', testLabel: 'Joseph', disabled: false },
4646
];
4747

4848
export const HeroExample = component$(() => {
@@ -123,7 +123,7 @@ export const StringCombobox = component$(() => {
123123
'Cherry',
124124
'Coconut',
125125
'Cranberry',
126-
'Cucumber'
126+
'Cucumber',
127127
];
128128

129129
const fruitsSig = useSignal(fruits);

packages/kit-headless/src/components/combobox/combobox-input.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ import {
66
useVisibleTask$,
77
type QwikIntrinsicElements,
88
useTask$,
9-
useSignal
9+
useSignal,
1010
} from '@builder.io/qwik';
1111
import { KeyCode } from '../../utils';
1212
import ComboboxContextId from './combobox-context-id';
1313
import {
1414
isOptionDisabled,
1515
getOptionLabel,
1616
getNextEnabledOptionIndex,
17-
getPrevEnabledOptionIndex
17+
getPrevEnabledOptionIndex,
1818
} from './utils';
1919

2020
const preventedKeys = [KeyCode.Home, KeyCode.End, KeyCode.PageDown, KeyCode.ArrowUp];
@@ -32,14 +32,14 @@ export const ComboboxInput = component$(({ ...props }: ComboboxInputProps) => {
3232
const onKeydownBehavior$ = $((e: QwikKeyboardEvent) => {
3333
const highlightedOptionLabel = getOptionLabel(
3434
context.optionsSig.value[context.highlightedIndexSig.value]?.option,
35-
context.optionLabelKey
35+
context.optionLabelKey,
3636
);
3737

3838
if (e.key === 'ArrowDown') {
3939
if (context.isListboxOpenSig.value) {
4040
const nextEnabledOptionIndex = getNextEnabledOptionIndex(
4141
context.highlightedIndexSig.value,
42-
context
42+
context,
4343
);
4444

4545
context.highlightedIndexSig.value = nextEnabledOptionIndex;
@@ -55,7 +55,7 @@ export const ComboboxInput = component$(({ ...props }: ComboboxInputProps) => {
5555
if (e.key === 'ArrowUp') {
5656
const prevEnabledOptionIndex = getPrevEnabledOptionIndex(
5757
context.highlightedIndexSig.value,
58-
context
58+
context,
5959
);
6060
context.highlightedIndexSig.value = prevEnabledOptionIndex;
6161
}
@@ -79,7 +79,7 @@ export const ComboboxInput = component$(({ ...props }: ComboboxInputProps) => {
7979
if (e.key === 'End') {
8080
const lastEnabledOptionIndex = getPrevEnabledOptionIndex(
8181
context.optionsSig.value.length,
82-
context
82+
context,
8383
);
8484
context.highlightedIndexSig.value = lastEnabledOptionIndex;
8585
}

packages/kit-headless/src/components/combobox/combobox-label.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import {
22
Slot,
33
component$,
44
useContext,
5-
type QwikIntrinsicElements
5+
type QwikIntrinsicElements,
66
} from '@builder.io/qwik';
77
import ComboboxContextId from './combobox-context-id';
88

packages/kit-headless/src/components/combobox/combobox-option.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export const ComboboxOption = component$(
3232
const isHighlightedSig = useComputed$(
3333
() =>
3434
!(isOptionDisabledSig as Signal<boolean>).value &&
35-
context.highlightedIndexSig.value === index
35+
context.highlightedIndexSig.value === index,
3636
);
3737

3838
const optionRef = useSignal<HTMLLIElement>();
@@ -80,7 +80,7 @@ export const ComboboxOption = component$(
8080

8181
context.inputRef.value.value = getOptionLabel(
8282
context.optionsSig.value[context.highlightedIndexSig.value]?.option,
83-
context.optionLabelKey
83+
context.optionLabelKey,
8484
);
8585

8686
context.isListboxOpenSig.value = false;

packages/kit-headless/src/components/combobox/combobox.spec.tsx

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
ComboboxControl,
88
ComboboxListbox,
99
ComboboxOption,
10-
ComboboxPortal
10+
ComboboxPortal,
1111
} from './index';
1212

1313
import TestData from './test-data';
@@ -162,7 +162,7 @@ describe('Critical Functionality', () => {
162162
<>
163163
<StringCombobox />
164164
<button>Random Element</button>
165-
</>
165+
</>,
166166
);
167167

168168
cy.get('button').first().focus().click();
@@ -234,7 +234,7 @@ describe('Default Label', () => {
234234
cy.findByRole('option', { name: 'Jabuticaba' }).should(
235235
'have.attr',
236236
'aria-selected',
237-
'true'
237+
'true',
238238
);
239239
});
240240
});
@@ -385,7 +385,7 @@ const DisabledCombobox = component$(() => {
385385
{ testValue: 'david', testLabel: 'David', disabled: true },
386386
{ testValue: 'joseph', testLabel: 'Joseph', disabled: true },
387387
{ testValue: 'mark', testLabel: 'Mark', disabled: false },
388-
{ testValue: 'sidney', testLabel: 'Sidney', disabled: true }
388+
{ testValue: 'sidney', testLabel: 'Sidney', disabled: true },
389389
];
390390

391391
const objectExampleSig = useSignal(objectExample);
@@ -489,7 +489,7 @@ describe('Disabled & Object Combobox', () => {
489489
cy.findByRole('option', { name: `Malcolm` }).should(
490490
'have.attr',
491491
'aria-selected',
492-
'true'
492+
'true',
493493
);
494494
});
495495

@@ -503,7 +503,7 @@ describe('Disabled & Object Combobox', () => {
503503
cy.findByRole('option', { name: `Mark` }).should(
504504
'have.attr',
505505
'aria-selected',
506-
'true'
506+
'true',
507507
);
508508
});
509509

@@ -519,7 +519,7 @@ describe('Disabled & Object Combobox', () => {
519519
cy.findByRole('option', { name: `Malcolm` }).should(
520520
'have.attr',
521521
'aria-selected',
522-
'true'
522+
'true',
523523
);
524524
});
525525

@@ -535,7 +535,7 @@ describe('Disabled & Object Combobox', () => {
535535
cy.findByRole('option', { name: `Mark` }).should(
536536
'have.attr',
537537
'aria-selected',
538-
'true'
538+
'true',
539539
);
540540
});
541541

@@ -552,7 +552,7 @@ describe('Disabled & Object Combobox', () => {
552552
cy.findByRole('option', { name: `Brian` }).should(
553553
'have.attr',
554554
'aria-selected',
555-
'true'
555+
'true',
556556
);
557557
});
558558

@@ -571,7 +571,7 @@ describe('Disabled & Object Combobox', () => {
571571
cy.findByRole('option', { name: `Malcolm` }).should(
572572
'have.attr',
573573
'aria-selected',
574-
'true'
574+
'true',
575575
);
576576
});
577577

@@ -586,15 +586,15 @@ describe('Disabled & Object Combobox', () => {
586586
cy.findByRole('option', { name: `Randy` }).should(
587587
'have.attr',
588588
'aria-selected',
589-
'true'
589+
'true',
590590
);
591591

592592
cy.get('input').type(`{downarrow}`);
593593

594594
cy.findByRole('option', { name: `Mark` }).should(
595595
'have.attr',
596596
'aria-selected',
597-
'true'
597+
'true',
598598
);
599599
});
600600

@@ -609,23 +609,23 @@ describe('Disabled & Object Combobox', () => {
609609
cy.findByRole('option', { name: `Randy` }).should(
610610
'have.attr',
611611
'aria-selected',
612-
'true'
612+
'true',
613613
);
614614

615615
cy.get('input').type(`{downarrow}`);
616616

617617
cy.findByRole('option', { name: `Mark` }).should(
618618
'have.attr',
619619
'aria-selected',
620-
'true'
620+
'true',
621621
);
622622

623623
cy.get('input').type(`{uparrow}`);
624624

625625
cy.findByRole('option', { name: `Randy` }).should(
626626
'have.attr',
627627
'aria-selected',
628-
'true'
628+
'true',
629629
);
630630
});
631631
});

packages/kit-headless/src/components/combobox/utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export function getOptionLabel(option: undefined | Option, labelKey: string): st
1212
const label = option[labelKey] as unknown;
1313
if (typeof label !== 'string') {
1414
throw new Error(
15-
'Qwik UI: Combobox optionLabelKey was not provided, and the option was not a string. Please provide a value for optionLabelKey, use the property name "label", or ensure that the option is a string.'
15+
'Qwik UI: Combobox optionLabelKey was not provided, and the option was not a string. Please provide a value for optionLabelKey, use the property name "label", or ensure that the option is a string.',
1616
);
1717
}
1818
return label;
@@ -53,7 +53,7 @@ export const getPrevEnabledOptionIndex = (index: number, context: ComboboxContex
5353
isOptionDisabled(
5454
(currentIndex - offset + context.optionsSig.value.length) %
5555
context.optionsSig.value.length,
56-
context
56+
context,
5757
)
5858
) {
5959
offset++;

0 commit comments

Comments
 (0)