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

Skip non selectable items #455

Closed
wants to merge 141 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
141 commits
Select commit Hold shift + click to select a range
2d97432
sveltekit setup and package.json updates
rob-balfre Sep 3, 2021
b786ce6
package bump
rob-balfre Sep 4, 2021
bf83fef
removed isVirtualList
rob-balfre Sep 6, 2021
ac8219b
moving MultiSelection and debounce to imports
rob-balfre Sep 12, 2021
b88d643
fixing up tests
rob-balfre Sep 24, 2021
d1c6cb0
cleaning up List props and tests
rob-balfre Sep 25, 2021
d89ff25
alpha bump
rob-balfre Sep 25, 2021
8ebe9b2
removed playwright and puppeteer and cleaned up deps
rob-balfre Sep 25, 2021
8d8650f
v5 icons
rob-balfre Sep 25, 2021
89eb021
spinner -> loading moved to Icon
rob-balfre Sep 25, 2021
d029328
fun with tailwind 💨
rob-balfre Oct 13, 2021
013d6c0
List script, html, styles
rob-balfre Oct 13, 2021
8e0fbf5
list-container changes for tailwind
rob-balfre Oct 13, 2021
7e63192
tailwind example
rob-balfre Oct 16, 2021
9a69e9e
tailwind and css updates
rob-balfre Oct 31, 2021
bba1bb4
v5 taking shape 🤡
rob-balfre Nov 3, 2021
e3e2a77
focus and blur updates, bump deps and code clean up
rob-balfre Nov 8, 2021
a06b0de
fixing tests
rob-balfre Nov 8, 2021
11f47a0
fixed tests and added svelte-tiny-virtual-list support
rob-balfre Nov 9, 2021
3f7c9b7
modular, filter, logo
rob-balfre Nov 9, 2021
fc626eb
getItems update
rob-balfre Nov 10, 2021
28d476b
computePlacement updates
rob-balfre Nov 11, 2021
730457e
added suggestions feature
rob-balfre Nov 11, 2021
4295bf3
#290 fix for VirtualList no options
rob-balfre Nov 11, 2021
2c12ee1
#319 setting just value fix for showing correct label
rob-balfre Nov 11, 2021
3ed3c20
#325 config renamed to imports & ChevronIcon moved to imports
rob-balfre Nov 12, 2021
3b78f38
#326 added blur and focus events
rob-balfre Nov 12, 2021
c9a8f05
5.0.0-alpha.2
rob-balfre Nov 12, 2021
05c69c4
bump and first attempt at github actions
rob-balfre Nov 15, 2021
36e2caa
yml format
rob-balfre Nov 15, 2021
41ce681
github workflow update
rob-balfre Nov 15, 2021
def0f20
workflow alpha test
rob-balfre Nov 15, 2021
d483f26
publishConfig
rob-balfre Nov 15, 2021
ff3edd7
github npm
rob-balfre Nov 15, 2021
4646043
remove publishConfig
rob-balfre Nov 15, 2021
81f1abe
fun with secrets
rob-balfre Nov 15, 2021
f14bb82
env fix
rob-balfre Nov 15, 2021
f30e4a6
bump
rob-balfre Nov 15, 2021
6842a9e
v5 clean up and started on docs
rob-balfre Nov 22, 2021
c70a105
internal padding
rob-balfre Nov 28, 2021
6fc130d
icons and css updates
rob-balfre Dec 1, 2021
c9fe2ce
css tweaks
rob-balfre Dec 1, 2021
806c5db
tailwind update
rob-balfre Dec 1, 2021
51890ce
release-it
rob-balfre Dec 2, 2021
b551a42
release-it
rob-balfre Dec 2, 2021
e4a7d74
removing action
rob-balfre Dec 2, 2021
1c3d9e8
dotenv
rob-balfre Dec 2, 2021
3463847
release it
rob-balfre Dec 2, 2021
08b5425
Release 5.0.0-alpha.5
rob-balfre Dec 2, 2021
0ca29f2
Moving styles back to components. Updated docs for v5
rob-balfre Dec 19, 2021
df2ed21
tailwind build steps
rob-balfre Dec 20, 2021
af3028f
readme and build clean up
rob-balfre Dec 20, 2021
8d026fc
version
rob-balfre Dec 20, 2021
da3c37e
Release 5.0.0-alpha.5
rob-balfre Dec 20, 2021
c176b2a
npm
rob-balfre Dec 20, 2021
3bb7f88
release-it loop
rob-balfre Dec 20, 2021
24f8128
Release 5.0.0-alpha.6
rob-balfre Dec 20, 2021
e4f0535
after:bump
rob-balfre Dec 20, 2021
0a37d5b
Release 5.0.0-alpha.7
rob-balfre Dec 20, 2021
ea0062b
deprecating camelCase custom props in favour of kebab-case for v5
rob-balfre Dec 21, 2021
d3e30cc
#363 @html getGroupHeaderLabel
rob-balfre Dec 21, 2021
4c4676f
Merge branch 'feature/v5' of https://github.com/rob-balfre/svelte-sel…
rob-balfre Dec 21, 2021
0cbea98
Release 5.0.0-alpha.8
rob-balfre Dec 21, 2021
50a49cd
css clean up
rob-balfre Dec 21, 2021
3a9af7c
test fix
rob-balfre Dec 21, 2021
065cf10
Release 5.0.0-alpha.9
rob-balfre Dec 21, 2021
d45f247
min-width fix
rob-balfre Dec 22, 2021
d0be223
Release 5.0.0-alpha.10
rob-balfre Dec 22, 2021
caa9be7
5.0.0-beta updates
rob-balfre Feb 7, 2022
f20c055
preRelease=beta
rob-balfre Feb 28, 2022
59de8f3
Release 5.0.0-beta.0
rob-balfre Feb 28, 2022
512ad23
deps bump
rob-balfre Mar 15, 2022
3f963ce
debounce timeout fix
rob-balfre Mar 15, 2022
4f18a27
Release 5.0.0-beta.1
rob-balfre Mar 15, 2022
3e207c9
#392 suggestions docs fix
rob-balfre Apr 11, 2022
45d087c
dep bump
rob-balfre Apr 11, 2022
43cf46f
clean up
rob-balfre Apr 11, 2022
f4bf2b7
Release 5.0.0-beta.2
rob-balfre Apr 11, 2022
257d7bf
isScrollingTimer clean up
rob-balfre Apr 12, 2022
7ecc86b
v5 docs
rob-balfre Apr 12, 2022
ecd1709
VirtualList docs fix
rob-balfre Apr 12, 2022
38b09c6
#336 itemCreated docs
rob-balfre Apr 12, 2022
5c9f5e0
#331 group headers hover index fix
rob-balfre Apr 12, 2022
1ebeea6
Release 5.0.0-beta.3
rob-balfre Apr 12, 2022
90912ec
#383 hidden inputs should bind value not labels
rob-balfre Apr 12, 2022
b9b0b4f
Release 5.0.0-beta.4
rob-balfre Apr 12, 2022
5c75ff3
#367 added selected-item-color custom css prop
rob-balfre Apr 12, 2022
437a254
Docs clean up
rob-balfre Apr 12, 2022
b3b5aee
Release 5.0.0-beta.5
rob-balfre Apr 12, 2022
aad416a
#342 group headers fix
rob-balfre Apr 12, 2022
0ebe3cb
Release 5.0.0-beta.6
rob-balfre Apr 12, 2022
bc653e9
Bump minimist
rob-balfre Apr 12, 2022
d874048
Docs and CSS clean up
rob-balfre Apr 12, 2022
b969fbe
Release 5.0.0-beta.7
rob-balfre Apr 12, 2022
dc8d256
#395 suggestions docs
rob-balfre Apr 13, 2022
c450371
Release 5.0.0-beta.8
rob-balfre Apr 13, 2022
f397105
tailwind styles tweak for icons
rob-balfre Apr 14, 2022
a5d129e
Release 5.0.0-beta.9
rob-balfre Apr 14, 2022
6396502
bump
rob-balfre Apr 18, 2022
dbfab50
#396 on:select fix and added on:change
rob-balfre Apr 18, 2022
00b0582
Release 5.0.0-beta.10
rob-balfre Apr 18, 2022
c180c82
#396 on:change and justValue clear fix
rob-balfre Apr 19, 2022
ce8f196
Release 5.0.0-beta.11
rob-balfre Apr 19, 2022
33647f5
docs: Add missing `showIndicator` deprecation
ZerdoX-x May 18, 2022
fcf685d
Merge pull request #410 from ZerdoX-x/patch-2
rob-balfre May 19, 2022
5c0241c
#401 Update docs for justValue and make debounce a function expression
rob-balfre May 19, 2022
249262d
dep bump
rob-balfre May 19, 2022
7e74a32
#402 list placement update, dep bump and clean up
rob-balfre Jun 8, 2022
9259af6
Release 5.0.0-beta.12
rob-balfre Jun 8, 2022
36c55b4
clickoutside fix
rob-balfre Jun 8, 2022
4e62ebe
Release 5.0.0-beta.13
rob-balfre Jun 8, 2022
9cf0efb
#403 chevron pointer events fix
rob-balfre Jun 8, 2022
45c41e7
Release 5.0.0-beta.14
rob-balfre Jun 8, 2022
f2bc769
#427 change class ‘list-container’ to ‘svelte-select-list’
rob-balfre Jun 27, 2022
fce6853
added placement class of ‘top’ or ‘bottom’ to list
rob-balfre Jun 27, 2022
4d7423c
clean up and removing timeout for list appendChild
rob-balfre Jun 27, 2022
a6f6134
fix filtering when groupFilter exists
rob-balfre Jun 28, 2022
f9a882c
#433 added sanitiseLabel method
rob-balfre Jul 14, 2022
22acac0
#434 #431 #429 expose computePlacement and added prop appendListTarget
rob-balfre Jul 14, 2022
b3a4dba
Release 5.0.0-beta.15
rob-balfre Jul 14, 2022
cda04f8
whoops shouldn’t have $app/env in there
rob-balfre Jul 14, 2022
d898eda
Release 5.0.0-beta.16
rob-balfre Jul 14, 2022
cc6d5f9
tidy up and readme github fix
rob-balfre Jul 14, 2022
b0ac583
Removed Selection component, added selection named slot, renamed prop…
rob-balfre Jul 21, 2022
3ef7434
Removed Multi, now uses named slot
rob-balfre Jul 22, 2022
8ef98ce
icons all now named slots and removed ‘is’ from props
rob-balfre Jul 24, 2022
07dccc3
First stage converting List and Item into named slots
rob-balfre Jul 27, 2022
5ef7eab
README update
rob-balfre Jul 27, 2022
d698056
npm docs
rob-balfre Jul 27, 2022
6ccbdec
Added list and item named slots. internal refactoring. Removing redun…
rob-balfre Jul 29, 2022
c5809f7
prevent clear from opening list on pointerdown
rob-balfre Jul 29, 2022
6d37651
clean up and bug fixes
rob-balfre Aug 2, 2022
b468946
tests and examples
rob-balfre Aug 9, 2022
16ff51a
examples and StackBlitz setup
rob-balfre Aug 10, 2022
379c6df
examples md
rob-balfre Aug 10, 2022
494b341
clean up
rob-balfre Aug 10, 2022
7a1e52c
clean up
rob-balfre Aug 10, 2022
a297d01
Release 5.0.0-beta.17
rob-balfre Aug 10, 2022
d3c8454
clean up
rob-balfre Aug 10, 2022
13c7a1d
Add functions for manipulating `hoverItemIndex`
b3ngg Aug 11, 2022
1daac1e
Skip non selectable items
b3ngg Aug 11, 2022
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
12 changes: 6 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
node_modules
.DS_Store
.idea
.nova
/dist/
/test/public/index.js
/test/public/bundle.css
/test/public/tests.js
/test/public/tests.css
/spec/page/public/build
/test-results
/.svelte-kit
/package
/src/lib/no-styles
.env
4 changes: 3 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
"useTabs": false,
"singleQuote": true,
"tabWidth": 4,
"printWidth": 120,
"bracketSameLine": true,
"overrides": [
{
"files": ["*.svelte"],
Expand All @@ -10,6 +12,6 @@
}
}
],
"svelteSortOrder": "scripts-styles-markup",
"svelteSortOrder": "scripts-markup-styles",
"svelteBracketNewLine": false
}
75 changes: 72 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,74 @@
# svelte-select changelog

## 5.0.0

* Removed `hasError` prop use `class` instead
* Removed CSS prop `--input-font-size`
* Removed CSS prop `--multi-item-border`
* Removed CSS prop `--multi-label-margin`
* Added CSS props `--loading--margin , --loading-color, --loading-height, --loading-width`
* Added CSS prop `--chevron-border`
* Added CSS prop `--font-size`
* Added CSS prop `--multi-item-gap`
* Added named slot `multi-clear-icon`
* Added named slot `list`
* Added named slot `item`
* Removed Virtual list
* noOptionsMessage removed
* optionIdentifier -> itemId
* getOptionLabel removed
* getGroupHeaderLabel removed
* itemCreated event removed
* labelIdentifier -> label
* creatable removed, use named slots and bake in your create own logic
* isGroupHeaderSelectable -> groupHeaderSelectable
* isSearchable -> searchable
* isFocused -> focused
* isCreatable -> creatable
* isClearable -> clearable
* isWaiting -> loading
* Added named slot `prepend`
* Added named slot `chevron`
* Added named slot `clear-icon`
* Added named slot `loading-icon`
* Removed iconProps
* Removed ClearIcon component
* Removed ChevronIcon component
* Removed Multi component
* Added named slot `selection`
* Removed Selection component
* isMulti -> multiple
* Other improvements (see docs)
* select-container -> svelte-select
* added justValue
* Placeholder default change from 'Select...' to 'Please select'
* added blur and focus events
* computePlacement now computes to fixed list
* removed isOutOfViewport and clickOutside
* new debounce method
* filterMethod changed to filter
* added support for svelte-tiny-virtual-list
* removed virtual-list class and css props
* loadOptionsInterval -> debounceWait
* selectedValue removed
* MultiSelection -> Multi
* added postcss to example, tests
* tailwind css option
* breaking: containerClasses -> class
* listGroupTitle -> list-group-title
* listContainer -> list
* selectContainer and other CSS class names updated, selectContainer -> svelte-select for example
* LoadingIcon prop added
* CSS props updates. Added .icons and removed some css vars
* Removed logic to show chevron if isSearchable is false
* indicator class renamed to chevron
* showIndicator renamed showChevron
* indicatorSvg removed, use ChevronIcon going forward
* removed playwright and puppeteer, tests now just run in the browser with sirv
* debounce method is now exported as a prop
* Convert repo to use SvelteKit
* Change licence from LIL to ISC

## 4.4.1

* Added missing prop 'placeholderAlwaysShow' to TypeScript declaration file (#305) - thanks to @paolotiu
Expand Down Expand Up @@ -27,7 +96,7 @@

## 4.2.5

* isMulti on:select fix (#276)
* multiple on:select fix (#276)

## 4.2.4

Expand Down Expand Up @@ -77,7 +146,7 @@

## 3.15.0

* Added new prop multiFullItemClearable for easier clearable items when isMulti is true - thanks to @stephenlrandall
* Added new prop multiFullItemClearable for easier clearable items when multiple is true - thanks to @stephenlrandall

## 3.14.3

Expand Down Expand Up @@ -294,7 +363,7 @@

## 1.5.5

* isMulti on:select bug fix
* multiple on:select bug fix

## 1.5.4

Expand Down
3 changes: 3 additions & 0 deletions EXAMPLES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# svelte-select examples

All props, slots and events have an example file located in: `src/routes/examples`.
112 changes: 112 additions & 0 deletions MIGRATION_GUIDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
## Migrating for v4 to v5

v5 is a major release that that includes some ⚠️ BREAKING CHANGES ⚠️

Removed `hasError`. Not needed.<br/>
Removed `getOptionLabel`. Not needed.<br/>
Removed `getGroupHeaderLabel`. Not needed.<br/>
Removed `noOptionsMessage`. Not needed.

Removed `Selection`, `ChevronIcon`, `ClearIcon`, `LoadingIcon`, `Icon`, `List` and `Item` components, use named slots instead:

```html
<Select bind:items bind:value>
<div slot="prepend" />
<div slot="selection" let:selection />
<div slot="clear-icon" />
<div slot="multi-clear-icon" />
<div slot="loading-icon" />
<div slot="chevron-icon" />
<div slot="list" let:filteredItems />
<div slot="item" let:item let:index />
<div slot="empty" />
</Select>
```

Removed `isVirtualList`. Use named slots.

```svelte
<script>
import VirtualList from 'svelte-tiny-virtual-list';
...
</script>

<Select>
<div slot="list" let:filteredItems>
<VirtualList {...} />
</div>
</Select>
```

Removed `isCreatable` prop and `itemCreated` event, named slots can be used to bake in your own create method

```html
<Select>
<div slot="empty" on:click={..your-create-method-here...}>
CREATE: {filterText}
</div>
</Select>
```

### CSS Camel to kebab:

CSS classes and custom properties changed (only depreciated, no need to update if upgrading from v4) from camel to kebab case. For example `selectedItem` → `selected-item` and `--borderRadius` → `--border-radius`

### Redundant CSS custom properties:

The following CSS custom properties were removed in v5.

```css
--clearSelectColor
--clearSelectFocusColor
--clearSelectHoverColor
--groupTitleTextTransform
--indicatorColor
--indicatorFill
--indicatorHeight
--listLeft
--listRight
--multiClearBG
--multiClearFill
--multiClearHeight
--multiClearHoverBG
--multiClearHoverFill
--multiClearPadding
--multiClearRadius
--multiClearTextAlign
--multiClearTop
--multiClearWidth
--multiItemActiveBG
--multiItemActiveColor
--spinnerLeft
--spinnerRight
--virtualListHeight
```


### Other CSS class name changes:
`selectContainer` → `svelte-select`<br/>
`listContainer` → `svelte-select-list`<br/>
`indicator` → `chevron`<br/>
`--clear-icon-colour` → `--clear-icon-color`<br/>
`virtual-list` removed


### Prop changes:
`containerClasses` → `class`<br/>
`MultiSelection` → `Multi`<br/>
`indicatorSvg` → `ChevronIcon`<br/>
`showIndicator` → `showChevron`<br/>
`loadOptionsInterval` → `debounceWait`<br/>
`isMulti` → `multiple`<br/>
`isWaiting` → `loading`<br/>
`isClearable` → `clearable`<br/>
`isFocused` → `focused`<br/>
`isGroupHeaderSelectable` → `groupHeaderSelectable`<br/>
`isDisabled` → `disabled`<br/>
`labelIdentifier` -> `label`<br/>
`optionIdentifier` -> `itemId`<br/>
`selectedValue` removed (was already deprecated in v4 in favour of `value`)<br/>

### Event change:
The `select` event now only fires when the user selects an item. If you also want to track programmatic changes use the new `change` event.
Loading