Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 11.6.0 - Add clear button to SearchableSelect, bump deps #290

Merged
merged 17 commits into from
Oct 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
ef2de60
build(deps-dev): bump webpack from 5.92.1 to 5.94.0
dependabot[bot] Aug 30, 2024
0d052ab
build(deps): bump svelte from 4.2.18 to 4.2.19
dependabot[bot] Sep 9, 2024
4fa9624
Merge pull request #280 from silinternational/dependabot/npm_and_yarn…
hobbitronics Sep 10, 2024
758568e
Merge pull request #279 from silinternational/dependabot/npm_and_yarn…
hobbitronics Sep 10, 2024
e6e598e
build(deps): bump serve-static and express
dependabot[bot] Sep 17, 2024
6863dbc
build(deps): bump send and express
dependabot[bot] Sep 17, 2024
f368d8c
Merge pull request #286 from silinternational/dependabot/npm_and_yarn…
hobbitronics Sep 17, 2024
e3de531
Merge pull request #285 from silinternational/dependabot/npm_and_yarn…
hobbitronics Sep 17, 2024
6f869ed
build(deps-dev): bump vite from 4.5.3 to 4.5.5
dependabot[bot] Sep 17, 2024
e4bb352
Merge pull request #287 from silinternational/dependabot/npm_and_yarn…
hobbitronics Sep 17, 2024
000f776
add(SearchableSelect): add clear button to SearchableSelect
hobbitronics Sep 25, 2024
8425a4d
build(deps): bump micromatch and rollup
hobbitronics Sep 25, 2024
3fd0539
docs(changelog): format
hobbitronics Sep 25, 2024
726a07b
build(deps-dev): bump rollup from 3.29.4 to 3.29.5
dependabot[bot] Sep 26, 2024
8dad471
Merge pull request #289 from silinternational/dependabot/npm_and_yarn…
hobbitronics Sep 30, 2024
b865d73
Merge pull request #288 from silinternational/add-clear-button
hobbitronics Oct 3, 2024
8f3aeae
chore(release): 11.6.0 [skip ci]
semantic-release-bot Oct 3, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 22 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,37 @@
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html), enforced with [semantic-release](https://github.com/semantic-release/semantic-release).

## [11.5.0](https://github.com/silinternational/ui-components/compare/v11.4.2...v11.5.0) (2024-09-09)
## [11.6.0](https://github.com/silinternational/ui-components/compare/v11.5.0...v11.6.0) (2024-10-03)


### Added

* **DateInput:** add data-1p-ignore to prevent 1Password trying to fill ([c296811](https://github.com/silinternational/ui-components/commit/c29681127222afabceff914350aafebe38687dfc))
* **MoneyInput:** add data-1p-ignore to prevent 1Password trying to fill ([6367aa8](https://github.com/silinternational/ui-components/commit/6367aa8f43c5544556039feaf848fff60002cf33))
* **SearchableSelect:** add data-1p-ignore to SearchableSelect ([ce4bf4b](https://github.com/silinternational/ui-components/commit/ce4bf4be28a7c3ef5efe0636c47d4437e8fe71f0))
* **Select:** add data-1p-ignore to prevent 1Password trying to fill ([1e502e2](https://github.com/silinternational/ui-components/commit/1e502e226144bf0c8b41a7535f8499d62df537e7))
* **SearchableSelect:** add clear button to SearchableSelect ([000f776](https://github.com/silinternational/ui-components/commit/000f776dc36dd7e7c2bd10363d6314c5ed0fae5b))

### [11.4.2](https://github.com/silinternational/ui-components/compare/v11.4.1...v11.4.2) (2024-09-06)

### Changed

* **changelog:** format ([3fd0539](https://github.com/silinternational/ui-components/commit/3fd05396879a911d075855c92828eaf4a06f2265))

# Changelog

All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html), enforced with [semantic-release](https://github.com/semantic-release/semantic-release).

## [11.5.0](https://github.com/silinternational/ui-components/compare/v11.4.2...v11.5.0) (2024-09-09)

### Added

- **DateInput:** add data-1p-ignore to prevent 1Password trying to fill ([c296811](https://github.com/silinternational/ui-components/commit/c29681127222afabceff914350aafebe38687dfc))
- **MoneyInput:** add data-1p-ignore to prevent 1Password trying to fill ([6367aa8](https://github.com/silinternational/ui-components/commit/6367aa8f43c5544556039feaf848fff60002cf33))
- **SearchableSelect:** add data-1p-ignore to SearchableSelect ([ce4bf4b](https://github.com/silinternational/ui-components/commit/ce4bf4be28a7c3ef5efe0636c47d4437e8fe71f0))
- **Select:** add data-1p-ignore to prevent 1Password trying to fill ([1e502e2](https://github.com/silinternational/ui-components/commit/1e502e226144bf0c8b41a7535f8499d62df537e7))

### [11.4.2](https://github.com/silinternational/ui-components/compare/v11.4.1...v11.4.2) (2024-09-06)

### Fixed

* **Drawer:** fix A11y warning in Drawer ([275d2b9](https://github.com/silinternational/ui-components/commit/275d2b9f0944e82da7b275f043afc11b6e9296c1))
- **Drawer:** fix A11y warning in Drawer ([275d2b9](https://github.com/silinternational/ui-components/commit/275d2b9f0944e82da7b275f043afc11b6e9296c1))

### [11.4.1](https://github.com/silinternational/ui-components/compare/v11.4.0...v11.4.1) (2024-07-09)

Expand Down
28 changes: 27 additions & 1 deletion components/custom/SearchableSelect/SearchableSelect.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export let showError = false

let element = {}
let randomId = generateRandomID('dataList-')
let savedChoice = ''

const dispatch = createEventDispatcher()

Expand All @@ -32,6 +33,18 @@ const onChange = (e) => {
choice = internalChoice
element.blur()
}

const clearChoice = () => {
savedChoice = choice
choice = ''
}

const onBlur = () => {
if (savedChoice && !choice) {
choice = savedChoice
}
dispatch('check', choice)
}
</script>

<style>
Expand Down Expand Up @@ -80,6 +93,16 @@ const onChange = (e) => {
border-color: var(--mdc-theme-status-error, var(--mdc-theme-error));
color: var(--mdc-theme-status-error, var(--mdc-theme-error));
}

.clear-button {
cursor: pointer;
padding: 5px;
position: relative;
right: 50px;
border-radius: 4px;
border: none;
background-color: transparent;
}
</style>

<label class="custom-field" style="--field-padding: {padding}; {$$props.class || ''}">
Expand All @@ -98,11 +121,14 @@ const onChange = (e) => {
value={choice}
on:change={onChange}
on:change
on:blur={(e) => dispatch('check', e.target.value)}
on:blur={onBlur}
on:blur
on:focus
/>
<span class="placeholder">{placeholder}</span>
{#if choice}
<button type="button" class="clear-button" on:click={clearChoice} aria-label="Clear selection">✕</button>
{/if}
</label>

<datalist id={randomId}>
Expand Down
Loading
Loading