Commit graph

67 commits

Author SHA1 Message Date
Eric Liu
632320ae3b
fix(combo-box): "Escape" key clears input value (#2169)
Fixes #2167
2025-06-07 12:45:32 -07:00
Nick Wing
436dea47e8
feat(combo-box): add hideLabel prop (#2153) 2025-04-18 10:27:14 -07:00
Brian West
9e3d83031e
fix(combo-box): fix typing when refocusing input
Fixes a bug where the input `value` is immediately reset
when re-focusing the input. The `value` resetting is necessary
to support programmatically clearing the value, but it should
only execute if the input is not currently focused.
2025-03-19 10:29:13 -07:00
Eric Liu
8e996dc683 chore: format files with Prettier 3 2024-11-11 21:35:48 -08:00
Eric Liu
0831e87135
fix(combo-box): fix types for on:clear (#2020) 2024-10-25 15:36:43 -07:00
brunnerh
24e2a8874f
fix(radio-button-group): add name and required props (#1037)
Fixes #1036
2023-10-01 10:14:53 -07:00
Sachin
0b4f19c87e
feat: make titleText slottable in MultiSelect, ComboBox (#1750)
Closes #1747
2023-06-11 18:45:55 -07:00
Bilux
09b3eed582
fix(combobox): avoid runtime error if items is empty (#1545) 2022-12-07 20:29:04 -08:00
metonym
1a7f750093
fix(combo-box): prevent default behavior when pressing Enter/ArrowUp/ArrowDown (#1472) 2022-08-31 18:54:08 -07:00
István Pató
de81ef99af
fix(combo-box): correctly select item in a non-filterable ComboBox (#1419)
Fixes #1222

A non-filterable ComboBox will select the item that matches the typed value when pressing "Enter." An unknown (unmatched) value will select the first item.
2022-08-04 09:58:32 -07:00
Johannes
8bd615b250
fix(combobox): value should call itemToString with filtered item (#1411)
Fixes #1405

When using the `shouldFilterItem` prop, the `ComboBox` does not display the custom label set with `itemToString` in the input after a selection.
2022-07-23 06:15:11 -07:00
metonym
8e52e13ee9
fix: use native binding for value prop in ComboBox, MultiSelect (#1343)
* fix(combo-box): use native binding for value prop (fixes #1262)

* fix(multi-select): use native binding for value prop
2022-06-12 07:12:11 -07:00
metonym
260bf4e040
breaking(types): type arrays as read-only (#1335)
Closes #1259

* breaking(types): type arrays as read-only

* Run "yarn build:docs"

* test: assert read-only arrays
2022-06-05 13:25:43 -07:00
metonym
e230db8115
feat: forward paste event to input/textarea elements (#1332)
* chore(deps-dev): upgrade sveld, svelte-check

* feat: forward paste event to input/textarea elements

* Run "yarn build:docs"

* test: assert paste event
2022-06-02 18:39:49 -07:00
metonym
f25a10c9c4
feat: support item.disabled key for Dropdown, MultiSelect, ComboBox (#1328)
Closes #1326

* feat: support item.disabled key for `Dropdown`, `MultiSelect`, `ComboBox`

* Run "yarn build:docs"

* test: assert disabled property

* docs: add "Disabled items" examples
2022-06-02 17:56:30 -07:00
metonym
f7146b61dc
fix: remove translateWithIdMenu, use translateWithId instead, rename translateWithIdInput (#1285)
* fix: remove translateWithIdMenu, use translateWithId instead

* chore: rename translateWithIdInput to translateWithIdSelection
2022-05-04 07:40:10 -07:00
metonym
0c39506dcb
fix(types): strongly type translateWithId parameters (#1284) 2022-05-04 07:31:51 -07:00
metonym
ff2e6276db
fix: ComboBox, MultiSelect should have multiple translateWithId functions (#1283)
* fix(combo-box): ListBoxField and ListBoxSelection have different `translateWithId` props

* fix(multi-select): ListBoxField and ListBoxSelection have different `translateWithId` props

* Run "yarn build docs"

* test: assert translateWithIdMenu, translateWIthIdInput props
2022-05-04 07:17:35 -07:00
metonym
ba58ba8f00
refactor: use icons from carbon-icons-svelte@11 (#1227)
* chore: update ignore rules, remove unused files

* refactor(icons): use icons from carbon-icons-svelte@11

* docs(time-picker): fix default value

* chore: upgrade carbon-icons-svelte to v11

* docs: update examples to use icons from carbon-icons-svelte@11

* docs: update number of icons [ci skip]
2022-04-03 11:57:28 -07:00
metonym
2858776367
feat(combo-box): make ComboBox slottable (#1181)
Closes #1176
2022-03-19 09:15:41 -07:00
Eric Liu
1f7b5560a8
Type id as any in ComboBox, Dropdown, MultiSelect (#1019)
Loosen the prop type for `id`, `selectedId` to be `any` instead of a `string`.
2022-01-20 18:50:36 -08:00
Koichi Kiyokawa
cde8a79fa8
feat(ComboBox): selectedIndex -> selectedId (#1016)
* feat(breaking): selectedIndex -> selectedId in ComboBox

* docs: update ComboBox
2022-01-18 06:37:55 -08:00
Eric Liu
a60bc73fea
fix(combo-box): name should be passed to input (#1014)
Fixes #797
2022-01-17 13:07:42 -08:00
Eric Liu
653a601f9b
Revert "Refactor prop types to omit redundant null for null | HTMLElement types" (#1008)
#996
2022-01-14 11:29:37 -10:00
Eric Liu
37f19d2171
Add option to not re-focus ComboBox when invoking clear() (#1000)
* feat(combo-box): add option to clear accessor to not re-focus input

Closes #994

* yarn build:lib

* test(combo-box): validate clear accessor params

* docs(combo-box): add clear without focus to "Clear selection" example
2022-01-12 16:12:43 -10:00
Eric Liu
6de73f86fb
Refactor prop types to omit redundant null for null | HTMLElement types (#998)
* refactor: omit redundant `null` prop type for HTMLElements

* yarn build:lib

* test: assert updated element prop types
2022-01-12 13:36:47 -10:00
István Pató
d31e529ca9
fix(ComboBox): programmatically set selected index (#995)
* fix(ComboBox): programmatically set selected index

* refactor(ComboBox): renaming example to Reactive example
2022-01-12 13:36:37 -10:00
Eric Liu
f6eb958732
fix(combo-box): reset values when manually clearing input field (#992) 2022-01-10 13:05:32 -10:00
István Pató
a2a5159a59
fix(combobox): filtered ComboBox handling with keyboard (#926)
* fix(combobox): filtered ComboBox handling with keyboard

* fix: dispatching filteredItems

* fix: default value settings (init) on inputValue

* fix: multiple event dispatch, and item selection bug

* fix(ComboBox): programmatically setting selectedIndex has no effect

* fix(ComboBox): selectedIndex prog. setting on filtered items

* fix(ComboBox): removed unnecessary blur code fragment, fix mouse selection after keyboard editing
2022-01-10 12:45:37 -10:00
Eric Liu
36f6a327b2
hotfix: fix remaining imports from carbon-icons-svelte (#905) 2021-11-12 13:09:43 -08:00
Eric Liu
040e3d3372
Inline carbon icons, remove carbon-icons-svelte from dependencies (#904)
* feat(icons): inline carbon icons used by components

* feat(icons): update svelte components to use inlined carbon icons

* breaking(deps): remove carbon-icons-svelte

* chore(deps-dev): install carbon-icons-svelte as a devDependency
2021-11-11 08:54:45 -08:00
Eric Liu
70163b36f8
fix(combo-box): remove redundant clear events #817 (#818)
Fixes #817
2021-09-14 09:56:32 -07:00
Eric Liu
e4e75e5859
Fixes (#814)
* fix(combo-box): clicking chevron should not open the combo box if disabled

Fixes #776

* fix(toolbar-batch-actions): cancel text should be slottable

Fixes #782
2021-09-11 12:29:26 -07:00
Eric Liu
e39efc5668 feat: rebuild types, component api 2021-09-06 09:52:00 -07:00
Rafael Dessotti
dfc00f6668
Clear ComboBox Programaticaly (#804)
* Added clear function

* Dispatching clear event

* Exporting function clear

* Added example
2021-09-06 09:47:48 -07:00
Eric
d24c60856f
fix(combo-box): fix reactivity regression #768 (#769)
* fix(combo-box): fix reactivity regression #768

Fixes #768

* fix(combo-box): if selectedItem is not defined, default selectedIndex to 0

* fix(combo-box): do not reset selectedIndex to 0, fallback to empty string

* fix(combo-box): reset selectedIndex
2021-07-29 10:09:55 -07:00
Phil Mayer
af26bdb10a
fix: close overlays on window click (#761) 2021-07-22 09:44:23 -07:00
Eric Liu
e51f50da0c
Align v10.38 (#698)
* chore(deps-dev): upgrade carbon-components to v10.38.0

* feat(text-input): support read-only variant

* docs: use consistent lingo for inline variant examples

* docs(popover): add Popover alignment example

* fix(file-uploader): adjust markup to avoid accessibility errors

Ref: 0dfde60e3

* fix(inline-loading): use error filled icon

* fix(inline-loading): render iconDescription as title in error/warning icons

Ref: 51c53c923

* fix(structured-list): update accessibility attributes

* fix(tooltip-definition): use span instead of div

Ref: cb6de3025

* fix(multi-select): close menu when blurring the last filterable option

* fix(multi-select): open/focus field for filterable multiselect #635

* fix(multi-select): unblock focus when blurring input #635

* fix(combo-box): select correct item with keys, allow input after clearing #195

* fix(combo-box): update input text if item is selected

* feat(combo-box): render checkmark icon for selected item

* fix(ui-shell): toggle SideNav rail when clicking the hamburger menu #699

* fix(context-menu): update context menu classes #684

* docs(context-menu): improve demo instructions #684

* fix(context-menu): close menu when clicking anywhere
2021-06-27 08:46:57 -07:00
Eric Liu
8ddf2def8b
Align v10.36 (#696)
* chore(deps-dev): upgrade carbon-components to v10.36.0

* feat(structured-list): add condensed, flush props

* fix(structured-list): deprecate the border prop

* fix(code-snippet): set min/max height for multi-line code snippet #656

Fixes #656

* fix(image-loader): make SSR compatible using a window type check guard

* docs(tag): add separate disabled example for filterable/interactive tags

* docs: update number of supported chart types

* feat(side-nav): support rail variant

* feat(ui-shell): add isSelected prop to HeaderNavItem

* fix(ui-shell): default isSelected to false in SideNavMenuItem

* fix(text-area): forward missing keydown event #665

Fixes #665

* feat: forward keyup event to components with inputs

* feat(checkbox): make labelText slottable #563

Closes #563

* feat: make labelText slottable

Related #563

* docs(component-api): account for undefined type

* docs(ui-shell): link to correct rail source

* fix(ui-shell): default isSelected in HeaderNavItem to false
2021-06-26 14:39:49 -07:00
Eric Liu
1b234ca2e3
Alignment with Carbon version 10.30 (#559)
* feat(toolbar): forward "clear" event in ToolbarSearch

* docs(search): add on:clear example

* fix(ui-shell): set aria-hidden in SideNav

Ref c2b4f1f00

* chore(deps-dev): upgrade carbon-components to v10.30.0

* fix(text-input): use bx--text-input class for TextInputSkeleton

* fix(radio-button): only render span if labelText is truthy

* docs(password-input): add custom tooltip example

* feat(button): add isSelected prop for icon-only, ghost buttons

* feat(radio-button): add legendText prop to RadioButtonGroup

* docs(tag): add filterable (disabled) variant

* feat(tag): add interactive prop

* chore(number-input): deprecate the mobile variant

Mobile variant styles will no longer work.

* feat(button): set aria-pressed attribute if icon-only, ghost button is selected

* fix(multi-select): type dispatched select event

* fix(button): remove redundant "button" role

* feat(icon): deprecate Icon, IconSkeleton

* feat(ui-shell): make SideNavMenuItem text slottable

* fix(list-box): update styles for ListBoxSelection

* fix(list-box): temporarily apply override styles to ListBoxMenuIcon for chevron

* fix(tag): set disabled prop on interactive tag

* docs(button): extract selected, icon-only button example

* feat(tooltip): elevate z-index of tooltip when open

* feat: forward restProps to input element

* fix(types): fix TimePicker test to pass svelte-check

* feat: add ImageLoader component

* test: add ImageLoader

* feat: add LocalStorage component

* test(local-storage): fix invalid file

* chore(docs): use green tag type
2021-03-13 14:53:37 -08:00
Eric Liu
d6a136d6ca
hotfix: blur ComboBox, MultiSelect focus based on relatedTarget tag name (#540)
* fix(combo-fix): dont re-focus listbox if relatedTarget is input/select/textarea

* fix(combo-box): check if relatedTarget is truthy

* fix(multi-select): dont re-focus listbox if relatedTarget is input/select/textarea
2021-02-26 14:28:36 -08:00
Eric Liu
14e714fa61
Alignment with Carbon version 10.29 (#529)
* chore: patch prettier-plugin-svelte

* docs(tag): add filterable small tag example

* feat(ui-shell): add SideNavDivider

* feat(combo-box): support warning state

* docs(combo-box): add invalid state example

* fix(progress-step): add title to warning icon

* docs(progress-indicator): add invalid step example

* docs(progress-indicator): add disabled steps example

* feat(truncate): add text truncation component and action

* docs(radio-tile): fix light variant example

* fix(side-effects): add pre-compiled CSS to library side effects

* refactor(css): use shorthand scss imports, add comments

* refactor(truncate): rename "direction" prop to "clamp"

* chore(deps-dev): bump carbon-components to v10.29.0

* feat(combo-box): add direction prop

* feat(dropdown): add direction prop

* feat(multi-select): add direction prop
2021-02-19 16:08:16 -08:00
Eric Liu
3d002f3246
chore(deps-dev): upgrade prettier-plugin-svelte (#498) 2021-01-27 15:02:02 -08:00
Eric Liu
3214d8563f
Reactive audit (#449)
* refactor(search): resolve svelte file paths

* docs(Search): add reactive example

* refactor(tag): use class name directive for tag types, resolve svelte icon path

* chore(button-skeleton): deprecate small prop

* fix(breadcrumb-item): type default slot

* refactor(breadcrumb-skeleton): omit unused index

* refactor(aspect-ratio): use class name directive

* refactor(accordion): use the class name directive, resolve svelte icon paths

* refactor(code-snippet): use class name directive, resolve svelte icon paths

* fix(code-snippet-skeleton): CodeSnippetSkeleton can only be single or multi

* refactor(content-switcher): use class name directive

* docs(content-switcher): add reactive example

* docs(content-switcher): remove unused import

* docs(toggle): add reactive example

* refactor(tooltip-definition): use class name directive

* refactor(tooltip-icon): use class name directive

* refactor(tooltip): resolve svelte icon import

* fix(select): type dispatched change event

* refactor(select): resolve svelte icon import

* feat(select-item): spread rest props, avoid $ variable name

* fix(pagination-nav): type dispatched events

* refactor(pagination): resolve svelte imports

* fix(pagination): type dispatched update event

* fix(overflow-menu): type dispatched close event

* fix(number-input): type dispatched change event

* refactor(modal): use class name directive, resolve svelte imports

* refactor(inline-loading): use class name directive, resolve svelte imports

* refactor(composed-modal): resolve svelte icon imports

* refactor(combo-box): resolve svelte imports

* fix(fluid-form): rest props should not override Form class

* refactor(progress-step): resolve svelte icon imports
2020-12-06 03:59:30 -08:00
Eric Liu
f6877f3809
Fix dropdown combobox focus (#447)
* fix(combo-box): selecting a different combobox should focus the input

* fix(dropdown): selecting a different dropdown should focus the button

* fix(combo-box): focus input if related target attribute is not "searchbox"
2020-12-05 11:36:41 -08:00
Eric Liu
75d4b4cf03 refactor(types): shorten ref, id JSDocs, use CarbonIcon type, export component props 2020-11-06 11:30:46 -08:00
Eric Liu
d38e6d8be6 refactor: update/fix JSDoc props 2020-11-04 06:04:25 -08:00
Eric Liu
c39427670a feat(data-table): add ToolbarMenu
Requires menuRef from OverflowMenu to be exported.
2020-10-26 07:43:54 -07:00
weaseldotro
d436e5928e
Use HTMLDivElement instead of HTMLElement in ComboBox
Co-authored-by: Eric Liu <ericyl.us@gmail.com>
2020-10-25 15:35:50 +02:00
weaseldotro
0b21a6d3f3
feat(ComboBox): add a reference to the list HTML element, forward scroll event 2020-10-25 11:18:19 +02:00