Skip to content

Commit e578881

Browse files
committed
fix: add FiniteGrid, update prettier/readme
1 parent 98efc35 commit e578881

File tree

3 files changed

+43
-18
lines changed

3 files changed

+43
-18
lines changed

.prettierrc

+9-1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,13 @@
33
"singleQuote": true,
44
"trailingComma": "none",
55
"printWidth": 100,
6-
"svelteBracketNewLine": true
6+
"svelteBracketNewLine": true,
7+
"overrides": [
8+
{
9+
"files": "*.md",
10+
"options": {
11+
"useTabs": false
12+
}
13+
}
14+
]
715
}

README.md

+17-17
Original file line numberDiff line numberDiff line change
@@ -10,34 +10,34 @@ A small date picker built with Svelte 3. Demo available here: [view docs and exa
1010
npm i -D svelte-calendar
1111
```
1212

13+
## Features
14+
15+
- Day, Month & Year pickers
16+
- Responsive
17+
- Keyboard, touch, and scroll support
18+
- Inline & Picker modes
19+
- Virtual/infinite grid for animation performance
20+
- Store-driven and extensible
21+
- [Localization](https://6edesign.github.io/svelte-calendar) using `day.js`
22+
1323
## Usage within svelte-kit project
1424

1525
When using this component within a svelte-kit application it is necessary to add its two dependencies (`just-throttle` and `dayjs`) to the `config.kit.vite.optimizeDeps.include` array in `svelte.config.js`. Eg: your config should include the following:
1626

1727
```js
1828
const config = {
19-
kit: {
20-
vite: {
21-
optimizeDeps: {
22-
include: ['just-throttle', 'dayjs']
23-
}
24-
}
25-
}
29+
kit: {
30+
vite: {
31+
optimizeDeps: {
32+
include: ['just-throttle', 'dayjs']
33+
}
34+
}
35+
}
2636
};
2737

2838
export default config;
2939
```
3040

31-
## Features
32-
33-
- Day, Month & Year pickers
34-
- Responsive
35-
- Keyboard, touch, and scroll support
36-
- Inline & Picker modes
37-
- Virtual/infinite grid for animation performance
38-
- Store-driven and extensible
39-
- [Localization](https://6edesign.github.io/svelte-calendar) using `day.js`
40-
4141
## Features In Development
4242

4343
- time picker
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<script>
2+
import InfiniteGrid from './InfiniteGrid.svelte';
3+
4+
export let value;
5+
export let values;
6+
export let index = 0;
7+
8+
const cellCount = 1;
9+
const get = (i) => ({ value: values[i] });
10+
11+
$: itemCount = values.length;
12+
$: index = values.indexOf(value);
13+
</script>
14+
15+
<InfiniteGrid {cellCount} {itemCount} {index} {get} let:value>
16+
<slot {value} />
17+
</InfiniteGrid>

0 commit comments

Comments
 (0)