flowbite-svelte 1.8.5 → 1.8.6
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.
|
@@ -36,8 +36,9 @@
|
|
|
36
36
|
monthColor = "alternative",
|
|
37
37
|
monthBtnSelected = "bg-primary-500 text-white",
|
|
38
38
|
monthBtn = "text-gray-700 dark:text-gray-300",
|
|
39
|
-
class: className
|
|
40
|
-
|
|
39
|
+
class: className,
|
|
40
|
+
elementRef = $bindable() // NEW: Add elementRef prop
|
|
41
|
+
}: DatepickerProps & { translationLocale?: string; elementRef?: HTMLInputElement } = $props();
|
|
41
42
|
|
|
42
43
|
const dateFormatDefault = { year: "numeric", month: "long", day: "numeric" };
|
|
43
44
|
|
|
@@ -45,6 +46,13 @@
|
|
|
45
46
|
let isOpen: boolean = $state(inline);
|
|
46
47
|
let showMonthSelector: boolean = $state(false);
|
|
47
48
|
let inputElement: HTMLInputElement | null = $state(null);
|
|
49
|
+
|
|
50
|
+
// Update elementRef when inputElement changes
|
|
51
|
+
$effect(() => {
|
|
52
|
+
if (inputElement) {
|
|
53
|
+
elementRef = inputElement;
|
|
54
|
+
}
|
|
55
|
+
});
|
|
48
56
|
let datepickerContainerElement: HTMLDivElement;
|
|
49
57
|
let currentMonth: Date = $state(value || defaultDate || new Date());
|
|
50
58
|
let focusedDate: Date | null = null;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { type DatepickerProps } from "..";
|
|
2
2
|
type $$ComponentProps = DatepickerProps & {
|
|
3
3
|
translationLocale?: string;
|
|
4
|
+
elementRef?: HTMLInputElement;
|
|
4
5
|
};
|
|
5
|
-
declare const Datepicker: import("svelte").Component<$$ComponentProps, {}, "value" | "rangeFrom" | "rangeTo">;
|
|
6
|
+
declare const Datepicker: import("svelte").Component<$$ComponentProps, {}, "value" | "elementRef" | "rangeFrom" | "rangeTo">;
|
|
6
7
|
type Datepicker = ReturnType<typeof Datepicker>;
|
|
7
8
|
export default Datepicker;
|