bits-ui 0.21.13 → 0.21.14
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.
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script>import { derived } from "svelte/store";
|
|
2
2
|
import { setCtx } from "../ctx.js";
|
|
3
|
+
export let portal = void 0;
|
|
3
4
|
export let open = void 0;
|
|
4
5
|
export let onOpenChange = void 0;
|
|
5
6
|
export let value = void 0;
|
|
@@ -179,6 +180,8 @@ $:
|
|
|
179
180
|
updateOption("numberOfMonths", numberOfMonths);
|
|
180
181
|
$:
|
|
181
182
|
updateOption("onOutsideClick", onOutsideClick);
|
|
183
|
+
$:
|
|
184
|
+
updateOption("portal", portal);
|
|
182
185
|
</script>
|
|
183
186
|
|
|
184
187
|
<slot ids={$idValues} isInvalid={$localIsInvalid} />
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
<script>import { derived } from "svelte/store";
|
|
2
2
|
import { setCtx } from "../ctx.js";
|
|
3
|
+
export let open = void 0;
|
|
4
|
+
export let onOpenChange = void 0;
|
|
5
|
+
export let portal = void 0;
|
|
3
6
|
export let value = void 0;
|
|
4
7
|
export let onValueChange = void 0;
|
|
5
8
|
export let placeholder = void 0;
|
|
@@ -27,6 +30,7 @@ export let numberOfMonths = void 0;
|
|
|
27
30
|
export let onOutsideClick = void 0;
|
|
28
31
|
const {
|
|
29
32
|
states: {
|
|
33
|
+
open: localOpen,
|
|
30
34
|
value: localValue,
|
|
31
35
|
placeholder: localPlaceholder,
|
|
32
36
|
isInvalid: localIsInvalid,
|
|
@@ -36,6 +40,7 @@ const {
|
|
|
36
40
|
updateOption,
|
|
37
41
|
ids
|
|
38
42
|
} = setCtx({
|
|
43
|
+
defaultOpen: open,
|
|
39
44
|
defaultValue: value,
|
|
40
45
|
defaultPlaceholder: placeholder,
|
|
41
46
|
preventDeselect,
|
|
@@ -44,6 +49,7 @@ const {
|
|
|
44
49
|
isDateDisabled,
|
|
45
50
|
fixedWeeks,
|
|
46
51
|
calendarLabel,
|
|
52
|
+
portal,
|
|
47
53
|
disabled,
|
|
48
54
|
granularity,
|
|
49
55
|
hideTimeZone,
|
|
@@ -69,6 +75,13 @@ const {
|
|
|
69
75
|
placeholder = next;
|
|
70
76
|
}
|
|
71
77
|
return next;
|
|
78
|
+
},
|
|
79
|
+
onOpenChange: ({ next }) => {
|
|
80
|
+
if (open !== next) {
|
|
81
|
+
onOpenChange?.(next);
|
|
82
|
+
open = next;
|
|
83
|
+
}
|
|
84
|
+
return next;
|
|
72
85
|
}
|
|
73
86
|
});
|
|
74
87
|
const startFieldIds = derived(
|
|
@@ -190,6 +203,8 @@ $:
|
|
|
190
203
|
}
|
|
191
204
|
$:
|
|
192
205
|
placeholder !== void 0 && localPlaceholder.set(placeholder);
|
|
206
|
+
$:
|
|
207
|
+
open !== void 0 && localOpen.set(open);
|
|
193
208
|
$:
|
|
194
209
|
updateOption("disabled", disabled);
|
|
195
210
|
$:
|
|
@@ -226,6 +241,8 @@ $:
|
|
|
226
241
|
updateOption("numberOfMonths", numberOfMonths);
|
|
227
242
|
$:
|
|
228
243
|
updateOption("onOutsideClick", onOutsideClick);
|
|
244
|
+
$:
|
|
245
|
+
updateOption("portal", portal);
|
|
229
246
|
</script>
|
|
230
247
|
|
|
231
248
|
<slot
|