bits-ui 0.11.0 → 0.11.2
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/date-range-picker/_types.d.ts +17 -0
- package/dist/bits/date-range-picker/components/date-range-picker-field.svelte.d.ts +1 -0
- package/dist/bits/date-range-picker/components/date-range-picker.svelte +5 -2
- package/dist/bits/date-range-picker/components/date-range-picker.svelte.d.ts +1 -0
- package/dist/bits/range-calendar/_types.d.ts +17 -0
- package/dist/bits/range-calendar/components/range-calendar.svelte +5 -2
- package/dist/bits/select/_types.d.ts +10 -1
- package/dist/bits/select/components/select.svelte.d.ts +4 -0
- package/package.json +1 -1
|
@@ -49,6 +49,23 @@ type Props = Expand<WithOmission<CreateDateRangePickerProps> & {
|
|
|
49
49
|
* This is used to apply the appropriate `aria-describedby` attribute to the input.
|
|
50
50
|
*/
|
|
51
51
|
descriptionId?: string;
|
|
52
|
+
/**
|
|
53
|
+
* The `start` value of the date range, which can exist prior
|
|
54
|
+
* to the `value` being set. The `value` is only set once a `start`
|
|
55
|
+
* and `end` value are selected.
|
|
56
|
+
*
|
|
57
|
+
* You can `bind:startValue` to a value to receive updates outside
|
|
58
|
+
* this component when the user selects a `start` value.
|
|
59
|
+
*
|
|
60
|
+
* Modifying this value outside the component will have no effect.
|
|
61
|
+
* To programmatically control the `start` value, use `bind:value`
|
|
62
|
+
* and update the `start` property of the `DateRange` object.
|
|
63
|
+
*
|
|
64
|
+
* This is provided as a convenience for use cases where you want
|
|
65
|
+
* to display the selected `start` value outside the component before
|
|
66
|
+
* the `value` is set.
|
|
67
|
+
*/
|
|
68
|
+
startValue?: DateValue | undefined;
|
|
52
69
|
} & AsChild>;
|
|
53
70
|
type InputProps = AsChild;
|
|
54
71
|
type DescriptionProps = AsChild;
|
|
@@ -33,6 +33,7 @@ declare const __propDef: {
|
|
|
33
33
|
onPlaceholderChange?: import("../../../internal/types.js").OnChangeFn<import("@internationalized/date").DateValue> | undefined;
|
|
34
34
|
validationId?: string | undefined;
|
|
35
35
|
descriptionId?: string | undefined;
|
|
36
|
+
startValue?: import("@internationalized/date").DateValue | undefined;
|
|
36
37
|
asChild?: boolean | undefined;
|
|
37
38
|
};
|
|
38
39
|
events: {
|
|
@@ -22,12 +22,13 @@ export let isDateDisabled = void 0;
|
|
|
22
22
|
export let fixedWeeks = void 0;
|
|
23
23
|
export let calendarLabel = void 0;
|
|
24
24
|
export let weekdayFormat = void 0;
|
|
25
|
+
export let startValue = void 0;
|
|
25
26
|
const {
|
|
26
27
|
states: {
|
|
27
28
|
value: localValue,
|
|
28
29
|
placeholder: localPlaceholder,
|
|
29
30
|
isInvalid: localIsInvalid,
|
|
30
|
-
startValue,
|
|
31
|
+
startValue: localStartValue,
|
|
31
32
|
endValue
|
|
32
33
|
},
|
|
33
34
|
updateOption,
|
|
@@ -172,6 +173,8 @@ $:
|
|
|
172
173
|
if (descriptionId) {
|
|
173
174
|
ids.rangeField.field.description.set(descriptionId);
|
|
174
175
|
}
|
|
176
|
+
$:
|
|
177
|
+
startValue = $localStartValue;
|
|
175
178
|
$:
|
|
176
179
|
value !== void 0 && localValue.set(value);
|
|
177
180
|
$:
|
|
@@ -212,7 +215,7 @@ $:
|
|
|
212
215
|
slotProps = {
|
|
213
216
|
isInvalid: $localIsInvalid,
|
|
214
217
|
ids: $idValues,
|
|
215
|
-
startValue: $
|
|
218
|
+
startValue: $localStartValue,
|
|
216
219
|
endValue: $endValue
|
|
217
220
|
};
|
|
218
221
|
</script>
|
|
@@ -33,6 +33,7 @@ declare const __propDef: {
|
|
|
33
33
|
onPlaceholderChange?: import("../../../internal/types.js").OnChangeFn<import("@internationalized/date").DateValue> | undefined;
|
|
34
34
|
validationId?: string | undefined;
|
|
35
35
|
descriptionId?: string | undefined;
|
|
36
|
+
startValue?: import("@internationalized/date").DateValue | undefined;
|
|
36
37
|
asChild?: boolean | undefined;
|
|
37
38
|
};
|
|
38
39
|
events: {
|
|
@@ -41,6 +41,23 @@ type Props = Expand<Omit<CreateRangeCalendarProps, "placeholder" | "defaultPlace
|
|
|
41
41
|
* @default false
|
|
42
42
|
*/
|
|
43
43
|
initialFocus?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* The `start` value of the date range, which can exist prior
|
|
46
|
+
* to the `value` being set. The `value` is only set once a `start`
|
|
47
|
+
* and `end` value are selected.
|
|
48
|
+
*
|
|
49
|
+
* You can `bind:startValue` to a value to receive updates outside
|
|
50
|
+
* this component when the user selects a `start` value.
|
|
51
|
+
*
|
|
52
|
+
* Modifying this value outside the component will have no effect.
|
|
53
|
+
* To programmatically control the `start` value, use `bind:value`
|
|
54
|
+
* and update the `start` property of the `DateRange` object.
|
|
55
|
+
*
|
|
56
|
+
* This is provided as a convenience for use cases where you want
|
|
57
|
+
* to display the selected `start` value outside the component before
|
|
58
|
+
* the `value` is set.
|
|
59
|
+
*/
|
|
60
|
+
startValue?: DateValue | undefined;
|
|
44
61
|
} & AsChild>;
|
|
45
62
|
type PrevButtonProps = AsChild;
|
|
46
63
|
type NextButtonProps = AsChild;
|
|
@@ -23,6 +23,7 @@ export let asChild = false;
|
|
|
23
23
|
export let id = void 0;
|
|
24
24
|
export let weekdayFormat = void 0;
|
|
25
25
|
export let initialFocus = false;
|
|
26
|
+
export let startValue = void 0;
|
|
26
27
|
let el = void 0;
|
|
27
28
|
onMount(() => {
|
|
28
29
|
if (!initialFocus || !el)
|
|
@@ -36,7 +37,7 @@ const {
|
|
|
36
37
|
placeholder: localPlaceholder,
|
|
37
38
|
months,
|
|
38
39
|
weekdays,
|
|
39
|
-
startValue,
|
|
40
|
+
startValue: localStartValue,
|
|
40
41
|
endValue
|
|
41
42
|
},
|
|
42
43
|
updateOption,
|
|
@@ -76,6 +77,8 @@ $:
|
|
|
76
77
|
if (id) {
|
|
77
78
|
ids.calendar.set(id);
|
|
78
79
|
}
|
|
80
|
+
$:
|
|
81
|
+
startValue = $localStartValue;
|
|
79
82
|
$:
|
|
80
83
|
value !== void 0 && localValue.set(value);
|
|
81
84
|
$:
|
|
@@ -117,7 +120,7 @@ $:
|
|
|
117
120
|
builder,
|
|
118
121
|
months: $months,
|
|
119
122
|
weekdays: $weekdays,
|
|
120
|
-
startValue: $
|
|
123
|
+
startValue: $localStartValue,
|
|
121
124
|
endValue: $endValue
|
|
122
125
|
};
|
|
123
126
|
</script>
|
|
@@ -6,6 +6,10 @@
|
|
|
6
6
|
import type { CreateSelectProps, SelectOptionProps } from "@melt-ui/svelte";
|
|
7
7
|
import type { AsChild, Expand, OmitFloating, OnChangeFn } from "../../internal/index.js";
|
|
8
8
|
import type { ContentProps, ArrowProps } from "../floating/_types.js";
|
|
9
|
+
type Items<T> = {
|
|
10
|
+
value: T;
|
|
11
|
+
label?: string;
|
|
12
|
+
}[];
|
|
9
13
|
type Props<T = unknown, Multiple extends boolean = false> = Expand<OmitFloating<Omit<CreateSelectProps, "selected" | "defaultSelected" | "onSelectedChange">> & {
|
|
10
14
|
/**
|
|
11
15
|
* The selected value of the select.
|
|
@@ -30,9 +34,14 @@ type Props<T = unknown, Multiple extends boolean = false> = Expand<OmitFloating<
|
|
|
30
34
|
*/
|
|
31
35
|
onOpenChange?: OnChangeFn<boolean>;
|
|
32
36
|
/**
|
|
33
|
-
*
|
|
37
|
+
* Whether or not multiple values can be selected.
|
|
34
38
|
*/
|
|
35
39
|
multiple?: Multiple;
|
|
40
|
+
/**
|
|
41
|
+
* Optional array of items to add type-safety to the
|
|
42
|
+
* `onSelectedChange` callback and `selected` prop.
|
|
43
|
+
*/
|
|
44
|
+
items?: Items<T>;
|
|
36
45
|
}>;
|
|
37
46
|
type GroupProps = AsChild;
|
|
38
47
|
type InputProps = AsChild;
|
|
@@ -17,6 +17,10 @@ declare class __sveltets_Render<T extends unknown, Multiple extends boolean> {
|
|
|
17
17
|
onSelectedChange?: import("../../../internal/types.js").OnChangeFn<import("@melt-ui/svelte/internal/types").WhenTrue<Multiple, import("@melt-ui/svelte/index.js").ComboboxOption<T>[], import("@melt-ui/svelte/index.js").ComboboxOption<T>, import("@melt-ui/svelte/index.js").ComboboxOption<T>[] | import("@melt-ui/svelte/index.js").ComboboxOption<T>> | undefined> | undefined;
|
|
18
18
|
open?: boolean | undefined;
|
|
19
19
|
onOpenChange?: import("../../../internal/types.js").OnChangeFn<boolean> | undefined;
|
|
20
|
+
items?: {
|
|
21
|
+
value: T;
|
|
22
|
+
label?: string | undefined;
|
|
23
|
+
}[] | undefined;
|
|
20
24
|
}, "multiple"> & {
|
|
21
25
|
items?: {
|
|
22
26
|
value: T;
|