-
-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #182 from kobaltedev/develop
chore: changeset v0.9.1
- Loading branch information
Showing
14 changed files
with
956 additions
and
138 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
"@kobalte/tailwindcss": patch | ||
"@kobalte/core": patch | ||
--- | ||
|
||
v0.9.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# v0.9.1 | ||
|
||
**April 25, 2023**. | ||
|
||
## Bug fixes | ||
|
||
- [#173](https://github.com/kobaltedev/kobalte/pull/173) | ||
- [#180](https://github.com/kobaltedev/kobalte/pull/180) | ||
- [#181](https://github.com/kobaltedev/kobalte/pull/181) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,75 +1,5 @@ | ||
import { createSignal } from "solid-js"; | ||
|
||
import { Combobox, createFilter, I18nProvider } from "../src"; | ||
import { ComboboxTriggerMode } from "../src/combobox"; | ||
|
||
interface Food { | ||
value: string; | ||
label: string; | ||
disabled: boolean; | ||
} | ||
|
||
const RAW_OPTIONS: Food[] = [ | ||
{ value: "apple", label: "Apple", disabled: false }, | ||
{ value: "banana", label: "Banana", disabled: false }, | ||
{ value: "blueberry", label: "Blueberry", disabled: false }, | ||
{ value: "grapes", label: "Grapes", disabled: true }, | ||
{ value: "pineapple", label: "Pineapple", disabled: false }, | ||
]; | ||
import { I18nProvider } from "../src"; | ||
|
||
export default function App() { | ||
const filter = createFilter({ sensitivity: "base" }); | ||
|
||
const [options, setOptions] = createSignal<Food[]>(RAW_OPTIONS); | ||
|
||
const [value, setValue] = createSignal<Food | undefined>(options()[0]); | ||
|
||
const onOpenChange = (isOpen: boolean, triggerMode?: ComboboxTriggerMode) => { | ||
// Show all options on ArrowDown/ArrowUp and button click. | ||
if (isOpen && triggerMode === "manual") { | ||
setOptions(RAW_OPTIONS); | ||
} | ||
}; | ||
|
||
const onInputChange = (value: string) => { | ||
if (value === "") { | ||
//setValue(undefined); | ||
} | ||
|
||
setOptions(RAW_OPTIONS.filter(option => filter.contains(option.label, value))); | ||
}; | ||
|
||
return ( | ||
<I18nProvider locale="en-US"> | ||
{value()?.label ?? "Select an option"} | ||
<Combobox.Root<Food> | ||
options={options()} | ||
optionValue="value" | ||
optionTextValue="label" | ||
optionLabel="label" | ||
optionDisabled="disabled" | ||
//value={value()} | ||
onChange={setValue} | ||
onInputChange={onInputChange} | ||
onOpenChange={onOpenChange} | ||
placeholder="Select a fruit..." | ||
itemComponent={props => ( | ||
<Combobox.Item item={props.item} class="combobox__item"> | ||
{props.item.rawValue.label} | ||
<Combobox.ItemIndicator>X</Combobox.ItemIndicator> | ||
</Combobox.Item> | ||
)} | ||
> | ||
<Combobox.Control<Food> class="combobox__trigger"> | ||
<Combobox.Input /> | ||
<Combobox.Trigger class="combobox__icon" /> | ||
</Combobox.Control> | ||
<Combobox.Portal> | ||
<Combobox.Content class="combobox__content"> | ||
<Combobox.Listbox class="combobox__listbox" /> | ||
</Combobox.Content> | ||
</Combobox.Portal> | ||
</Combobox.Root> | ||
</I18nProvider> | ||
); | ||
return <I18nProvider locale="en-US"></I18nProvider>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.