bits-ui 0.13.2 → 0.13.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bits/calendar/components/calendar-cell.svelte +2 -2
- package/dist/bits/calendar/components/calendar-day.svelte +2 -2
- package/dist/bits/calendar/components/calendar-grid-body.svelte +2 -2
- package/dist/bits/calendar/components/calendar-grid-head.svelte +2 -2
- package/dist/bits/calendar/components/calendar-grid-row.svelte +2 -2
- package/dist/bits/calendar/components/calendar-grid.svelte +2 -2
- package/dist/bits/calendar/components/calendar-head-cell.svelte +2 -2
- package/dist/bits/calendar/components/calendar-header.svelte +2 -2
- package/dist/bits/calendar/components/calendar-heading.svelte +2 -2
- package/dist/bits/calendar/components/calendar-next-button.svelte +2 -2
- package/dist/bits/calendar/components/calendar-prev-button.svelte +2 -2
- package/dist/bits/calendar/components/calendar.svelte +2 -2
- package/dist/bits/calendar/ctx.d.ts +1 -1
- package/dist/bits/calendar/ctx.js +6 -3
- package/dist/bits/date-picker/components/date-picker-grid-body.svelte +14 -0
- package/dist/bits/date-picker/components/date-picker-grid-body.svelte.d.ts +19 -0
- package/dist/bits/date-picker/components/date-picker-grid-head.svelte +17 -0
- package/dist/bits/date-picker/components/date-picker-grid-head.svelte.d.ts +21 -0
- package/dist/bits/date-picker/components/date-picker-grid-row.svelte +14 -0
- package/dist/bits/date-picker/components/date-picker-grid-row.svelte.d.ts +19 -0
- package/dist/bits/date-picker/components/date-picker-head-cell.svelte +14 -0
- package/dist/bits/date-picker/components/date-picker-head-cell.svelte.d.ts +19 -0
- package/dist/bits/date-picker/components/date-picker-header.svelte +14 -0
- package/dist/bits/date-picker/components/date-picker-header.svelte.d.ts +19 -0
- package/dist/bits/date-picker/index.d.ts +5 -5
- package/dist/bits/date-picker/index.js +5 -5
- package/dist/bits/date-range-picker/components/date-range-picker-grid-body.svelte +14 -0
- package/dist/bits/date-range-picker/components/date-range-picker-grid-body.svelte.d.ts +17 -0
- package/dist/bits/date-range-picker/components/date-range-picker-grid-head.svelte +14 -0
- package/dist/bits/date-range-picker/components/date-range-picker-grid-head.svelte.d.ts +17 -0
- package/dist/bits/date-range-picker/components/date-range-picker-grid-row.svelte +14 -0
- package/dist/bits/date-range-picker/components/date-range-picker-grid-row.svelte.d.ts +19 -0
- package/dist/bits/date-range-picker/components/date-range-picker-head-cell.svelte +14 -0
- package/dist/bits/date-range-picker/components/date-range-picker-head-cell.svelte.d.ts +17 -0
- package/dist/bits/date-range-picker/components/date-range-picker-header.svelte +14 -0
- package/dist/bits/date-range-picker/components/date-range-picker-header.svelte.d.ts +19 -0
- package/dist/bits/date-range-picker/index.d.ts +5 -5
- package/dist/bits/date-range-picker/index.js +5 -5
- package/dist/bits/pagination/components/pagination.svelte +11 -2
- package/package.json +1 -1
|
@@ -4,11 +4,11 @@ export let asChild = false;
|
|
|
4
4
|
export let el = void 0;
|
|
5
5
|
const {
|
|
6
6
|
helpers: { isDateDisabled, isDateUnavailable },
|
|
7
|
-
|
|
7
|
+
getCalendarAttrs
|
|
8
8
|
} = getCtx();
|
|
9
9
|
$:
|
|
10
10
|
attrs = {
|
|
11
|
-
...
|
|
11
|
+
...getCalendarAttrs("cell"),
|
|
12
12
|
"aria-disabled": $isDateDisabled(date) || $isDateUnavailable(date),
|
|
13
13
|
"data-disabled": $isDateDisabled(date) ? "" : void 0,
|
|
14
14
|
role: "gridcell"
|
|
@@ -8,9 +8,9 @@ export let el = void 0;
|
|
|
8
8
|
const {
|
|
9
9
|
elements: { cell },
|
|
10
10
|
helpers: { isDateDisabled, isDateUnavailable, isDateSelected },
|
|
11
|
-
|
|
11
|
+
getCalendarAttrs
|
|
12
12
|
} = getCtx();
|
|
13
|
-
const attrs =
|
|
13
|
+
const attrs = getCalendarAttrs("day");
|
|
14
14
|
const dispatch = createDispatcher();
|
|
15
15
|
$:
|
|
16
16
|
builder = $cell(date, month);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<script>import { getCtx } from "../ctx.js";
|
|
2
2
|
export let asChild = false;
|
|
3
3
|
export let el = void 0;
|
|
4
|
-
const {
|
|
5
|
-
const attrs =
|
|
4
|
+
const { getCalendarAttrs } = getCtx();
|
|
5
|
+
const attrs = getCalendarAttrs("grid-body");
|
|
6
6
|
</script>
|
|
7
7
|
|
|
8
8
|
{#if asChild}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<script>import { getCtx } from "../ctx.js";
|
|
2
2
|
export let asChild = false;
|
|
3
3
|
export let el = void 0;
|
|
4
|
-
const {
|
|
4
|
+
const { getCalendarAttrs } = getCtx();
|
|
5
5
|
const attrs = {
|
|
6
|
-
...
|
|
6
|
+
...getCalendarAttrs("grid-head"),
|
|
7
7
|
"aria-hidden": true
|
|
8
8
|
};
|
|
9
9
|
</script>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<script>import { getCtx } from "../ctx.js";
|
|
2
2
|
export let asChild = false;
|
|
3
3
|
export let el = void 0;
|
|
4
|
-
const {
|
|
5
|
-
const attrs =
|
|
4
|
+
const { getCalendarAttrs } = getCtx();
|
|
5
|
+
const attrs = getCalendarAttrs("grid-row");
|
|
6
6
|
</script>
|
|
7
7
|
|
|
8
8
|
{#if asChild}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<script>import { getCtx } from "../ctx.js";
|
|
2
2
|
export let asChild = false;
|
|
3
3
|
export let el = void 0;
|
|
4
|
-
const {
|
|
5
|
-
const attrs =
|
|
4
|
+
const { getCalendarAttrs } = getCtx();
|
|
5
|
+
const attrs = getCalendarAttrs("head-cell");
|
|
6
6
|
</script>
|
|
7
7
|
|
|
8
8
|
{#if asChild}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<script>import { getCtx } from "../ctx.js";
|
|
2
2
|
export let asChild = false;
|
|
3
3
|
export let el = void 0;
|
|
4
|
-
const {
|
|
5
|
-
const attrs =
|
|
4
|
+
const { getCalendarAttrs } = getCtx();
|
|
5
|
+
const attrs = getCalendarAttrs("header");
|
|
6
6
|
</script>
|
|
7
7
|
|
|
8
8
|
{#if asChild}
|
|
@@ -5,9 +5,9 @@ export let asChild = false;
|
|
|
5
5
|
export let el = void 0;
|
|
6
6
|
const {
|
|
7
7
|
elements: { nextButton },
|
|
8
|
-
|
|
8
|
+
getCalendarAttrs
|
|
9
9
|
} = getCtx();
|
|
10
|
-
const attrs =
|
|
10
|
+
const attrs = getCalendarAttrs("next-button");
|
|
11
11
|
$:
|
|
12
12
|
builder = $nextButton;
|
|
13
13
|
$:
|
|
@@ -5,9 +5,9 @@ export let asChild = false;
|
|
|
5
5
|
export let el = void 0;
|
|
6
6
|
const {
|
|
7
7
|
elements: { prevButton },
|
|
8
|
-
|
|
8
|
+
getCalendarAttrs
|
|
9
9
|
} = getCtx();
|
|
10
|
-
const attrs =
|
|
10
|
+
const attrs = getCalendarAttrs("prev-button");
|
|
11
11
|
$:
|
|
12
12
|
builder = $prevButton;
|
|
13
13
|
$:
|
|
@@ -41,7 +41,7 @@ const {
|
|
|
41
41
|
},
|
|
42
42
|
updateOption,
|
|
43
43
|
ids,
|
|
44
|
-
|
|
44
|
+
getCalendarAttrs
|
|
45
45
|
} = setCtx({
|
|
46
46
|
defaultPlaceholder: placeholder,
|
|
47
47
|
defaultValue: value,
|
|
@@ -121,7 +121,7 @@ $:
|
|
|
121
121
|
updateOption("weekdayFormat", weekdayFormat);
|
|
122
122
|
$:
|
|
123
123
|
updateOption("numberOfMonths", numberOfMonths);
|
|
124
|
-
const attrs =
|
|
124
|
+
const attrs = getCalendarAttrs("root");
|
|
125
125
|
$:
|
|
126
126
|
builder = $calendar;
|
|
127
127
|
$:
|
|
@@ -7,7 +7,7 @@ export declare function getCalendarData(): {
|
|
|
7
7
|
type GetReturn = Omit<ReturnType<typeof setCtx>, "updateOption">;
|
|
8
8
|
export declare function setCtx<Multiple extends boolean>(props: CreateCalendarProps<Multiple>): {
|
|
9
9
|
updateOption: <K extends string, V extends unknown>(key: K, value: V | undefined) => void;
|
|
10
|
-
|
|
10
|
+
getCalendarAttrs: (part: "day" | "header" | "root" | "cell" | "grid" | "heading" | "prev-button" | "next-button" | "grid-head" | "head-cell" | "grid-body" | "grid-row") => Record<string, string>;
|
|
11
11
|
elements: {
|
|
12
12
|
calendar: import("@melt-ui/svelte/internal/helpers").ExplicitBuilderReturn<[import("svelte/store").Readable<string>, import("svelte/store").Readable<boolean>, import("svelte/store").Writable<boolean>, import("svelte/store").Writable<boolean>, import("svelte/store").Writable<string>], (node: HTMLElement) => import("@melt-ui/svelte/internal/types").MeltActionReturn<"keydown">, ([$fullCalendarLabel, $isInvalid, $disabled, $readonly, $calendarId]: [string, boolean, boolean, boolean, string]) => {
|
|
13
13
|
id: string;
|
|
@@ -21,8 +21,9 @@ export function getCalendarData() {
|
|
|
21
21
|
}
|
|
22
22
|
export function setCtx(props) {
|
|
23
23
|
const { NAME, PARTS } = getCalendarData();
|
|
24
|
-
const
|
|
25
|
-
|
|
24
|
+
const getCalendarAttrs = createBitAttrs(NAME, PARTS);
|
|
25
|
+
console.log(getCalendarAttrs);
|
|
26
|
+
const calendar = { ...createCalendar(removeUndefined(props)), getCalendarAttrs };
|
|
26
27
|
setContext(NAME, calendar);
|
|
27
28
|
return {
|
|
28
29
|
...calendar,
|
|
@@ -31,5 +32,7 @@ export function setCtx(props) {
|
|
|
31
32
|
}
|
|
32
33
|
export function getCtx() {
|
|
33
34
|
const { NAME } = getCalendarData();
|
|
34
|
-
|
|
35
|
+
const ctx = getContext(NAME);
|
|
36
|
+
console.log(ctx);
|
|
37
|
+
return ctx;
|
|
35
38
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<script>import { getCtx } from "../ctx.js";
|
|
2
|
+
export let asChild = false;
|
|
3
|
+
export let el = void 0;
|
|
4
|
+
const { getCalendarAttrs } = getCtx();
|
|
5
|
+
const attrs = getCalendarAttrs("grid-body");
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
{#if asChild}
|
|
9
|
+
<slot {attrs} />
|
|
10
|
+
{:else}
|
|
11
|
+
<tbody bind:this={el} {...$$restProps} {...attrs}>
|
|
12
|
+
<slot {attrs} />
|
|
13
|
+
</tbody>
|
|
14
|
+
{/if}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
import type { GridBodyProps } from "../types.js";
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: GridBodyProps;
|
|
5
|
+
events: {
|
|
6
|
+
[evt: string]: CustomEvent<any>;
|
|
7
|
+
};
|
|
8
|
+
slots: {
|
|
9
|
+
default: {
|
|
10
|
+
attrs: Record<string, string>;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
export type DatePickerGridBodyProps = typeof __propDef.props;
|
|
15
|
+
export type DatePickerGridBodyEvents = typeof __propDef.events;
|
|
16
|
+
export type DatePickerGridBodySlots = typeof __propDef.slots;
|
|
17
|
+
export default class DatePickerGridBody extends SvelteComponent<DatePickerGridBodyProps, DatePickerGridBodyEvents, DatePickerGridBodySlots> {
|
|
18
|
+
}
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<script>import { getCtx } from "../ctx.js";
|
|
2
|
+
export let asChild = false;
|
|
3
|
+
export let el = void 0;
|
|
4
|
+
const { getCalendarAttrs } = getCtx();
|
|
5
|
+
const attrs = {
|
|
6
|
+
...getCalendarAttrs("grid-head"),
|
|
7
|
+
"aria-hidden": true
|
|
8
|
+
};
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
{#if asChild}
|
|
12
|
+
<slot {attrs} />
|
|
13
|
+
{:else}
|
|
14
|
+
<thead bind:this={el} {...$$restProps} {...attrs}>
|
|
15
|
+
<slot {attrs} />
|
|
16
|
+
</thead>
|
|
17
|
+
{/if}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
import type { GridHeadProps } from "../types.js";
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: GridHeadProps;
|
|
5
|
+
events: {
|
|
6
|
+
[evt: string]: CustomEvent<any>;
|
|
7
|
+
};
|
|
8
|
+
slots: {
|
|
9
|
+
default: {
|
|
10
|
+
attrs: {
|
|
11
|
+
"aria-hidden": boolean;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
export type DatePickerGridHeadProps = typeof __propDef.props;
|
|
17
|
+
export type DatePickerGridHeadEvents = typeof __propDef.events;
|
|
18
|
+
export type DatePickerGridHeadSlots = typeof __propDef.slots;
|
|
19
|
+
export default class DatePickerGridHead extends SvelteComponent<DatePickerGridHeadProps, DatePickerGridHeadEvents, DatePickerGridHeadSlots> {
|
|
20
|
+
}
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<script>import { getCtx } from "../ctx.js";
|
|
2
|
+
export let asChild = false;
|
|
3
|
+
export let el = void 0;
|
|
4
|
+
const { getCalendarAttrs } = getCtx();
|
|
5
|
+
const attrs = getCalendarAttrs("grid-row");
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
{#if asChild}
|
|
9
|
+
<slot {attrs} />
|
|
10
|
+
{:else}
|
|
11
|
+
<tr bind:this={el} {...$$restProps} {...attrs}>
|
|
12
|
+
<slot {attrs} />
|
|
13
|
+
</tr>
|
|
14
|
+
{/if}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
import type { GridRowProps } from "../types.js";
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: GridRowProps;
|
|
5
|
+
events: {
|
|
6
|
+
[evt: string]: CustomEvent<any>;
|
|
7
|
+
};
|
|
8
|
+
slots: {
|
|
9
|
+
default: {
|
|
10
|
+
attrs: Record<string, string>;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
export type DatePickerGridRowProps = typeof __propDef.props;
|
|
15
|
+
export type DatePickerGridRowEvents = typeof __propDef.events;
|
|
16
|
+
export type DatePickerGridRowSlots = typeof __propDef.slots;
|
|
17
|
+
export default class DatePickerGridRow extends SvelteComponent<DatePickerGridRowProps, DatePickerGridRowEvents, DatePickerGridRowSlots> {
|
|
18
|
+
}
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<script>import { getCtx } from "../ctx.js";
|
|
2
|
+
export let asChild = false;
|
|
3
|
+
export let el = void 0;
|
|
4
|
+
const { getCalendarAttrs } = getCtx();
|
|
5
|
+
const attrs = getCalendarAttrs("head-cell");
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
{#if asChild}
|
|
9
|
+
<slot {attrs} />
|
|
10
|
+
{:else}
|
|
11
|
+
<th bind:this={el} {...$$restProps} {...attrs}>
|
|
12
|
+
<slot {attrs} />
|
|
13
|
+
</th>
|
|
14
|
+
{/if}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
import type { HeadCellProps } from "../types.js";
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: HeadCellProps;
|
|
5
|
+
events: {
|
|
6
|
+
[evt: string]: CustomEvent<any>;
|
|
7
|
+
};
|
|
8
|
+
slots: {
|
|
9
|
+
default: {
|
|
10
|
+
attrs: Record<string, string>;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
export type DatePickerHeadCellProps = typeof __propDef.props;
|
|
15
|
+
export type DatePickerHeadCellEvents = typeof __propDef.events;
|
|
16
|
+
export type DatePickerHeadCellSlots = typeof __propDef.slots;
|
|
17
|
+
export default class DatePickerHeadCell extends SvelteComponent<DatePickerHeadCellProps, DatePickerHeadCellEvents, DatePickerHeadCellSlots> {
|
|
18
|
+
}
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<script>import { getCtx } from "../ctx.js";
|
|
2
|
+
export let asChild = false;
|
|
3
|
+
export let el = void 0;
|
|
4
|
+
const { getCalendarAttrs } = getCtx();
|
|
5
|
+
const attrs = getCalendarAttrs("header");
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
{#if asChild}
|
|
9
|
+
<slot {attrs} />
|
|
10
|
+
{:else}
|
|
11
|
+
<header bind:this={el} {...$$restProps} {...attrs}>
|
|
12
|
+
<slot {attrs} />
|
|
13
|
+
</header>
|
|
14
|
+
{/if}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
import type { HeaderProps } from "../types.js";
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: HeaderProps;
|
|
5
|
+
events: {
|
|
6
|
+
[evt: string]: CustomEvent<any>;
|
|
7
|
+
};
|
|
8
|
+
slots: {
|
|
9
|
+
default: {
|
|
10
|
+
attrs: Record<string, string>;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
export type DatePickerHeaderProps = typeof __propDef.props;
|
|
15
|
+
export type DatePickerHeaderEvents = typeof __propDef.events;
|
|
16
|
+
export type DatePickerHeaderSlots = typeof __propDef.slots;
|
|
17
|
+
export default class DatePickerHeader extends SvelteComponent<DatePickerHeaderProps, DatePickerHeaderEvents, DatePickerHeaderSlots> {
|
|
18
|
+
}
|
|
19
|
+
export {};
|
|
@@ -8,11 +8,11 @@ export { default as Label } from "./components/date-picker-label.svelte";
|
|
|
8
8
|
export { default as Segment } from "./components/date-picker-segment.svelte";
|
|
9
9
|
export { default as Trigger } from "./components/date-picker-trigger.svelte";
|
|
10
10
|
export { default as Root } from "./components/date-picker.svelte";
|
|
11
|
-
export { default as GridBody } from "
|
|
12
|
-
export { default as GridHead } from "
|
|
13
|
-
export { default as GridRow } from "
|
|
14
|
-
export { default as HeadCell } from "
|
|
15
|
-
export { default as Header } from "
|
|
11
|
+
export { default as GridBody } from "./components/date-picker-grid-body.svelte";
|
|
12
|
+
export { default as GridHead } from "./components/date-picker-grid-head.svelte";
|
|
13
|
+
export { default as GridRow } from "./components/date-picker-grid-row.svelte";
|
|
14
|
+
export { default as HeadCell } from "./components/date-picker-head-cell.svelte";
|
|
15
|
+
export { default as Header } from "./components/date-picker-header.svelte";
|
|
16
16
|
export { default as Cell } from "./components/date-picker-cell.svelte";
|
|
17
17
|
export { default as Day } from "./components/date-picker-day.svelte";
|
|
18
18
|
export { default as Grid } from "./components/date-picker-grid.svelte";
|
|
@@ -8,11 +8,11 @@ export { default as Label } from "./components/date-picker-label.svelte";
|
|
|
8
8
|
export { default as Segment } from "./components/date-picker-segment.svelte";
|
|
9
9
|
export { default as Trigger } from "./components/date-picker-trigger.svelte";
|
|
10
10
|
export { default as Root } from "./components/date-picker.svelte";
|
|
11
|
-
export { default as GridBody } from "
|
|
12
|
-
export { default as GridHead } from "
|
|
13
|
-
export { default as GridRow } from "
|
|
14
|
-
export { default as HeadCell } from "
|
|
15
|
-
export { default as Header } from "
|
|
11
|
+
export { default as GridBody } from "./components/date-picker-grid-body.svelte";
|
|
12
|
+
export { default as GridHead } from "./components/date-picker-grid-head.svelte";
|
|
13
|
+
export { default as GridRow } from "./components/date-picker-grid-row.svelte";
|
|
14
|
+
export { default as HeadCell } from "./components/date-picker-head-cell.svelte";
|
|
15
|
+
export { default as Header } from "./components/date-picker-header.svelte";
|
|
16
16
|
export { default as Cell } from "./components/date-picker-cell.svelte";
|
|
17
17
|
export { default as Day } from "./components/date-picker-day.svelte";
|
|
18
18
|
export { default as Grid } from "./components/date-picker-grid.svelte";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<script>import { getCtx } from "../ctx.js";
|
|
2
|
+
export let asChild = false;
|
|
3
|
+
export let el = void 0;
|
|
4
|
+
const { getCalendarAttrs } = getCtx();
|
|
5
|
+
const attrs = getCalendarAttrs("grid-body");
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
{#if asChild}
|
|
9
|
+
<slot {attrs} />
|
|
10
|
+
{:else}
|
|
11
|
+
<tbody bind:this={el} {...$$restProps} {...attrs}>
|
|
12
|
+
<slot />
|
|
13
|
+
</tbody>
|
|
14
|
+
{/if}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
import type { GridBodyProps } from "../types.js";
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: GridBodyProps;
|
|
5
|
+
events: {
|
|
6
|
+
[evt: string]: CustomEvent<any>;
|
|
7
|
+
};
|
|
8
|
+
slots: {
|
|
9
|
+
default: {};
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
export type DateRangePickerGridBodyProps = typeof __propDef.props;
|
|
13
|
+
export type DateRangePickerGridBodyEvents = typeof __propDef.events;
|
|
14
|
+
export type DateRangePickerGridBodySlots = typeof __propDef.slots;
|
|
15
|
+
export default class DateRangePickerGridBody extends SvelteComponent<DateRangePickerGridBodyProps, DateRangePickerGridBodyEvents, DateRangePickerGridBodySlots> {
|
|
16
|
+
}
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<script>import { getCtx } from "../ctx.js";
|
|
2
|
+
export let asChild = false;
|
|
3
|
+
export let el = void 0;
|
|
4
|
+
const { getCalendarAttrs } = getCtx();
|
|
5
|
+
const attrs = { ...getCalendarAttrs("grid-head"), "aria-hidden": true };
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
{#if asChild}
|
|
9
|
+
<slot {attrs} />
|
|
10
|
+
{:else}
|
|
11
|
+
<thead bind:this={el} {...$$restProps} {...attrs}>
|
|
12
|
+
<slot />
|
|
13
|
+
</thead>
|
|
14
|
+
{/if}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
import type { GridHeadProps } from "../types.js";
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: GridHeadProps;
|
|
5
|
+
events: {
|
|
6
|
+
[evt: string]: CustomEvent<any>;
|
|
7
|
+
};
|
|
8
|
+
slots: {
|
|
9
|
+
default: {};
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
export type DateRangePickerGridHeadProps = typeof __propDef.props;
|
|
13
|
+
export type DateRangePickerGridHeadEvents = typeof __propDef.events;
|
|
14
|
+
export type DateRangePickerGridHeadSlots = typeof __propDef.slots;
|
|
15
|
+
export default class DateRangePickerGridHead extends SvelteComponent<DateRangePickerGridHeadProps, DateRangePickerGridHeadEvents, DateRangePickerGridHeadSlots> {
|
|
16
|
+
}
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<script>import { getCtx } from "../ctx.js";
|
|
2
|
+
export let asChild = false;
|
|
3
|
+
export let el = void 0;
|
|
4
|
+
const { getCalendarAttrs } = getCtx();
|
|
5
|
+
const attrs = getCalendarAttrs("grid-row");
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
{#if asChild}
|
|
9
|
+
<slot {attrs} />
|
|
10
|
+
{:else}
|
|
11
|
+
<tr bind:this={el} {...$$restProps} {...attrs}>
|
|
12
|
+
<slot {attrs} />
|
|
13
|
+
</tr>
|
|
14
|
+
{/if}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
import type { GridRowProps } from "../types.js";
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: GridRowProps;
|
|
5
|
+
events: {
|
|
6
|
+
[evt: string]: CustomEvent<any>;
|
|
7
|
+
};
|
|
8
|
+
slots: {
|
|
9
|
+
default: {
|
|
10
|
+
attrs: Record<string, string>;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
export type DateRangePickerGridRowProps = typeof __propDef.props;
|
|
15
|
+
export type DateRangePickerGridRowEvents = typeof __propDef.events;
|
|
16
|
+
export type DateRangePickerGridRowSlots = typeof __propDef.slots;
|
|
17
|
+
export default class DateRangePickerGridRow extends SvelteComponent<DateRangePickerGridRowProps, DateRangePickerGridRowEvents, DateRangePickerGridRowSlots> {
|
|
18
|
+
}
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<script>import { getCtx } from "../ctx.js";
|
|
2
|
+
export let asChild = false;
|
|
3
|
+
export let el = void 0;
|
|
4
|
+
const { getCalendarAttrs } = getCtx();
|
|
5
|
+
const attrs = getCalendarAttrs("head-cell");
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
{#if asChild}
|
|
9
|
+
<slot {attrs} />
|
|
10
|
+
{:else}
|
|
11
|
+
<th bind:this={el} {...$$restProps} {...attrs}>
|
|
12
|
+
<slot />
|
|
13
|
+
</th>
|
|
14
|
+
{/if}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
import type { HeadCellProps } from "../types.js";
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: HeadCellProps;
|
|
5
|
+
events: {
|
|
6
|
+
[evt: string]: CustomEvent<any>;
|
|
7
|
+
};
|
|
8
|
+
slots: {
|
|
9
|
+
default: {};
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
export type DateRangePickerHeadCellProps = typeof __propDef.props;
|
|
13
|
+
export type DateRangePickerHeadCellEvents = typeof __propDef.events;
|
|
14
|
+
export type DateRangePickerHeadCellSlots = typeof __propDef.slots;
|
|
15
|
+
export default class DateRangePickerHeadCell extends SvelteComponent<DateRangePickerHeadCellProps, DateRangePickerHeadCellEvents, DateRangePickerHeadCellSlots> {
|
|
16
|
+
}
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<script>import { getCtx } from "../ctx.js";
|
|
2
|
+
export let asChild = false;
|
|
3
|
+
export let el = void 0;
|
|
4
|
+
const { getCalendarAttrs } = getCtx();
|
|
5
|
+
const attrs = getCalendarAttrs("header");
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
{#if asChild}
|
|
9
|
+
<slot {attrs} />
|
|
10
|
+
{:else}
|
|
11
|
+
<header bind:this={el} {...$$restProps} {...attrs}>
|
|
12
|
+
<slot {attrs} />
|
|
13
|
+
</header>
|
|
14
|
+
{/if}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
import type { HeaderProps } from "../types.js";
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: HeaderProps;
|
|
5
|
+
events: {
|
|
6
|
+
[evt: string]: CustomEvent<any>;
|
|
7
|
+
};
|
|
8
|
+
slots: {
|
|
9
|
+
default: {
|
|
10
|
+
attrs: Record<string, string>;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
export type DateRangePickerHeaderProps = typeof __propDef.props;
|
|
15
|
+
export type DateRangePickerHeaderEvents = typeof __propDef.events;
|
|
16
|
+
export type DateRangePickerHeaderSlots = typeof __propDef.slots;
|
|
17
|
+
export default class DateRangePickerHeader extends SvelteComponent<DateRangePickerHeaderProps, DateRangePickerHeaderEvents, DateRangePickerHeaderSlots> {
|
|
18
|
+
}
|
|
19
|
+
export {};
|
|
@@ -14,9 +14,9 @@ export { default as Segment } from "./components/date-range-picker-segment.svelt
|
|
|
14
14
|
export { default as Trigger } from "./components/date-range-picker-trigger.svelte";
|
|
15
15
|
export { default as Root } from "./components/date-range-picker.svelte";
|
|
16
16
|
export { default as Grid } from "./components/date-range-picker-grid.svelte";
|
|
17
|
-
export { default as GridBody } from "
|
|
18
|
-
export { default as GridHead } from "
|
|
19
|
-
export { default as GridRow } from "
|
|
20
|
-
export { default as HeadCell } from "
|
|
21
|
-
export { default as Header } from "
|
|
17
|
+
export { default as GridBody } from "./components/date-range-picker-grid-body.svelte";
|
|
18
|
+
export { default as GridHead } from "./components/date-range-picker-grid-head.svelte";
|
|
19
|
+
export { default as GridRow } from "./components/date-range-picker-grid-row.svelte";
|
|
20
|
+
export { default as HeadCell } from "./components/date-range-picker-head-cell.svelte";
|
|
21
|
+
export { default as Header } from "./components/date-range-picker-header.svelte";
|
|
22
22
|
export type * from "./types.js";
|
|
@@ -14,8 +14,8 @@ export { default as Segment } from "./components/date-range-picker-segment.svelt
|
|
|
14
14
|
export { default as Trigger } from "./components/date-range-picker-trigger.svelte";
|
|
15
15
|
export { default as Root } from "./components/date-range-picker.svelte";
|
|
16
16
|
export { default as Grid } from "./components/date-range-picker-grid.svelte";
|
|
17
|
-
export { default as GridBody } from "
|
|
18
|
-
export { default as GridHead } from "
|
|
19
|
-
export { default as GridRow } from "
|
|
20
|
-
export { default as HeadCell } from "
|
|
21
|
-
export { default as Header } from "
|
|
17
|
+
export { default as GridBody } from "./components/date-range-picker-grid-body.svelte";
|
|
18
|
+
export { default as GridHead } from "./components/date-range-picker-grid-head.svelte";
|
|
19
|
+
export { default as GridRow } from "./components/date-range-picker-grid-row.svelte";
|
|
20
|
+
export { default as HeadCell } from "./components/date-range-picker-head-cell.svelte";
|
|
21
|
+
export { default as Header } from "./components/date-range-picker-header.svelte";
|
|
@@ -9,8 +9,9 @@ export let asChild = false;
|
|
|
9
9
|
export let el = void 0;
|
|
10
10
|
const {
|
|
11
11
|
elements: { root },
|
|
12
|
-
states: { pages, range },
|
|
13
|
-
getAttrs
|
|
12
|
+
states: { pages, range, page: localPage },
|
|
13
|
+
getAttrs,
|
|
14
|
+
updateOption
|
|
14
15
|
} = setCtx({
|
|
15
16
|
count,
|
|
16
17
|
perPage,
|
|
@@ -24,11 +25,19 @@ const {
|
|
|
24
25
|
return next;
|
|
25
26
|
}
|
|
26
27
|
});
|
|
28
|
+
$:
|
|
29
|
+
page !== void 0 && localPage.set(page);
|
|
27
30
|
const attrs = getAttrs("root");
|
|
28
31
|
$:
|
|
29
32
|
builder = $root;
|
|
30
33
|
$:
|
|
31
34
|
Object.assign(builder, attrs);
|
|
35
|
+
$:
|
|
36
|
+
updateOption("count", count);
|
|
37
|
+
$:
|
|
38
|
+
updateOption("perPage", perPage);
|
|
39
|
+
$:
|
|
40
|
+
updateOption("siblingCount", siblingCount);
|
|
32
41
|
</script>
|
|
33
42
|
|
|
34
43
|
{#if asChild}
|