-
-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: date picker context issue (#260)
- Loading branch information
Showing
26 changed files
with
247 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"bits-ui": patch | ||
--- | ||
|
||
fix: date picker context issue |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
src/lib/bits/date-picker/components/date-picker-grid-body.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<script lang="ts"> | ||
import { getCtx } from "../ctx.js"; | ||
import type { GridBodyProps } from "../types.js"; | ||
type $$Props = GridBodyProps; | ||
export let asChild: $$Props["asChild"] = false; | ||
export let el: $$Props["el"] = undefined; | ||
const { getCalendarAttrs } = getCtx(); | ||
const attrs = getCalendarAttrs("grid-body"); | ||
</script> | ||
|
||
{#if asChild} | ||
<slot {attrs} /> | ||
{:else} | ||
<tbody bind:this={el} {...$$restProps} {...attrs}> | ||
<slot {attrs} /> | ||
</tbody> | ||
{/if} |
23 changes: 23 additions & 0 deletions
23
src/lib/bits/date-picker/components/date-picker-grid-head.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<script lang="ts"> | ||
import { getCtx } from "../ctx.js"; | ||
import type { GridHeadProps } from "../types.js"; | ||
type $$Props = GridHeadProps; | ||
export let asChild: $$Props["asChild"] = false; | ||
export let el: $$Props["el"] = undefined; | ||
const { getCalendarAttrs } = getCtx(); | ||
const attrs = { | ||
...getCalendarAttrs("grid-head"), | ||
"aria-hidden": true | ||
}; | ||
</script> | ||
|
||
{#if asChild} | ||
<slot {attrs} /> | ||
{:else} | ||
<thead bind:this={el} {...$$restProps} {...attrs}> | ||
<slot {attrs} /> | ||
</thead> | ||
{/if} |
21 changes: 21 additions & 0 deletions
21
src/lib/bits/date-picker/components/date-picker-grid-row.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<script lang="ts"> | ||
import { getCtx } from "../ctx.js"; | ||
import type { GridRowProps } from "../types.js"; | ||
type $$Props = GridRowProps; | ||
export let asChild: $$Props["asChild"] = false; | ||
export let el: $$Props["el"] = undefined; | ||
const { getCalendarAttrs } = getCtx(); | ||
const attrs = getCalendarAttrs("grid-row"); | ||
</script> | ||
|
||
{#if asChild} | ||
<slot {attrs} /> | ||
{:else} | ||
<tr bind:this={el} {...$$restProps} {...attrs}> | ||
<slot {attrs} /> | ||
</tr> | ||
{/if} |
19 changes: 19 additions & 0 deletions
19
src/lib/bits/date-picker/components/date-picker-head-cell.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<script lang="ts"> | ||
import { getCtx } from "../ctx.js"; | ||
import type { HeadCellProps } from "../types.js"; | ||
type $$Props = HeadCellProps; | ||
export let asChild: $$Props["asChild"] = false; | ||
export let el: $$Props["el"] = undefined; | ||
const { getCalendarAttrs } = getCtx(); | ||
const attrs = getCalendarAttrs("head-cell"); | ||
</script> | ||
|
||
{#if asChild} | ||
<slot {attrs} /> | ||
{:else} | ||
<th bind:this={el} {...$$restProps} {...attrs}> | ||
<slot {attrs} /> | ||
</th> | ||
{/if} |
20 changes: 20 additions & 0 deletions
20
src/lib/bits/date-picker/components/date-picker-header.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<script lang="ts"> | ||
import { getCtx } from "../ctx.js"; | ||
import type { HeaderProps } from "../types.js"; | ||
type $$Props = HeaderProps; | ||
export let asChild: $$Props["asChild"] = false; | ||
export let el: $$Props["el"] = undefined; | ||
const { getCalendarAttrs } = getCtx(); | ||
const attrs = getCalendarAttrs("header"); | ||
</script> | ||
|
||
{#if asChild} | ||
<slot {attrs} /> | ||
{:else} | ||
<header bind:this={el} {...$$restProps} {...attrs}> | ||
<slot {attrs} /> | ||
</header> | ||
{/if} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
src/lib/bits/date-range-picker/components/date-range-picker-grid-body.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<script lang="ts"> | ||
import { getCtx } from "../ctx.js"; | ||
import type { GridBodyProps } from "../types.js"; | ||
type $$Props = GridBodyProps; | ||
export let asChild: $$Props["asChild"] = false; | ||
export let el: $$Props["el"] = undefined; | ||
const { getCalendarAttrs } = getCtx(); | ||
const attrs = getCalendarAttrs("grid-body"); | ||
</script> | ||
|
||
{#if asChild} | ||
<slot {attrs} /> | ||
{:else} | ||
<tbody bind:this={el} {...$$restProps} {...attrs}> | ||
<slot /> | ||
</tbody> | ||
{/if} |
19 changes: 19 additions & 0 deletions
19
src/lib/bits/date-range-picker/components/date-range-picker-grid-head.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<script lang="ts"> | ||
import { getCtx } from "../ctx.js"; | ||
import type { GridHeadProps } from "../types.js"; | ||
type $$Props = GridHeadProps; | ||
export let asChild: $$Props["asChild"] = false; | ||
export let el: $$Props["el"] = undefined; | ||
const { getCalendarAttrs } = getCtx(); | ||
const attrs = { ...getCalendarAttrs("grid-head"), "aria-hidden": true }; | ||
</script> | ||
|
||
{#if asChild} | ||
<slot {attrs} /> | ||
{:else} | ||
<thead bind:this={el} {...$$restProps} {...attrs}> | ||
<slot /> | ||
</thead> | ||
{/if} |
20 changes: 20 additions & 0 deletions
20
src/lib/bits/date-range-picker/components/date-range-picker-grid-row.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<script lang="ts"> | ||
import { getCtx } from "../ctx.js"; | ||
import type { GridRowProps } from "../types.js"; | ||
type $$Props = GridRowProps; | ||
export let asChild: $$Props["asChild"] = false; | ||
export let el: $$Props["el"] = undefined; | ||
const { getCalendarAttrs } = getCtx(); | ||
const attrs = getCalendarAttrs("grid-row"); | ||
</script> | ||
|
||
{#if asChild} | ||
<slot {attrs} /> | ||
{:else} | ||
<tr bind:this={el} {...$$restProps} {...attrs}> | ||
<slot {attrs} /> | ||
</tr> | ||
{/if} |
20 changes: 20 additions & 0 deletions
20
src/lib/bits/date-range-picker/components/date-range-picker-head-cell.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<script lang="ts"> | ||
import { getCtx } from "../ctx.js"; | ||
import type { HeadCellProps } from "../types.js"; | ||
type $$Props = HeadCellProps; | ||
export let asChild: $$Props["asChild"] = false; | ||
export let el: $$Props["el"] = undefined; | ||
const { getCalendarAttrs } = getCtx(); | ||
const attrs = getCalendarAttrs("head-cell"); | ||
</script> | ||
|
||
{#if asChild} | ||
<slot {attrs} /> | ||
{:else} | ||
<th bind:this={el} {...$$restProps} {...attrs}> | ||
<slot /> | ||
</th> | ||
{/if} |
Oops, something went wrong.