Skip to content

Commit

Permalink
Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
probablykasper committed Dec 11, 2021
1 parent e22577c commit 244b6c5
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 12 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@
"svelteSortOrder": "options-scripts-markup-styles",
"svelteStrictMode": false,
"svelteAllowShorthand": true,
"svelteBracketNewLine": false,
"svelteIndentScriptAndStyle": true
}
}
3 changes: 2 additions & 1 deletion src/lib/DateInput.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@
{placeholder}
on:focus={() => (visible = true)}
on:mousedown={() => (visible = true)}
on:input={input} />
on:input={input}
/>
{#if visible}
<div class="picker" class:visible transition:fly={{ duration: 80, easing: cubicInOut, y: -5 }}>
<DateTimePicker on:focusout={onFocusOut} bind:value={$store} {min} {max} {locale} />
Expand Down
19 changes: 13 additions & 6 deletions src/lib/DatePicker.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -163,15 +163,18 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"
><path
d="M5 3l3.057-3 11.943 12-11.943 12-3.057-3 9-9z"
transform="rotate(180, 12, 12)" /></svg>
transform="rotate(180, 12, 12)"
/></svg
>
</div>
<div class="dropdown month">
<select bind:value={month} on:keydown={monthKeydown}>
{#each iLocale.months as monthName, i}
<option
disabled={new Date(year, i, getMonthLength(year, i), 23, 59, 59, 999) < min ||
new Date(year, i) > max}
value={i}>{monthName}</option>
value={i}>{monthName}</option
>
{/each}
</select>
<!--
Expand All @@ -187,7 +190,8 @@
{/each}
</select>
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"
><path d="M6 0l12 12-12 12z" transform="rotate(90, 12, 12)" /></svg>
><path d="M6 0l12 12-12 12z" transform="rotate(90, 12, 12)" /></svg
>
</div>
<div class="dropdown year">
<select bind:value={year} on:keydown={yearKeydown}>
Expand All @@ -202,11 +206,13 @@
{/each}
</select>
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"
><path d="M6 0l12 12-12 12z" transform="rotate(90, 12, 12)" /></svg>
><path d="M6 0l12 12-12 12z" transform="rotate(90, 12, 12)" /></svg
>
</div>
<div class="page-button" tabindex="-1" on:click={() => setMonth(month + 1)}>
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"
><path d="M5 3l3.057-3 11.943 12-11.943 12-3.057-3 9-9z" /></svg>
><path d="M5 3l3.057-3 11.943 12-11.943 12-3.057-3 9-9z" /></svg
>
</div>
</div>
<div class="header">
Expand All @@ -226,7 +232,8 @@
on:click={() => setDay(calendarDay)}
class:disabled={!dayIsInRange(calendarDay)}
class:selected={calendarDay.month === month && calendarDay.number === dayOfMonth}
class:other-month={calendarDay.month !== month}>
class:other-month={calendarDay.month !== month}
>
<span>{calendarDay.number}</span>
</div>
{/each}
Expand Down
3 changes: 2 additions & 1 deletion src/routes/_DateInput.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
bind:placeholder
bind:valid
bind:format
bind:visible />
bind:visible
/>

<svelte:fragment slot="right">
<h3 class="no-top">Props</h3>
Expand Down
7 changes: 5 additions & 2 deletions src/routes/__layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@
<a class="nav-link" href="/demo">Demo</a>
<a class="nav-link" href="/docs">Docs</a>
<a class="nav-link" href="https://svelte.dev/repl/044911429c4b4e659362518d9a5deaae?version=3"
>REPL</a>
>REPL</a
>
<div class="spacer" />
<a class="nav-link" href="https://github.com/probablykasper/date-picker-svelte">GitHub</a>
<button class="theme-toggle" on:click={toggleTheme}>
Expand All @@ -49,7 +50,9 @@
height="22px"
width="22px"
><rect fill="none" height="24" width="24" /><path
d="M9.37,5.51C9.19,6.15,9.1,6.82,9.1,7.5c0,4.08,3.32,7.4,7.4,7.4c0.68,0,1.35-0.09,1.99-0.27C17.45,17.19,14.93,19,12,19 c-3.86,0-7-3.14-7-7C5,9.07,6.81,6.55,9.37,5.51z M12,3c-4.97,0-9,4.03-9,9s4.03,9,9,9s9-4.03,9-9c0-0.46-0.04-0.92-0.1-1.36 c-0.98,1.37-2.58,2.26-4.4,2.26c-2.98,0-5.4-2.42-5.4-5.4c0-1.81,0.89-3.42,2.26-4.4C12.92,3.04,12.46,3,12,3L12,3z" /></svg>
d="M9.37,5.51C9.19,6.15,9.1,6.82,9.1,7.5c0,4.08,3.32,7.4,7.4,7.4c0.68,0,1.35-0.09,1.99-0.27C17.45,17.19,14.93,19,12,19 c-3.86,0-7-3.14-7-7C5,9.07,6.81,6.55,9.37,5.51z M12,3c-4.97,0-9,4.03-9,9s4.03,9,9,9s9-4.03,9-9c0-0.46-0.04-0.92-0.1-1.36 c-0.98,1.37-2.58,2.26-4.4,2.26c-2.98,0-5.4-2.42-5.4-5.4c0-1.81,0.89-3.42,2.26-4.4C12.92,3.04,12.46,3,12,3L12,3z"
/></svg
>
</button>
</header>
<div class="page">
Expand Down
3 changes: 2 additions & 1 deletion src/routes/index.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
<li>Internationalization (i18n)</li>
<li
>Autopunctuation (e.g typing "20201111111111" gives you "2020-11-11 11:11:11" with the default
format)</li>
format)</li
>
<li>Keyboard shortcuts</li>
</ul>

Expand Down

0 comments on commit 244b6c5

Please sign in to comment.