flowbite-svelte 1.2.0 → 1.2.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/accordion/AccordionItem.svelte +5 -3
- package/dist/accordion/AccordionItem.svelte.d.ts +2 -0
- package/dist/alert/Alert.svelte +1 -1
- package/dist/alert/Alert.svelte.d.ts +1 -1
- package/dist/avatar/Avatar.svelte +1 -1
- package/dist/avatar/Avatar.svelte.d.ts +1 -1
- package/dist/badge/Badge.svelte +1 -1
- package/dist/badge/Badge.svelte.d.ts +1 -1
- package/dist/banner/Banner.svelte +1 -1
- package/dist/banner/Banner.svelte.d.ts +1 -1
- package/dist/bottom-navigation/BottomNav.svelte +1 -1
- package/dist/bottom-navigation/BottomNav.svelte.d.ts +1 -1
- package/dist/bottom-navigation/BottomNavHeader.svelte +1 -1
- package/dist/bottom-navigation/BottomNavHeader.svelte.d.ts +1 -1
- package/dist/bottom-navigation/BottomNavHeaderItem.svelte +1 -1
- package/dist/bottom-navigation/BottomNavHeaderItem.svelte.d.ts +1 -1
- package/dist/bottom-navigation/BottomNavItem.svelte +1 -1
- package/dist/bottom-navigation/BottomNavItem.svelte.d.ts +1 -1
- package/dist/breadcrumb/Breadcrumb.svelte +1 -1
- package/dist/breadcrumb/Breadcrumb.svelte.d.ts +1 -1
- package/dist/breadcrumb/BreadcrumbItem.svelte +1 -1
- package/dist/breadcrumb/BreadcrumbItem.svelte.d.ts +1 -1
- package/dist/buttongroup/ButtonGroup.svelte +4 -2
- package/dist/buttongroup/ButtonGroup.svelte.d.ts +2 -1
- package/dist/buttons/Button.svelte +6 -3
- package/dist/buttons/Button.svelte.d.ts +1 -1
- package/dist/buttons/GradientButton.svelte +1 -1
- package/dist/buttons/GradientButton.svelte.d.ts +1 -1
- package/dist/card/Card.svelte +1 -1
- package/dist/card/Card.svelte.d.ts +1 -1
- package/dist/carousel/Carousel.svelte +1 -1
- package/dist/carousel/Carousel.svelte.d.ts +1 -1
- package/dist/carousel/ControlButton.svelte +1 -1
- package/dist/carousel/ControlButton.svelte.d.ts +1 -1
- package/dist/carousel/Controls.svelte +1 -1
- package/dist/carousel/Controls.svelte.d.ts +1 -1
- package/dist/carousel/Indicators.svelte +1 -1
- package/dist/carousel/Indicators.svelte.d.ts +1 -1
- package/dist/carousel/Slide.svelte +1 -1
- package/dist/carousel/Slide.svelte.d.ts +1 -1
- package/dist/carousel/Thumbnail.svelte +1 -1
- package/dist/carousel/Thumbnail.svelte.d.ts +1 -1
- package/dist/carousel/Thumbnails.svelte +1 -1
- package/dist/carousel/Thumbnails.svelte.d.ts +1 -1
- package/dist/chart/Chart.svelte +1 -1
- package/dist/chart/Chart.svelte.d.ts +1 -1
- package/dist/darkmode/DarkMode.svelte +1 -1
- package/dist/darkmode/DarkMode.svelte.d.ts +1 -1
- package/dist/datepicker/Datepicker.svelte +3 -3
- package/dist/datepicker/Datepicker.svelte.d.ts +1 -1
- package/dist/device-mockups/Android.svelte +1 -1
- package/dist/device-mockups/Android.svelte.d.ts +1 -1
- package/dist/device-mockups/DefaultMockup.svelte +1 -1
- package/dist/device-mockups/DefaultMockup.svelte.d.ts +1 -1
- package/dist/device-mockups/Desktop.svelte +1 -1
- package/dist/device-mockups/Desktop.svelte.d.ts +1 -1
- package/dist/device-mockups/DeviceMockup.svelte +1 -1
- package/dist/device-mockups/DeviceMockup.svelte.d.ts +1 -1
- package/dist/device-mockups/Ios.svelte +1 -1
- package/dist/device-mockups/Ios.svelte.d.ts +1 -1
- package/dist/device-mockups/Laptop.svelte +1 -1
- package/dist/device-mockups/Laptop.svelte.d.ts +1 -1
- package/dist/device-mockups/Smartwatch.svelte +1 -1
- package/dist/device-mockups/Smartwatch.svelte.d.ts +1 -1
- package/dist/device-mockups/Tablet.svelte +1 -1
- package/dist/device-mockups/Tablet.svelte.d.ts +1 -1
- package/dist/drawer/Drawer.svelte +1 -1
- package/dist/drawer/Drawer.svelte.d.ts +1 -1
- package/dist/drawer/Drawerhead.svelte +1 -1
- package/dist/drawer/Drawerhead.svelte.d.ts +1 -1
- package/dist/dropdown/Dropdown.svelte +1 -1
- package/dist/dropdown/Dropdown.svelte.d.ts +1 -1
- package/dist/dropdown/DropdownDivider.svelte +1 -1
- package/dist/dropdown/DropdownDivider.svelte.d.ts +1 -1
- package/dist/dropdown/DropdownGroup.svelte +1 -1
- package/dist/dropdown/DropdownGroup.svelte.d.ts +1 -1
- package/dist/dropdown/DropdownHeader.svelte +1 -1
- package/dist/dropdown/DropdownHeader.svelte.d.ts +1 -1
- package/dist/dropdown/DropdownItem.svelte +1 -1
- package/dist/dropdown/DropdownItem.svelte.d.ts +1 -1
- package/dist/footer/Footer.svelte +1 -1
- package/dist/footer/Footer.svelte.d.ts +1 -1
- package/dist/footer/FooterBrand.svelte +1 -1
- package/dist/footer/FooterBrand.svelte.d.ts +1 -1
- package/dist/footer/FooterCopyright.svelte +1 -1
- package/dist/footer/FooterCopyright.svelte.d.ts +1 -1
- package/dist/footer/FooterIcon.svelte +1 -1
- package/dist/footer/FooterIcon.svelte.d.ts +1 -1
- package/dist/footer/FooterLink.svelte +1 -1
- package/dist/footer/FooterLink.svelte.d.ts +1 -1
- package/dist/footer/FooterLinkGroup.svelte +1 -1
- package/dist/footer/FooterLinkGroup.svelte.d.ts +1 -1
- package/dist/forms/checkbox-button/CheckboxButton.svelte +1 -1
- package/dist/forms/checkbox-button/CheckboxButton.svelte.d.ts +1 -1
- package/dist/forms/fileupload/Fileupload.svelte +1 -1
- package/dist/forms/fileupload/Fileupload.svelte.d.ts +1 -1
- package/dist/forms/floating-label-input/FloatingLabelInput.svelte +125 -5
- package/dist/forms/floating-label-input/FloatingLabelInput.svelte.d.ts +4 -1
- package/dist/forms/helper/Helper.svelte +1 -1
- package/dist/forms/helper/Helper.svelte.d.ts +1 -1
- package/dist/forms/input/Input.svelte +184 -21
- package/dist/forms/input/Input.svelte.d.ts +0 -5
- package/dist/forms/input-addon/InputAddon.svelte +1 -1
- package/dist/forms/input-addon/InputAddon.svelte.d.ts +1 -1
- package/dist/forms/label/Label.svelte +1 -1
- package/dist/forms/label/Label.svelte.d.ts +1 -1
- package/dist/forms/range/Range.svelte +1 -1
- package/dist/forms/range/Range.svelte.d.ts +1 -1
- package/dist/forms/search/Search.svelte +1 -1
- package/dist/forms/search/Search.svelte.d.ts +1 -1
- package/dist/forms/select/index.d.ts +3 -4
- package/dist/forms/select/index.js +3 -4
- package/dist/forms/tags/Tags.svelte +79 -0
- package/dist/forms/tags/Tags.svelte.d.ts +19 -0
- package/dist/forms/tags/index.d.ts +2 -0
- package/dist/forms/tags/index.js +2 -0
- package/dist/forms/tags/theme.d.ts +49 -0
- package/dist/forms/tags/theme.js +10 -0
- package/dist/forms/textarea/Textarea.svelte +1 -1
- package/dist/forms/textarea/Textarea.svelte.d.ts +1 -1
- package/dist/forms/timepicker/Timepicker.svelte +1 -1
- package/dist/forms/timepicker/Timepicker.svelte.d.ts +1 -1
- package/dist/forms/toggle/Toggle.svelte +1 -1
- package/dist/forms/toggle/Toggle.svelte.d.ts +1 -1
- package/dist/gallery/Gallery.svelte +1 -1
- package/dist/gallery/Gallery.svelte.d.ts +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/indicator/Indicator.svelte +1 -1
- package/dist/indicator/Indicator.svelte.d.ts +1 -1
- package/dist/kbd/Kbd.svelte +1 -1
- package/dist/kbd/Kbd.svelte.d.ts +1 -1
- package/dist/list-group/Listgroup.svelte +1 -1
- package/dist/list-group/Listgroup.svelte.d.ts +1 -1
- package/dist/list-group/ListgroupItem.svelte +1 -1
- package/dist/list-group/ListgroupItem.svelte.d.ts +1 -1
- package/dist/mega-menu/MegaMenu.svelte +1 -1
- package/dist/mega-menu/MegaMenu.svelte.d.ts +1 -1
- package/dist/modal/Modal.svelte +18 -10
- package/dist/modal/Modal.svelte.d.ts +2 -1
- package/dist/navbar/Menu.svelte +1 -1
- package/dist/navbar/Menu.svelte.d.ts +1 -1
- package/dist/navbar/NavBrand.svelte +1 -1
- package/dist/navbar/NavBrand.svelte.d.ts +1 -1
- package/dist/navbar/NavContainer.svelte +1 -1
- package/dist/navbar/NavContainer.svelte.d.ts +1 -1
- package/dist/navbar/NavHamburger.svelte +1 -1
- package/dist/navbar/NavHamburger.svelte.d.ts +1 -1
- package/dist/navbar/NavLi.svelte +1 -1
- package/dist/navbar/NavLi.svelte.d.ts +1 -1
- package/dist/navbar/NavUl.svelte +1 -1
- package/dist/navbar/NavUl.svelte.d.ts +1 -1
- package/dist/navbar/Navbar.svelte +1 -1
- package/dist/navbar/Navbar.svelte.d.ts +1 -1
- package/dist/pagination/Pagination.svelte +1 -1
- package/dist/pagination/Pagination.svelte.d.ts +1 -1
- package/dist/pagination/PaginationItem.svelte +1 -1
- package/dist/pagination/PaginationItem.svelte.d.ts +1 -1
- package/dist/popover/Popover.svelte +1 -1
- package/dist/popover/Popover.svelte.d.ts +1 -1
- package/dist/progress/Progressbar.svelte +1 -1
- package/dist/progress/Progressbar.svelte.d.ts +1 -1
- package/dist/progress/Progressradial.svelte +1 -1
- package/dist/progress/Progressradial.svelte.d.ts +1 -1
- package/dist/rating/AdvancedRating.svelte +1 -1
- package/dist/rating/AdvancedRating.svelte.d.ts +1 -1
- package/dist/rating/CustomIcon.svelte +1 -1
- package/dist/rating/CustomIcon.svelte.d.ts +1 -1
- package/dist/rating/Heart.svelte +1 -1
- package/dist/rating/Heart.svelte.d.ts +1 -1
- package/dist/rating/Rating.svelte +1 -1
- package/dist/rating/Rating.svelte.d.ts +1 -1
- package/dist/rating/RatingComment.svelte +1 -1
- package/dist/rating/RatingComment.svelte.d.ts +1 -1
- package/dist/rating/Review.svelte +1 -1
- package/dist/rating/Review.svelte.d.ts +1 -1
- package/dist/rating/ScoreRating.svelte +1 -1
- package/dist/rating/ScoreRating.svelte.d.ts +1 -1
- package/dist/rating/Star.svelte +1 -1
- package/dist/rating/Star.svelte.d.ts +1 -1
- package/dist/rating/Thumbup.svelte +1 -1
- package/dist/rating/Thumbup.svelte.d.ts +1 -1
- package/dist/sidebar/Sidebar.svelte +1 -1
- package/dist/sidebar/Sidebar.svelte.d.ts +1 -1
- package/dist/sidebar/SidebarBrand.svelte +1 -1
- package/dist/sidebar/SidebarBrand.svelte.d.ts +1 -1
- package/dist/sidebar/SidebarButton.svelte +1 -1
- package/dist/sidebar/SidebarButton.svelte.d.ts +1 -1
- package/dist/sidebar/SidebarCta.svelte +1 -1
- package/dist/sidebar/SidebarCta.svelte.d.ts +1 -1
- package/dist/sidebar/SidebarDropdownWrapper.svelte +1 -1
- package/dist/sidebar/SidebarDropdownWrapper.svelte.d.ts +1 -1
- package/dist/sidebar/SidebarGroup.svelte +1 -1
- package/dist/sidebar/SidebarGroup.svelte.d.ts +1 -1
- package/dist/sidebar/SidebarItem.svelte +1 -1
- package/dist/sidebar/SidebarItem.svelte.d.ts +1 -1
- package/dist/skeleton/CardPlaceholder.svelte +1 -1
- package/dist/skeleton/CardPlaceholder.svelte.d.ts +1 -1
- package/dist/skeleton/ImagePlaceholder.svelte +1 -1
- package/dist/skeleton/ImagePlaceholder.svelte.d.ts +1 -1
- package/dist/skeleton/ListPlaceholder.svelte +1 -1
- package/dist/skeleton/ListPlaceholder.svelte.d.ts +1 -1
- package/dist/skeleton/Skeleton.svelte +1 -1
- package/dist/skeleton/Skeleton.svelte.d.ts +1 -1
- package/dist/skeleton/TextPlaceholder.svelte +1 -1
- package/dist/skeleton/TextPlaceholder.svelte.d.ts +1 -1
- package/dist/skeleton/VideoPlaceholder.svelte +1 -1
- package/dist/skeleton/VideoPlaceholder.svelte.d.ts +1 -1
- package/dist/speed-dial/SpeedDial.svelte +1 -1
- package/dist/speed-dial/SpeedDial.svelte.d.ts +1 -1
- package/dist/speed-dial/SpeedDialButton.svelte +1 -1
- package/dist/speed-dial/SpeedDialButton.svelte.d.ts +1 -1
- package/dist/speed-dial/SpeedDialTrigger.svelte +1 -1
- package/dist/speed-dial/SpeedDialTrigger.svelte.d.ts +1 -1
- package/dist/spinner/Spinner.svelte +1 -1
- package/dist/spinner/Spinner.svelte.d.ts +1 -1
- package/dist/steps/StepIndicator.svelte +1 -1
- package/dist/steps/StepIndicator.svelte.d.ts +1 -1
- package/dist/table/Table.svelte +1 -1
- package/dist/table/Table.svelte.d.ts +1 -1
- package/dist/table/TableBody.svelte +1 -1
- package/dist/table/TableBody.svelte.d.ts +1 -1
- package/dist/table/TableBodyCell.svelte +1 -1
- package/dist/table/TableBodyCell.svelte.d.ts +1 -1
- package/dist/table/TableBodyRow.svelte +1 -1
- package/dist/table/TableBodyRow.svelte.d.ts +1 -1
- package/dist/table/TableHead.svelte +1 -1
- package/dist/table/TableHead.svelte.d.ts +1 -1
- package/dist/table/TableHeadCell.svelte +1 -1
- package/dist/table/TableHeadCell.svelte.d.ts +1 -1
- package/dist/table/TableSearch.svelte +1 -1
- package/dist/table/TableSearch.svelte.d.ts +1 -1
- package/dist/tabs/TabItem.svelte +1 -1
- package/dist/tabs/TabItem.svelte.d.ts +1 -1
- package/dist/tabs/Tabs.svelte +1 -1
- package/dist/tabs/Tabs.svelte.d.ts +1 -1
- package/dist/theme/Theme.svelte +1 -1
- package/dist/theme/Theme.svelte.d.ts +1 -1
- package/dist/timeline/Activity.svelte +1 -1
- package/dist/timeline/Activity.svelte.d.ts +1 -1
- package/dist/timeline/ActivityItem.svelte +1 -1
- package/dist/timeline/ActivityItem.svelte.d.ts +1 -1
- package/dist/timeline/Group.svelte +1 -1
- package/dist/timeline/Group.svelte.d.ts +1 -1
- package/dist/timeline/GroupItem.svelte +1 -1
- package/dist/timeline/GroupItem.svelte.d.ts +1 -1
- package/dist/timeline/Timeline.svelte +1 -1
- package/dist/timeline/Timeline.svelte.d.ts +1 -1
- package/dist/timeline/TimelineItem.svelte +1 -1
- package/dist/timeline/TimelineItem.svelte.d.ts +1 -1
- package/dist/toast/Toast.svelte +1 -1
- package/dist/toast/Toast.svelte.d.ts +1 -1
- package/dist/toolbar/Toolbar.svelte +1 -1
- package/dist/toolbar/Toolbar.svelte.d.ts +1 -1
- package/dist/toolbar/ToolbarButton.svelte +1 -1
- package/dist/toolbar/ToolbarButton.svelte.d.ts +1 -1
- package/dist/toolbar/ToolbarGroup.svelte +1 -1
- package/dist/toolbar/ToolbarGroup.svelte.d.ts +1 -1
- package/dist/tooltip/Tooltip.svelte +1 -1
- package/dist/tooltip/Tooltip.svelte.d.ts +1 -1
- package/dist/types.d.ts +24 -0
- package/dist/typography/anchor/A.svelte +1 -1
- package/dist/typography/anchor/A.svelte.d.ts +1 -1
- package/dist/typography/blockquote/Blockquote.svelte +1 -1
- package/dist/typography/blockquote/Blockquote.svelte.d.ts +1 -1
- package/dist/typography/descriptionlist/DescriptionList.svelte +1 -1
- package/dist/typography/descriptionlist/DescriptionList.svelte.d.ts +1 -1
- package/dist/typography/heading/Heading.svelte +1 -1
- package/dist/typography/heading/Heading.svelte.d.ts +1 -1
- package/dist/typography/hr/Hr.svelte +1 -1
- package/dist/typography/hr/Hr.svelte.d.ts +1 -1
- package/dist/typography/img/EnhancedImg.svelte +1 -1
- package/dist/typography/img/EnhancedImg.svelte.d.ts +1 -1
- package/dist/typography/img/Img.svelte +1 -1
- package/dist/typography/img/Img.svelte.d.ts +1 -1
- package/dist/typography/layout/Layout.svelte +1 -1
- package/dist/typography/layout/Layout.svelte.d.ts +1 -1
- package/dist/typography/list/Li.svelte +1 -1
- package/dist/typography/list/Li.svelte.d.ts +1 -1
- package/dist/typography/list/List.svelte +1 -1
- package/dist/typography/list/List.svelte.d.ts +1 -1
- package/dist/typography/mark/Mark.svelte +1 -1
- package/dist/typography/mark/Mark.svelte.d.ts +1 -1
- package/dist/typography/paragraph/P.svelte +1 -1
- package/dist/typography/paragraph/P.svelte.d.ts +1 -1
- package/dist/typography/secondary/Secondary.svelte +1 -1
- package/dist/typography/secondary/Secondary.svelte.d.ts +1 -1
- package/dist/typography/span/Span.svelte +1 -1
- package/dist/typography/span/Span.svelte.d.ts +1 -1
- package/dist/utils/Popper.svelte +30 -53
- package/dist/utils/Popper.svelte.d.ts +3 -1
- package/dist/video/Video.svelte +1 -1
- package/dist/video/Video.svelte.d.ts +1 -1
- package/package.json +28 -23
|
@@ -2,7 +2,7 @@ import type { DefaultMockupProps } from "../types";
|
|
|
2
2
|
/**
|
|
3
3
|
* [Go to docs](https://flowbite-svelte.com/)
|
|
4
4
|
* ## Type
|
|
5
|
-
* [DefaultMockupProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#
|
|
5
|
+
* [DefaultMockupProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L505)
|
|
6
6
|
* ## Props
|
|
7
7
|
* @prop children
|
|
8
8
|
* @prop divClass
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
@component
|
|
22
22
|
[Go to docs](https://flowbite-svelte.com/)
|
|
23
23
|
## Type
|
|
24
|
-
[MockupBaseProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#
|
|
24
|
+
[MockupBaseProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L486)
|
|
25
25
|
## Props
|
|
26
26
|
@prop children
|
|
27
27
|
@prop divClass
|
|
@@ -2,7 +2,7 @@ import type { MockupBaseProps } from "../types";
|
|
|
2
2
|
/**
|
|
3
3
|
* [Go to docs](https://flowbite-svelte.com/)
|
|
4
4
|
* ## Type
|
|
5
|
-
* [MockupBaseProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#
|
|
5
|
+
* [MockupBaseProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L486)
|
|
6
6
|
* ## Props
|
|
7
7
|
* @prop children
|
|
8
8
|
* @prop divClass
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
@component
|
|
33
33
|
[Go to docs](https://flowbite-svelte.com/)
|
|
34
34
|
## Type
|
|
35
|
-
[DeviceMockupProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#
|
|
35
|
+
[DeviceMockupProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L481)
|
|
36
36
|
## Props
|
|
37
37
|
@prop children
|
|
38
38
|
@prop device = "default"
|
|
@@ -3,7 +3,7 @@ import type { DeviceMockupProps } from "../types";
|
|
|
3
3
|
/**
|
|
4
4
|
* [Go to docs](https://flowbite-svelte.com/)
|
|
5
5
|
* ## Type
|
|
6
|
-
* [DeviceMockupProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#
|
|
6
|
+
* [DeviceMockupProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L481)
|
|
7
7
|
* ## Props
|
|
8
8
|
* @prop children
|
|
9
9
|
* @prop device = "default"
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
@component
|
|
24
24
|
[Go to docs](https://flowbite-svelte.com/)
|
|
25
25
|
## Type
|
|
26
|
-
[IosProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#
|
|
26
|
+
[IosProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L515)
|
|
27
27
|
## Props
|
|
28
28
|
@prop children
|
|
29
29
|
@prop divClass
|
|
@@ -2,7 +2,7 @@ import type { IosProps } from "../types";
|
|
|
2
2
|
/**
|
|
3
3
|
* [Go to docs](https://flowbite-svelte.com/)
|
|
4
4
|
* ## Type
|
|
5
|
-
* [IosProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#
|
|
5
|
+
* [IosProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L515)
|
|
6
6
|
* ## Props
|
|
7
7
|
* @prop children
|
|
8
8
|
* @prop divClass
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
@component
|
|
25
25
|
[Go to docs](https://flowbite-svelte.com/)
|
|
26
26
|
## Type
|
|
27
|
-
[MockupBaseProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#
|
|
27
|
+
[MockupBaseProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L486)
|
|
28
28
|
## Props
|
|
29
29
|
@prop children
|
|
30
30
|
@prop divClass
|
|
@@ -2,7 +2,7 @@ import type { MockupBaseProps } from "../types";
|
|
|
2
2
|
/**
|
|
3
3
|
* [Go to docs](https://flowbite-svelte.com/)
|
|
4
4
|
* ## Type
|
|
5
|
-
* [MockupBaseProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#
|
|
5
|
+
* [MockupBaseProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L486)
|
|
6
6
|
* ## Props
|
|
7
7
|
* @prop children
|
|
8
8
|
* @prop divClass
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
@component
|
|
26
26
|
[Go to docs](https://flowbite-svelte.com/)
|
|
27
27
|
## Type
|
|
28
|
-
[SmartwatchProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#
|
|
28
|
+
[SmartwatchProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L525)
|
|
29
29
|
## Props
|
|
30
30
|
@prop children
|
|
31
31
|
@prop divClass
|
|
@@ -2,7 +2,7 @@ import type { SmartwatchProps } from "../types";
|
|
|
2
2
|
/**
|
|
3
3
|
* [Go to docs](https://flowbite-svelte.com/)
|
|
4
4
|
* ## Type
|
|
5
|
-
* [SmartwatchProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#
|
|
5
|
+
* [SmartwatchProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L525)
|
|
6
6
|
* ## Props
|
|
7
7
|
* @prop children
|
|
8
8
|
* @prop divClass
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
@component
|
|
24
24
|
[Go to docs](https://flowbite-svelte.com/)
|
|
25
25
|
## Type
|
|
26
|
-
[TabletProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#
|
|
26
|
+
[TabletProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L535)
|
|
27
27
|
## Props
|
|
28
28
|
@prop children
|
|
29
29
|
@prop divClass
|
|
@@ -2,7 +2,7 @@ import type { TabletProps } from "../types";
|
|
|
2
2
|
/**
|
|
3
3
|
* [Go to docs](https://flowbite-svelte.com/)
|
|
4
4
|
* ## Type
|
|
5
|
-
* [TabletProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#
|
|
5
|
+
* [TabletProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L535)
|
|
6
6
|
* ## Props
|
|
7
7
|
* @prop children
|
|
8
8
|
* @prop divClass
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
@component
|
|
40
40
|
[Go to docs](https://flowbite-svelte.com/)
|
|
41
41
|
## Type
|
|
42
|
-
[DrawerProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#
|
|
42
|
+
[DrawerProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L546)
|
|
43
43
|
## Props
|
|
44
44
|
@prop children
|
|
45
45
|
@prop hidden = $bindable()
|
|
@@ -2,7 +2,7 @@ import type { DrawerProps } from "../types";
|
|
|
2
2
|
/**
|
|
3
3
|
* [Go to docs](https://flowbite-svelte.com/)
|
|
4
4
|
* ## Type
|
|
5
|
-
* [DrawerProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#
|
|
5
|
+
* [DrawerProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L546)
|
|
6
6
|
* ## Props
|
|
7
7
|
* @prop children
|
|
8
8
|
* @prop hidden = $bindable()
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
@component
|
|
29
29
|
[Go to docs](https://flowbite-svelte.com/)
|
|
30
30
|
## Type
|
|
31
|
-
[DrawerheadProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#
|
|
31
|
+
[DrawerheadProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L556)
|
|
32
32
|
## Props
|
|
33
33
|
@prop closeIcon
|
|
34
34
|
@prop children
|
|
@@ -2,7 +2,7 @@ import type { DrawerheadProps } from "../types";
|
|
|
2
2
|
/**
|
|
3
3
|
* [Go to docs](https://flowbite-svelte.com/)
|
|
4
4
|
* ## Type
|
|
5
|
-
* [DrawerheadProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#
|
|
5
|
+
* [DrawerheadProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L556)
|
|
6
6
|
* ## Props
|
|
7
7
|
* @prop closeIcon
|
|
8
8
|
* @prop children
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
@component
|
|
35
35
|
[Go to docs](https://flowbite-svelte.com/)
|
|
36
36
|
## Type
|
|
37
|
-
[DropdownProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#
|
|
37
|
+
[DropdownProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L563)
|
|
38
38
|
## Props
|
|
39
39
|
@prop children
|
|
40
40
|
@prop simple = false
|
|
@@ -2,7 +2,7 @@ import type { DropdownProps } from "../types";
|
|
|
2
2
|
/**
|
|
3
3
|
* [Go to docs](https://flowbite-svelte.com/)
|
|
4
4
|
* ## Type
|
|
5
|
-
* [DropdownProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#
|
|
5
|
+
* [DropdownProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L563)
|
|
6
6
|
* ## Props
|
|
7
7
|
* @prop children
|
|
8
8
|
* @prop simple = false
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
@component
|
|
14
14
|
[Go to docs](https://flowbite-svelte.com/)
|
|
15
15
|
## Type
|
|
16
|
-
[DropdownDividerProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#
|
|
16
|
+
[DropdownDividerProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L574)
|
|
17
17
|
## Props
|
|
18
18
|
@prop class: divClass
|
|
19
19
|
@prop ...restProps
|
|
@@ -2,7 +2,7 @@ import type { DropdownDividerProps } from "../types";
|
|
|
2
2
|
/**
|
|
3
3
|
* [Go to docs](https://flowbite-svelte.com/)
|
|
4
4
|
* ## Type
|
|
5
|
-
* [DropdownDividerProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#
|
|
5
|
+
* [DropdownDividerProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L574)
|
|
6
6
|
* ## Props
|
|
7
7
|
* @prop class: divClass
|
|
8
8
|
* @prop ...restProps
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
@component
|
|
17
17
|
[Go to docs](https://flowbite-svelte.com/)
|
|
18
18
|
## Type
|
|
19
|
-
[DropdownGroupProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#
|
|
19
|
+
[DropdownGroupProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L591)
|
|
20
20
|
## Props
|
|
21
21
|
@prop children
|
|
22
22
|
@prop class: className
|
|
@@ -2,7 +2,7 @@ import type { DropdownGroupProps } from "../types";
|
|
|
2
2
|
/**
|
|
3
3
|
* [Go to docs](https://flowbite-svelte.com/)
|
|
4
4
|
* ## Type
|
|
5
|
-
* [DropdownGroupProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#
|
|
5
|
+
* [DropdownGroupProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L591)
|
|
6
6
|
* ## Props
|
|
7
7
|
* @prop children
|
|
8
8
|
* @prop class: className
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
@component
|
|
16
16
|
[Go to docs](https://flowbite-svelte.com/)
|
|
17
17
|
## Type
|
|
18
|
-
[DropdownHeaderProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#
|
|
18
|
+
[DropdownHeaderProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L576)
|
|
19
19
|
## Props
|
|
20
20
|
@prop children
|
|
21
21
|
@prop class: className
|
|
@@ -2,7 +2,7 @@ import type { DropdownHeaderProps } from "../types";
|
|
|
2
2
|
/**
|
|
3
3
|
* [Go to docs](https://flowbite-svelte.com/)
|
|
4
4
|
* ## Type
|
|
5
|
-
* [DropdownHeaderProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#
|
|
5
|
+
* [DropdownHeaderProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L576)
|
|
6
6
|
* ## Props
|
|
7
7
|
* @prop children
|
|
8
8
|
* @prop class: className
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
@component
|
|
42
42
|
[Go to docs](https://flowbite-svelte.com/)
|
|
43
43
|
## Type
|
|
44
|
-
[DropdownItemProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#
|
|
44
|
+
[DropdownItemProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L582)
|
|
45
45
|
## Props
|
|
46
46
|
@prop aClass
|
|
47
47
|
@prop children
|
|
@@ -2,7 +2,7 @@ import type { DropdownItemProps } from "../types";
|
|
|
2
2
|
/**
|
|
3
3
|
* [Go to docs](https://flowbite-svelte.com/)
|
|
4
4
|
* ## Type
|
|
5
|
-
* [DropdownItemProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#
|
|
5
|
+
* [DropdownItemProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L582)
|
|
6
6
|
* ## Props
|
|
7
7
|
* @prop aClass
|
|
8
8
|
* @prop children
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
@component
|
|
16
16
|
[Go to docs](https://flowbite-svelte.com/)
|
|
17
17
|
## Type
|
|
18
|
-
[FooterProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#
|
|
18
|
+
[FooterProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L598)
|
|
19
19
|
## Props
|
|
20
20
|
@prop children
|
|
21
21
|
@prop footerType = "default"
|
|
@@ -2,7 +2,7 @@ import type { FooterProps } from "../types";
|
|
|
2
2
|
/**
|
|
3
3
|
* [Go to docs](https://flowbite-svelte.com/)
|
|
4
4
|
* ## Type
|
|
5
|
-
* [FooterProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#
|
|
5
|
+
* [FooterProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L598)
|
|
6
6
|
* ## Props
|
|
7
7
|
* @prop children
|
|
8
8
|
* @prop footerType = "default"
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
@component
|
|
28
28
|
[Go to docs](https://flowbite-svelte.com/)
|
|
29
29
|
## Type
|
|
30
|
-
[FooterBrandProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#
|
|
30
|
+
[FooterBrandProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L604)
|
|
31
31
|
## Props
|
|
32
32
|
@prop children
|
|
33
33
|
@prop aClass
|
|
@@ -2,7 +2,7 @@ import type { FooterBrandProps } from "../types";
|
|
|
2
2
|
/**
|
|
3
3
|
* [Go to docs](https://flowbite-svelte.com/)
|
|
4
4
|
* ## Type
|
|
5
|
-
* [FooterBrandProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#
|
|
5
|
+
* [FooterBrandProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L604)
|
|
6
6
|
* ## Props
|
|
7
7
|
* @prop children
|
|
8
8
|
* @prop aClass
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
@component
|
|
26
26
|
[Go to docs](https://flowbite-svelte.com/)
|
|
27
27
|
## Type
|
|
28
|
-
[FooterCopyrightProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#
|
|
28
|
+
[FooterCopyrightProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L615)
|
|
29
29
|
## Props
|
|
30
30
|
@prop spanClass
|
|
31
31
|
@prop aClass
|
|
@@ -2,7 +2,7 @@ import type { FooterCopyrightProps } from "../types";
|
|
|
2
2
|
/**
|
|
3
3
|
* [Go to docs](https://flowbite-svelte.com/)
|
|
4
4
|
* ## Type
|
|
5
|
-
* [FooterCopyrightProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#
|
|
5
|
+
* [FooterCopyrightProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L615)
|
|
6
6
|
* ## Props
|
|
7
7
|
* @prop spanClass
|
|
8
8
|
* @prop aClass
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
@component
|
|
20
20
|
[Go to docs](https://flowbite-svelte.com/)
|
|
21
21
|
## Type
|
|
22
|
-
[FooterIconProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#
|
|
22
|
+
[FooterIconProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L624)
|
|
23
23
|
## Props
|
|
24
24
|
@prop children
|
|
25
25
|
@prop href
|
|
@@ -2,7 +2,7 @@ import type { FooterIconProps } from "../types";
|
|
|
2
2
|
/**
|
|
3
3
|
* [Go to docs](https://flowbite-svelte.com/)
|
|
4
4
|
* ## Type
|
|
5
|
-
* [FooterIconProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#
|
|
5
|
+
* [FooterIconProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L624)
|
|
6
6
|
* ## Props
|
|
7
7
|
* @prop children
|
|
8
8
|
* @prop href
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
@component
|
|
17
17
|
[Go to docs](https://flowbite-svelte.com/)
|
|
18
18
|
## Type
|
|
19
|
-
[FooterLinkProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#
|
|
19
|
+
[FooterLinkProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L636)
|
|
20
20
|
## Props
|
|
21
21
|
@prop children
|
|
22
22
|
@prop liClass
|
|
@@ -2,7 +2,7 @@ import type { FooterLinkProps } from "../types";
|
|
|
2
2
|
/**
|
|
3
3
|
* [Go to docs](https://flowbite-svelte.com/)
|
|
4
4
|
* ## Type
|
|
5
|
-
* [FooterLinkProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#
|
|
5
|
+
* [FooterLinkProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L636)
|
|
6
6
|
* ## Props
|
|
7
7
|
* @prop children
|
|
8
8
|
* @prop liClass
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
@component
|
|
15
15
|
[Go to docs](https://flowbite-svelte.com/)
|
|
16
16
|
## Type
|
|
17
|
-
[FooterLinkGroupProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#
|
|
17
|
+
[FooterLinkGroupProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L631)
|
|
18
18
|
## Props
|
|
19
19
|
@prop class: ulClass
|
|
20
20
|
@prop children
|
|
@@ -2,7 +2,7 @@ import type { FooterLinkGroupProps } from "../types";
|
|
|
2
2
|
/**
|
|
3
3
|
* [Go to docs](https://flowbite-svelte.com/)
|
|
4
4
|
* ## Type
|
|
5
|
-
* [FooterLinkGroupProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#
|
|
5
|
+
* [FooterLinkGroupProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L631)
|
|
6
6
|
* ## Props
|
|
7
7
|
* @prop class: ulClass
|
|
8
8
|
* @prop children
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
@component
|
|
56
56
|
[Go to docs](https://flowbite-svelte.com/)
|
|
57
57
|
## Type
|
|
58
|
-
[CheckboxButtonProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#
|
|
58
|
+
[CheckboxButtonProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L677)
|
|
59
59
|
## Props
|
|
60
60
|
@prop children
|
|
61
61
|
@prop class: className
|
|
@@ -2,7 +2,7 @@ import type { CheckboxButtonProps } from "../../types";
|
|
|
2
2
|
/**
|
|
3
3
|
* [Go to docs](https://flowbite-svelte.com/)
|
|
4
4
|
* ## Type
|
|
5
|
-
* [CheckboxButtonProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#
|
|
5
|
+
* [CheckboxButtonProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L677)
|
|
6
6
|
* ## Props
|
|
7
7
|
* @prop children
|
|
8
8
|
* @prop class: className
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
@component
|
|
28
28
|
[Go to docs](https://flowbite-svelte.com/)
|
|
29
29
|
## Type
|
|
30
|
-
[FileuploadProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#
|
|
30
|
+
[FileuploadProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L696)
|
|
31
31
|
## Props
|
|
32
32
|
@prop files = $bindable()
|
|
33
33
|
@prop size = "md"
|
|
@@ -2,7 +2,7 @@ import { type FileuploadProps } from "../..";
|
|
|
2
2
|
/**
|
|
3
3
|
* [Go to docs](https://flowbite-svelte.com/)
|
|
4
4
|
* ## Type
|
|
5
|
-
* [FileuploadProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#
|
|
5
|
+
* [FileuploadProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L696)
|
|
6
6
|
* ## Props
|
|
7
7
|
* @prop files = $bindable()
|
|
8
8
|
* @prop size = "md"
|
|
@@ -4,34 +4,151 @@
|
|
|
4
4
|
import { type FloatingLabelInputProps, CloseButton } from "../..";
|
|
5
5
|
import clsx from "clsx";
|
|
6
6
|
|
|
7
|
-
let { children, id = idGenerator(), value = $bindable(), elementRef = $bindable(), "aria-describedby": ariaDescribedby, variant = "standard", size = "default", color = "default", class: divClass, inputClass, labelClass, clearable, clearableSvgClass, clearableColor = "none", clearableClass, clearableOnClick, ...restProps }: FloatingLabelInputProps = $props();
|
|
7
|
+
let { children, id = idGenerator(), value = $bindable(), elementRef = $bindable(), "aria-describedby": ariaDescribedby, variant = "standard", size = "default", color = "default", class: divClass, inputClass, labelClass, clearable, clearableSvgClass, clearableColor = "none", clearableClass, clearableOnClick, data = [], maxSuggestions = 5, onSelect, ...restProps }: FloatingLabelInputProps = $props();
|
|
8
8
|
|
|
9
9
|
const { base, input, label, clearbtn } = $derived(floatingLabelInput({ variant, size, color }));
|
|
10
10
|
|
|
11
11
|
const clearAll = () => {
|
|
12
12
|
if (elementRef) {
|
|
13
13
|
elementRef.value = "";
|
|
14
|
-
value =
|
|
14
|
+
value = "";
|
|
15
|
+
backspaceUsed = false;
|
|
16
|
+
updateSuggestions();
|
|
17
|
+
dummyFocusDiv?.focus();
|
|
18
|
+
setTimeout(() => {
|
|
19
|
+
elementRef?.focus();
|
|
20
|
+
}, 100);
|
|
15
21
|
}
|
|
16
22
|
if (clearableOnClick) clearableOnClick();
|
|
17
23
|
};
|
|
24
|
+
|
|
25
|
+
const isCombobox = $derived(Array.isArray(data) && data.length > 0);
|
|
26
|
+
|
|
27
|
+
// svelte-ignore non_reactive_update
|
|
28
|
+
let dummyFocusDiv: HTMLDivElement;
|
|
29
|
+
|
|
30
|
+
let isFocused = $state(false);
|
|
31
|
+
let filteredSuggestions: string[] = $state([]);
|
|
32
|
+
let selectedIndex = $state(-1);
|
|
33
|
+
let backspaceUsed = $state(false);
|
|
34
|
+
|
|
35
|
+
function updateSuggestions() {
|
|
36
|
+
if (!isCombobox || !isFocused) {
|
|
37
|
+
filteredSuggestions = [];
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const searchTerm = ((value as string) || "").toLowerCase();
|
|
42
|
+
|
|
43
|
+
if (searchTerm === "" && !backspaceUsed) {
|
|
44
|
+
filteredSuggestions = [];
|
|
45
|
+
} else if (searchTerm) {
|
|
46
|
+
filteredSuggestions = data.filter((item) => item.toLowerCase().includes(searchTerm)).slice(0, maxSuggestions);
|
|
47
|
+
} else if (backspaceUsed) {
|
|
48
|
+
filteredSuggestions = [...data].slice(0, maxSuggestions);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
selectedIndex = -1;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
$effect(() => {
|
|
55
|
+
if (isCombobox) {
|
|
56
|
+
updateSuggestions();
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
function handleInput() {
|
|
61
|
+
if ((value as string).length > 0) {
|
|
62
|
+
backspaceUsed = false;
|
|
63
|
+
}
|
|
64
|
+
updateSuggestions();
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function handleFocus() {
|
|
68
|
+
isFocused = true;
|
|
69
|
+
updateSuggestions();
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function handleBlur() {
|
|
73
|
+
setTimeout(() => {
|
|
74
|
+
isFocused = false;
|
|
75
|
+
backspaceUsed = false;
|
|
76
|
+
filteredSuggestions = [];
|
|
77
|
+
}, 200);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function handleKeydown(event: KeyboardEvent) {
|
|
81
|
+
if (!isCombobox) return;
|
|
82
|
+
|
|
83
|
+
if (event.key === "Backspace" || event.key === "Delete") {
|
|
84
|
+
const currentValue = value as string;
|
|
85
|
+
if (currentValue.length <= 1) {
|
|
86
|
+
backspaceUsed = true;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
if (!filteredSuggestions.length) return;
|
|
91
|
+
|
|
92
|
+
switch (event.key) {
|
|
93
|
+
case "ArrowDown":
|
|
94
|
+
event.preventDefault();
|
|
95
|
+
selectedIndex = (selectedIndex + 1) % filteredSuggestions.length;
|
|
96
|
+
break;
|
|
97
|
+
case "ArrowUp":
|
|
98
|
+
event.preventDefault();
|
|
99
|
+
selectedIndex = selectedIndex <= 0 ? filteredSuggestions.length - 1 : selectedIndex - 1;
|
|
100
|
+
break;
|
|
101
|
+
case "Enter":
|
|
102
|
+
if (selectedIndex >= 0) {
|
|
103
|
+
event.preventDefault();
|
|
104
|
+
selectItem(filteredSuggestions[selectedIndex]);
|
|
105
|
+
}
|
|
106
|
+
break;
|
|
107
|
+
case "Escape":
|
|
108
|
+
event.preventDefault();
|
|
109
|
+
filteredSuggestions = [];
|
|
110
|
+
break;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
function selectItem(item: string) {
|
|
115
|
+
value = item;
|
|
116
|
+
if (onSelect) onSelect(item);
|
|
117
|
+
filteredSuggestions = [];
|
|
118
|
+
selectedIndex = -1;
|
|
119
|
+
elementRef?.focus();
|
|
120
|
+
}
|
|
18
121
|
</script>
|
|
19
122
|
|
|
20
|
-
|
|
21
|
-
<
|
|
123
|
+
{#if clearable}
|
|
124
|
+
<div tabindex="-1" bind:this={dummyFocusDiv} class="sr-only"></div>
|
|
125
|
+
{/if}
|
|
126
|
+
|
|
127
|
+
<div class={clsx(base({ class: clsx(divClass) }), isCombobox ? "relative" : "")}>
|
|
128
|
+
<input {id} placeholder=" " bind:value bind:this={elementRef} {...restProps} aria-describedby={ariaDescribedby} class={input({ class: inputClass })} oninput={handleInput} onfocus={handleFocus} onblur={handleBlur} onkeydown={handleKeydown} />
|
|
22
129
|
{#if value !== undefined && value !== "" && clearable}
|
|
23
130
|
<CloseButton onclick={clearAll} class={clearbtn({ class: clearableClass })} color={clearableColor} aria-label="Clear search value" svgClass={clearableSvgClass} />
|
|
24
131
|
{/if}
|
|
25
132
|
<label for={id} class={label({ class: labelClass })}>
|
|
26
133
|
{@render children()}
|
|
27
134
|
</label>
|
|
135
|
+
|
|
136
|
+
{#if isCombobox && isFocused && filteredSuggestions.length > 0}
|
|
137
|
+
<div class="absolute top-full right-0 left-0 z-10 mt-1 max-h-60 overflow-y-auto rounded-md border border-gray-200 bg-white shadow-lg dark:border-gray-700 dark:bg-gray-800">
|
|
138
|
+
{#each filteredSuggestions as item, i}
|
|
139
|
+
<button type="button" class="w-full px-3 py-2 text-left {i === selectedIndex ? 'bg-gray-100 dark:bg-gray-700' : 'hover:bg-gray-50 dark:hover:bg-gray-700'} focus:outline-none" onclick={() => selectItem(item)} onmouseenter={() => (selectedIndex = i)}>
|
|
140
|
+
{item}
|
|
141
|
+
</button>
|
|
142
|
+
{/each}
|
|
143
|
+
</div>
|
|
144
|
+
{/if}
|
|
28
145
|
</div>
|
|
29
146
|
|
|
30
147
|
<!--
|
|
31
148
|
@component
|
|
32
149
|
[Go to docs](https://flowbite-svelte.com/)
|
|
33
150
|
## Type
|
|
34
|
-
[FloatingLabelInputProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#
|
|
151
|
+
[FloatingLabelInputProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L709)
|
|
35
152
|
## Props
|
|
36
153
|
@prop children
|
|
37
154
|
@prop id = idGenerator()
|
|
@@ -49,5 +166,8 @@
|
|
|
49
166
|
@prop clearableColor = "none"
|
|
50
167
|
@prop clearableClass
|
|
51
168
|
@prop clearableOnClick
|
|
169
|
+
@prop data = []
|
|
170
|
+
@prop maxSuggestions = 5
|
|
171
|
+
@prop onSelect
|
|
52
172
|
@prop ...restProps
|
|
53
173
|
-->
|
|
@@ -2,7 +2,7 @@ import { type FloatingLabelInputProps } from "../..";
|
|
|
2
2
|
/**
|
|
3
3
|
* [Go to docs](https://flowbite-svelte.com/)
|
|
4
4
|
* ## Type
|
|
5
|
-
* [FloatingLabelInputProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#
|
|
5
|
+
* [FloatingLabelInputProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L709)
|
|
6
6
|
* ## Props
|
|
7
7
|
* @prop children
|
|
8
8
|
* @prop id = idGenerator()
|
|
@@ -20,6 +20,9 @@ import { type FloatingLabelInputProps } from "../..";
|
|
|
20
20
|
* @prop clearableColor = "none"
|
|
21
21
|
* @prop clearableClass
|
|
22
22
|
* @prop clearableOnClick
|
|
23
|
+
* @prop data = []
|
|
24
|
+
* @prop maxSuggestions = 5
|
|
25
|
+
* @prop onSelect
|
|
23
26
|
* @prop ...restProps
|
|
24
27
|
*/
|
|
25
28
|
declare const FloatingLabelInput: import("svelte").Component<FloatingLabelInputProps, {}, "value" | "elementRef">;
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
@component
|
|
17
17
|
[Go to docs](https://flowbite-svelte.com/)
|
|
18
18
|
## Type
|
|
19
|
-
[HelperProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#
|
|
19
|
+
[HelperProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L731)
|
|
20
20
|
## Props
|
|
21
21
|
@prop children
|
|
22
22
|
@prop class: className
|