vlite3 0.1.0 → 0.1.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/_virtual/_plugin-vue_export-helper.js +9 -0
- package/components/Accordion/Accordion.vue.d.ts +44 -0
- package/components/Accordion/Accordion.vue.js +95 -0
- package/components/Accordion/Accordion.vue2.js +4 -0
- package/components/Accordion/AccordionContent.vue.d.ts +22 -0
- package/components/Accordion/AccordionContent.vue.js +7 -0
- package/components/Accordion/AccordionContent.vue2.js +47 -0
- package/components/Accordion/AccordionItem.vue.d.ts +56 -0
- package/components/Accordion/AccordionItem.vue.js +115 -0
- package/components/Accordion/AccordionItem.vue2.js +4 -0
- package/components/Accordion/AccordionTrigger.vue.d.ts +43 -0
- package/components/Accordion/AccordionTrigger.vue.js +94 -0
- package/components/Accordion/AccordionTrigger.vue2.js +4 -0
- package/components/Accordion/index.d.ts +5 -0
- package/components/Accordion/types.d.ts +33 -0
- package/components/Alert.vue.d.ts +36 -0
- package/components/Alert.vue.js +84 -0
- package/components/Alert.vue2.js +4 -0
- package/components/Avatar.vue.d.ts +32 -0
- package/components/Avatar.vue.js +78 -0
- package/components/Avatar.vue2.js +4 -0
- package/components/AvatarUploader/AvatarUploader.vue.d.ts +32 -0
- package/components/AvatarUploader/AvatarUploader.vue.js +99 -0
- package/components/AvatarUploader/AvatarUploader.vue2.js +4 -0
- package/{src/components/AvatarUploader/index.ts → components/AvatarUploader/index.d.ts} +2 -2
- package/components/Badge.vue.d.ts +25 -0
- package/components/Badge.vue.js +27 -0
- package/components/Badge.vue2.js +4 -0
- package/components/Button.vue.d.ts +26 -0
- package/components/Button.vue.js +107 -0
- package/components/Button.vue2.js +4 -0
- package/components/ButtonGroup.vue.d.ts +29 -0
- package/components/ButtonGroup.vue.js +7 -0
- package/components/ButtonGroup.vue2.js +30 -0
- package/components/Carousel/Carousel.vue.d.ts +847 -0
- package/components/Carousel/Carousel.vue.js +7 -0
- package/components/Carousel/Carousel.vue2.js +68 -0
- package/components/Carousel/index.d.ts +2 -0
- package/components/Carousel/types.d.ts +24 -0
- package/components/CheckBox.vue.d.ts +27 -0
- package/components/CheckBox.vue.js +115 -0
- package/components/CheckBox.vue2.js +4 -0
- package/components/Chip/Chip.vue.d.ts +33 -0
- package/components/Chip/Chip.vue.js +113 -0
- package/components/Chip/Chip.vue2.js +4 -0
- package/components/Chip/index.d.ts +2 -0
- package/components/Chip/types.d.ts +12 -0
- package/components/ChoiceBox/ChoiceBox.vue.d.ts +32 -0
- package/components/ChoiceBox/ChoiceBox.vue.js +141 -0
- package/components/ChoiceBox/ChoiceBox.vue2.js +4 -0
- package/components/ChoiceBox/index.d.ts +2 -0
- package/components/ColorPicker/ColorIro.vue.d.ts +18 -0
- package/components/ColorPicker/ColorIro.vue.js +142 -0
- package/components/ColorPicker/ColorIro.vue3.js +5 -0
- package/components/ColorPicker/ColorPicker.vue.d.ts +22 -0
- package/components/ColorPicker/ColorPicker.vue.js +56 -0
- package/components/ColorPicker/ColorPicker.vue2.js +4 -0
- package/components/ConfirmationModal.vue.d.ts +39 -0
- package/components/ConfirmationModal.vue.js +55 -0
- package/components/ConfirmationModal.vue2.js +4 -0
- package/components/DataTable/DataTable.vue.d.ts +60 -0
- package/components/DataTable/DataTable.vue.js +7 -0
- package/components/DataTable/DataTable.vue2.js +310 -0
- package/components/DataTable/DataTableHeader.vue.d.ts +14 -0
- package/components/DataTable/DataTableHeader.vue.js +49 -0
- package/components/DataTable/DataTableHeader.vue2.js +4 -0
- package/components/DataTable/DataTableRow.vue.d.ts +51 -0
- package/components/DataTable/DataTableRow.vue.js +114 -0
- package/components/DataTable/DataTableRow.vue2.js +4 -0
- package/components/DataTable/DataTableToolbar.vue.d.ts +31 -0
- package/components/DataTable/DataTableToolbar.vue.js +45 -0
- package/components/DataTable/DataTableToolbar.vue2.js +4 -0
- package/components/DataTable/index.d.ts +4 -0
- package/components/DataTable/types.d.ts +75 -0
- package/components/DatePicker.vue.d.ts +44 -0
- package/components/DatePicker.vue.js +84 -0
- package/components/DatePicker.vue2.js +4 -0
- package/components/Dropdown/Dropdown.vue.d.ts +105 -0
- package/components/Dropdown/Dropdown.vue.js +206 -0
- package/components/Dropdown/Dropdown.vue2.js +4 -0
- package/components/Dropdown/DropdownBooleanItem.vue.d.ts +12 -0
- package/components/Dropdown/DropdownBooleanItem.vue.js +41 -0
- package/components/Dropdown/DropdownBooleanItem.vue2.js +4 -0
- package/components/Dropdown/DropdownGroupedLayout.vue.d.ts +21 -0
- package/components/Dropdown/DropdownGroupedLayout.vue.js +73 -0
- package/components/Dropdown/DropdownGroupedLayout.vue2.js +4 -0
- package/components/Dropdown/DropdownItem.vue.d.ts +35 -0
- package/components/Dropdown/DropdownItem.vue.js +56 -0
- package/components/Dropdown/DropdownItem.vue2.js +4 -0
- package/components/Dropdown/DropdownMenu.vue.d.ts +73 -0
- package/components/Dropdown/DropdownMenu.vue.js +232 -0
- package/components/Dropdown/DropdownMenu.vue2.js +4 -0
- package/components/Dropdown/DropdownTrigger.vue.d.ts +15 -0
- package/components/Dropdown/DropdownTrigger.vue.js +26 -0
- package/components/Dropdown/DropdownTrigger.vue2.js +4 -0
- package/components/Dropdown/composables/useDropdownIds.d.ts +5 -0
- package/components/Dropdown/composables/useDropdownIds.js +20 -0
- package/components/Dropdown/composables/useDropdownNavigation.d.ts +19 -0
- package/components/Dropdown/composables/useDropdownNavigation.js +49 -0
- package/components/Dropdown/composables/useDropdownSelection.d.ts +16 -0
- package/components/Dropdown/composables/useDropdownSelection.js +41 -0
- package/components/Dropdown/index.d.ts +6 -0
- package/components/FilePicker/FilePicker.vue.d.ts +65 -0
- package/components/FilePicker/FilePicker.vue.js +285 -0
- package/components/FilePicker/FilePicker.vue2.js +4 -0
- package/components/FilePicker/index.d.ts +2 -0
- package/components/FileTree/FileTree.vue.d.ts +20 -0
- package/components/FileTree/FileTree.vue.js +139 -0
- package/components/FileTree/FileTree.vue2.js +4 -0
- package/components/FileTree/FileTreeNode.vue.d.ts +28 -0
- package/components/FileTree/FileTreeNode.vue.js +184 -0
- package/components/FileTree/FileTreeNode.vue2.js +4 -0
- package/components/FileTree/index.d.ts +4 -0
- package/components/FileTree/types.d.ts +36 -0
- package/components/FileTree/useTreeSelection.d.ts +12 -0
- package/components/FileTree/useTreeSelection.js +25 -0
- package/components/Form/CustomFields.vue.d.ts +38 -0
- package/components/Form/CustomFields.vue.js +7 -0
- package/components/Form/CustomFields.vue2.js +161 -0
- package/components/Form/Form.vue.d.ts +94 -0
- package/components/Form/Form.vue.js +7 -0
- package/components/Form/Form.vue2.js +238 -0
- package/components/Form/FormField.vue.d.ts +28 -0
- package/components/Form/FormField.vue.js +207 -0
- package/components/Form/FormField.vue2.js +4 -0
- package/components/Form/FormFields.vue.d.ts +29 -0
- package/components/Form/FormFields.vue.js +7 -0
- package/components/Form/FormFields.vue2.js +95 -0
- package/components/Form/composables/useFileUpload.d.ts +24 -0
- package/components/Form/composables/useFileUpload.js +40 -0
- package/components/Form/composables/useForm.d.ts +48 -0
- package/components/Form/composables/useForm.js +109 -0
- package/components/Form/index.d.ts +9 -0
- package/components/Form/types.d.ts +167 -0
- package/components/Form/utils/form.utils.d.ts +44 -0
- package/components/Form/utils/form.utils.js +97 -0
- package/components/Heatmap/Heatmap.vue.d.ts +26 -0
- package/components/Heatmap/Heatmap.vue.js +7 -0
- package/components/Heatmap/Heatmap.vue2.js +326 -0
- package/components/Heatmap/index.d.ts +2 -0
- package/components/Heatmap/types.d.ts +66 -0
- package/components/Icon.vue.d.ts +7 -0
- package/components/Icon.vue.js +25 -0
- package/components/Icon.vue2.js +4 -0
- package/components/IconPicker.vue.d.ts +38 -0
- package/components/IconPicker.vue.js +124 -0
- package/components/IconPicker.vue2.js +4 -0
- package/components/Input.vue.d.ts +54 -0
- package/components/Input.vue.js +267 -0
- package/components/Input.vue2.js +4 -0
- package/components/Label.vue.d.ts +23 -0
- package/components/Label.vue.js +23 -0
- package/components/Label.vue2.js +4 -0
- package/components/Logo.vue.d.ts +2 -0
- package/components/Logo.vue.js +10 -0
- package/components/Logo.vue2.js +4 -0
- package/components/Masonry/Masonry.vue.d.ts +31 -0
- package/components/Masonry/Masonry.vue.js +7 -0
- package/components/Masonry/Masonry.vue2.js +83 -0
- package/components/Masonry/index.d.ts +2 -0
- package/components/Masonry/types.d.ts +33 -0
- package/components/Masonry/types.js +10 -0
- package/components/Modal.vue.d.ts +52 -0
- package/components/Modal.vue.js +116 -0
- package/components/Modal.vue2.js +4 -0
- package/components/MultiSelect/MultiSelect.vue.d.ts +40 -0
- package/components/MultiSelect/MultiSelect.vue.js +126 -0
- package/components/MultiSelect/MultiSelect.vue2.js +4 -0
- package/components/MultiSelect/index.d.ts +1 -0
- package/components/Navbar/Navbar.vue.d.ts +51 -0
- package/components/Navbar/Navbar.vue.js +198 -0
- package/components/Navbar/Navbar.vue2.js +4 -0
- package/components/Navbar/NavbarGroup.vue.d.ts +24 -0
- package/components/Navbar/NavbarGroup.vue.js +23 -0
- package/components/Navbar/NavbarGroup.vue2.js +4 -0
- package/components/Navbar/NavbarItem.vue.d.ts +40 -0
- package/components/Navbar/NavbarItem.vue.js +104 -0
- package/components/Navbar/NavbarItem.vue2.js +4 -0
- package/components/Navbar/index.d.ts +3 -0
- package/components/OTPInput/OTPInput.vue.d.ts +33 -0
- package/components/OTPInput/OTPInput.vue.js +115 -0
- package/components/OTPInput/OTPInput.vue2.js +4 -0
- package/components/OTPInput/index.d.ts +1 -0
- package/components/Pagination/Pagination.vue.d.ts +34 -0
- package/components/Pagination/Pagination.vue.js +196 -0
- package/components/Pagination/Pagination.vue2.js +4 -0
- package/components/Pagination/index.d.ts +1 -0
- package/components/PricingPlan/PricingPlan.vue.d.ts +22 -0
- package/components/PricingPlan/PricingPlan.vue.js +55 -0
- package/components/PricingPlan/PricingPlan.vue2.js +4 -0
- package/components/PricingPlan/PricingPlanItem.vue.d.ts +17 -0
- package/components/PricingPlan/PricingPlanItem.vue.js +94 -0
- package/components/PricingPlan/PricingPlanItem.vue2.js +4 -0
- package/components/PricingPlan/index.d.ts +3 -0
- package/components/PricingPlan/types.d.ts +25 -0
- package/components/SidePanel.vue.d.ts +64 -0
- package/components/SidePanel.vue.js +7 -0
- package/components/SidePanel.vue2.js +131 -0
- package/components/SidebarMenu/SidebarMenu.vue.d.ts +11 -0
- package/components/SidebarMenu/SidebarMenu.vue.js +78 -0
- package/components/SidebarMenu/SidebarMenu.vue2.js +4 -0
- package/components/SidebarMenu/SidebarMenuItem.vue.d.ts +9 -0
- package/components/SidebarMenu/SidebarMenuItem.vue.js +269 -0
- package/components/SidebarMenu/SidebarMenuItem.vue3.js +5 -0
- package/components/SidebarMenu/index.d.ts +3 -0
- package/components/SidebarMenu/types.d.ts +35 -0
- package/components/Slider.vue.d.ts +31 -0
- package/components/Slider.vue.js +157 -0
- package/components/Slider.vue2.js +4 -0
- package/components/Switch.vue.d.ts +16 -0
- package/components/Switch.vue.js +40 -0
- package/components/Switch.vue2.js +4 -0
- package/components/Tabes/Tabes.vue.d.ts +21 -0
- package/components/Tabes/Tabes.vue.js +75 -0
- package/components/Tabes/Tabes.vue2.js +4 -0
- package/components/Tabes/index.d.ts +2 -0
- package/components/Tabes/types.d.ts +8 -0
- package/components/Textarea.vue.d.ts +22 -0
- package/components/Textarea.vue.js +34 -0
- package/components/Textarea.vue2.js +4 -0
- package/components/ThemeToggle.vue.d.ts +2 -0
- package/components/ThemeToggle.vue.js +18 -0
- package/components/ThemeToggle.vue2.js +4 -0
- package/components/Timeline.vue.d.ts +39 -0
- package/components/Timeline.vue.js +174 -0
- package/components/Timeline.vue2.js +4 -0
- package/components/ToastNotification.vue.d.ts +7 -0
- package/components/ToastNotification.vue.js +7 -0
- package/components/ToastNotification.vue2.js +151 -0
- package/components/Tooltip.vue.d.ts +31 -0
- package/components/Tooltip.vue.js +45 -0
- package/components/Tooltip.vue2.js +4 -0
- package/components/Workbook/Sheet.vue.d.ts +38 -0
- package/components/Workbook/Sheet.vue.js +141 -0
- package/components/Workbook/Sheet.vue2.js +4 -0
- package/components/Workbook/Workbook.vue.d.ts +54 -0
- package/components/Workbook/Workbook.vue.js +7 -0
- package/components/Workbook/Workbook.vue2.js +146 -0
- package/components/Workbook/WorkbookAddButton.vue.d.ts +6 -0
- package/components/Workbook/WorkbookAddButton.vue.js +20 -0
- package/components/Workbook/WorkbookAddButton.vue2.js +4 -0
- package/components/Workbook/index.d.ts +3 -0
- package/components/Workbook/types.d.ts +34 -0
- package/composables/useKeyStroke.d.ts +21 -0
- package/composables/useKeyStroke.js +93 -0
- package/composables/useNotifications.d.ts +113 -0
- package/composables/useNotifications.js +99 -0
- package/composables/useTheme.d.ts +6 -0
- package/composables/useTheme.js +32 -0
- package/core/config.d.ts +29 -0
- package/core/config.js +12 -0
- package/core/index.d.ts +31 -0
- package/core/index.js +15 -0
- package/directives/vRipple.d.ts +4 -0
- package/directives/vRipple.js +17 -0
- package/index.d.ts +49 -0
- package/index.js +156 -0
- package/package.json +2 -2
- package/style.css +590 -0
- package/types/alert.type.d.ts +10 -0
- package/{src/types/avatar.type.ts → types/avatar.type.d.ts} +8 -9
- package/types/button.d.ts +15 -0
- package/types/buttongroup.type.d.ts +1 -0
- package/{src/types/config.type.ts → types/config.type.d.ts} +13 -16
- package/types/form.type.d.ts +45 -0
- package/types/index.d.ts +10 -0
- package/types/navbar.type.d.ts +27 -0
- package/types/sidepanel.type.d.ts +13 -0
- package/types/styles.d.ts +28 -0
- package/types/timeline.type.d.ts +9 -0
- package/{src/utils/functions.ts → utils/functions.d.ts} +1 -9
- package/utils/functions.js +11 -0
- package/utils/index.d.ts +2 -0
- package/utils/object.d.ts +6 -0
- package/utils/object.js +14 -0
- package/.vscode/extensions.json +0 -3
- package/LICENSE +0 -21
- package/index.html +0 -16
- package/scripts/bundle-css.js +0 -45
- package/src/App.vue +0 -7
- package/src/components/Accordion/Accordion.vue +0 -139
- package/src/components/Accordion/AccordionContent.vue +0 -63
- package/src/components/Accordion/AccordionItem.vue +0 -163
- package/src/components/Accordion/AccordionTrigger.vue +0 -125
- package/src/components/Accordion/index.ts +0 -5
- package/src/components/Accordion/types.ts +0 -41
- package/src/components/Alert.vue +0 -112
- package/src/components/Avatar.vue +0 -110
- package/src/components/AvatarUploader/AvatarUploader.vue +0 -129
- package/src/components/Badge.vue +0 -45
- package/src/components/Button.vue +0 -122
- package/src/components/ButtonGroup.vue +0 -173
- package/src/components/Carousel/Carousel.vue +0 -84
- package/src/components/Carousel/index.ts +0 -2
- package/src/components/Carousel/types.ts +0 -25
- package/src/components/CheckBox.vue +0 -132
- package/src/components/Chip/Chip.vue +0 -158
- package/src/components/Chip/index.ts +0 -2
- package/src/components/Chip/types.ts +0 -23
- package/src/components/ChoiceBox/ChoiceBox.vue +0 -181
- package/src/components/ChoiceBox/index.ts +0 -2
- package/src/components/ColorPicker/ColorIro.vue +0 -207
- package/src/components/ColorPicker/ColorPicker.vue +0 -61
- package/src/components/ConfirmationModal.vue +0 -46
- package/src/components/DataTable/DataTable.vue +0 -478
- package/src/components/DataTable/DataTableHeader.vue +0 -78
- package/src/components/DataTable/DataTableRow.vue +0 -171
- package/src/components/DataTable/DataTableToolbar.vue +0 -45
- package/src/components/DataTable/index.ts +0 -5
- package/src/components/DataTable/types.ts +0 -85
- package/src/components/DatePicker.vue +0 -102
- package/src/components/Dropdown/Dropdown.vue +0 -348
- package/src/components/Dropdown/DropdownBooleanItem.vue +0 -40
- package/src/components/Dropdown/DropdownGroupedLayout.vue +0 -115
- package/src/components/Dropdown/DropdownItem.vue +0 -56
- package/src/components/Dropdown/DropdownMenu.vue +0 -374
- package/src/components/Dropdown/DropdownTrigger.vue +0 -27
- package/src/components/Dropdown/composables/useDropdownIds.ts +0 -27
- package/src/components/Dropdown/composables/useDropdownNavigation.ts +0 -109
- package/src/components/Dropdown/composables/useDropdownSelection.ts +0 -106
- package/src/components/Dropdown/index.ts +0 -6
- package/src/components/FilePicker/FilePicker.vue +0 -459
- package/src/components/FilePicker/index.ts +0 -2
- package/src/components/FileTree/FileTree.vue +0 -334
- package/src/components/FileTree/FileTreeNode.vue +0 -225
- package/src/components/FileTree/index.ts +0 -2
- package/src/components/FileTree/types.ts +0 -31
- package/src/components/FileTree/useTreeSelection.ts +0 -66
- package/src/components/Form/CustomFields.vue +0 -294
- package/src/components/Form/Form.vue +0 -406
- package/src/components/Form/FormField.vue +0 -404
- package/src/components/Form/FormFields.vue +0 -161
- package/src/components/Form/composables/useFileUpload.ts +0 -112
- package/src/components/Form/composables/useForm.ts +0 -356
- package/src/components/Form/index.ts +0 -16
- package/src/components/Form/types.ts +0 -203
- package/src/components/Form/utils/form.utils.ts +0 -209
- package/src/components/Heatmap/Heatmap.vue +0 -629
- package/src/components/Heatmap/index.ts +0 -2
- package/src/components/Heatmap/types.ts +0 -84
- package/src/components/Icon.vue +0 -47
- package/src/components/IconPicker.vue +0 -138
- package/src/components/Input.vue +0 -366
- package/src/components/Label.vue +0 -25
- package/src/components/Logo.vue +0 -5
- package/src/components/Masonry/Masonry.vue +0 -148
- package/src/components/Masonry/index.ts +0 -2
- package/src/components/Masonry/types.ts +0 -44
- package/src/components/Modal.vue +0 -135
- package/src/components/MultiSelect/MultiSelect.vue +0 -176
- package/src/components/MultiSelect/index.ts +0 -1
- package/src/components/Navbar/Navbar.vue +0 -277
- package/src/components/Navbar/NavbarGroup.vue +0 -27
- package/src/components/Navbar/NavbarItem.vue +0 -124
- package/src/components/Navbar/index.ts +0 -3
- package/src/components/OTPInput/OTPInput.vue +0 -220
- package/src/components/OTPInput/index.ts +0 -1
- package/src/components/Pagination/Pagination.vue +0 -238
- package/src/components/Pagination/index.ts +0 -1
- package/src/components/PricingPlan/PricingPlan.vue +0 -102
- package/src/components/PricingPlan/PricingPlanItem.vue +0 -148
- package/src/components/PricingPlan/index.ts +0 -3
- package/src/components/PricingPlan/types.ts +0 -29
- package/src/components/SidePanel.vue +0 -184
- package/src/components/SidebarMenu/SidebarMenu.vue +0 -146
- package/src/components/SidebarMenu/SidebarMenuItem.vue +0 -333
- package/src/components/SidebarMenu/index.ts +0 -3
- package/src/components/SidebarMenu/types.ts +0 -54
- package/src/components/Slider.vue +0 -181
- package/src/components/Switch.vue +0 -51
- package/src/components/Tabes/Tabes.vue +0 -112
- package/src/components/Tabes/index.ts +0 -2
- package/src/components/Tabes/types.ts +0 -17
- package/src/components/Textarea.vue +0 -48
- package/src/components/ThemeToggle.vue +0 -14
- package/src/components/Timeline.vue +0 -250
- package/src/components/ToastNotification.vue +0 -257
- package/src/components/Tooltip.vue +0 -25
- package/src/components/Workbook/Sheet.vue +0 -185
- package/src/components/Workbook/Workbook.vue +0 -231
- package/src/components/Workbook/WorkbookAddButton.vue +0 -17
- package/src/components/Workbook/index.ts +0 -3
- package/src/components/Workbook/types.ts +0 -43
- package/src/composables/useKeyStroke.ts +0 -291
- package/src/composables/useNotifications.ts +0 -206
- package/src/composables/useTheme.ts +0 -55
- package/src/core/config.ts +0 -37
- package/src/core/index.ts +0 -49
- package/src/css/base.css +0 -148
- package/src/css/input.css +0 -61
- package/src/css/main.css +0 -6
- package/src/css/theme.css +0 -344
- package/src/directives/vRipple.ts +0 -38
- package/src/index.ts +0 -53
- package/src/main.ts +0 -5
- package/src/playground/Playground.vue +0 -429
- package/src/playground/composables/useGetUsers.ts +0 -538
- package/src/playground/demos/AccordionDemo.vue +0 -361
- package/src/playground/demos/AlertDemo.vue +0 -36
- package/src/playground/demos/AvatarDemo.vue +0 -41
- package/src/playground/demos/AvatarUploaderDemo.vue +0 -133
- package/src/playground/demos/BadgeDemo.vue +0 -31
- package/src/playground/demos/BadgesDemo.vue +0 -26
- package/src/playground/demos/ButtonDemo.vue +0 -99
- package/src/playground/demos/ButtonGroupDemo.vue +0 -39
- package/src/playground/demos/ButtonsDemo.vue +0 -111
- package/src/playground/demos/CarouselDemo.vue +0 -135
- package/src/playground/demos/CheckBoxDemo.vue +0 -43
- package/src/playground/demos/ChipDemo.vue +0 -190
- package/src/playground/demos/ChoiceBoxDemo.vue +0 -160
- package/src/playground/demos/ColorPickerDemo.vue +0 -30
- package/src/playground/demos/ColorsDemo.vue +0 -295
- package/src/playground/demos/DataTableDemo.vue +0 -215
- package/src/playground/demos/DatePickerDemo.vue +0 -43
- package/src/playground/demos/DisplayDemo.vue +0 -101
- package/src/playground/demos/DropdownDemo.vue +0 -651
- package/src/playground/demos/FilePickerDemo.vue +0 -175
- package/src/playground/demos/FileTreeDemo.vue +0 -150
- package/src/playground/demos/FormDemo.vue +0 -1144
- package/src/playground/demos/HeatmapDemo.vue +0 -467
- package/src/playground/demos/IconPickerDemo.vue +0 -27
- package/src/playground/demos/InputDemo.vue +0 -80
- package/src/playground/demos/InputsDemo.vue +0 -127
- package/src/playground/demos/LabelDemo.vue +0 -32
- package/src/playground/demos/MasonryDemo.vue +0 -241
- package/src/playground/demos/ModalDemo.vue +0 -67
- package/src/playground/demos/MultiSelectDemo.vue +0 -300
- package/src/playground/demos/NavbarDemo.vue +0 -59
- package/src/playground/demos/NavigationDemo.vue +0 -116
- package/src/playground/demos/OTPInputDemo.vue +0 -170
- package/src/playground/demos/OverlaysDemo.vue +0 -104
- package/src/playground/demos/PaginationDemo.vue +0 -130
- package/src/playground/demos/PricingPlanDemo.vue +0 -110
- package/src/playground/demos/SidePanelDemo.vue +0 -45
- package/src/playground/demos/SidebarMenuDemo.vue +0 -170
- package/src/playground/demos/SliderDemo.vue +0 -48
- package/src/playground/demos/SwitchDemo.vue +0 -40
- package/src/playground/demos/TabesDemo.vue +0 -178
- package/src/playground/demos/TextareaDemo.vue +0 -31
- package/src/playground/demos/ThemeToggleDemo.vue +0 -20
- package/src/playground/demos/TimelineDemo.vue +0 -43
- package/src/playground/demos/ToastDemo.vue +0 -111
- package/src/playground/demos/TooltipDemo.vue +0 -30
- package/src/playground/demos/WorkbookDemo.vue +0 -227
- package/src/types/alert.type.ts +0 -11
- package/src/types/button.ts +0 -36
- package/src/types/buttongroup.type.ts +0 -1
- package/src/types/form.type.ts +0 -75
- package/src/types/index.ts +0 -11
- package/src/types/navbar.type.ts +0 -28
- package/src/types/sidepanel.type.ts +0 -14
- package/src/types/styles.ts +0 -42
- package/src/types/timeline.type.ts +0 -11
- package/src/utils/index.ts +0 -2
- package/src/utils/object.ts +0 -40
- package/tsconfig.app.json +0 -27
- package/tsconfig.json +0 -48
- package/tsconfig.node.json +0 -18
- package/tsconfig.node.tsbuildinfo +0 -1
- package/tsconfig.tsbuildinfo +0 -1
- package/vercel.json +0 -8
- package/vite.config.d.ts +0 -2
- package/vite.config.js +0 -63
- package/vite.config.ts +0 -64
- package/vite.config.vercel.ts +0 -17
|
@@ -1,348 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import ToolTip from 'v-tooltip-lite'
|
|
3
|
-
import 'v-tooltip-lite/style.css'
|
|
4
|
-
import { computed, ref, watch, reactive, toRefs } from 'vue'
|
|
5
|
-
import type { IDropdownOptions, IDropdownOption } from '@/types/styles'
|
|
6
|
-
import type { TooltTipPlacement } from 'v-tooltip-lite/types'
|
|
7
|
-
import DropdownMenu from './DropdownMenu.vue'
|
|
8
|
-
import DropdownTrigger from './DropdownTrigger.vue'
|
|
9
|
-
import ConfirmationModal from '@/components/ConfirmationModal.vue'
|
|
10
|
-
import { useDropdownIds } from './composables/useDropdownIds'
|
|
11
|
-
import { useDropdownSelection } from './composables/useDropdownSelection'
|
|
12
|
-
|
|
13
|
-
const props = withDefaults(
|
|
14
|
-
defineProps<{
|
|
15
|
-
selected?: any
|
|
16
|
-
modelValue?: any
|
|
17
|
-
className?: string
|
|
18
|
-
emptyMessage?: string
|
|
19
|
-
position?: TooltTipPlacement
|
|
20
|
-
closeOnSelect?: boolean
|
|
21
|
-
toggleSelection?: boolean
|
|
22
|
-
options?: IDropdownOptions
|
|
23
|
-
canCloseOutside?: boolean
|
|
24
|
-
caret?: boolean
|
|
25
|
-
offset?: [number, number]
|
|
26
|
-
isOpen?: boolean
|
|
27
|
-
teleport?: boolean
|
|
28
|
-
selectedIndex?: number | null
|
|
29
|
-
maxHeight?: string
|
|
30
|
-
width?: string
|
|
31
|
-
ignoreClickOutside?: string[]
|
|
32
|
-
menuId?: string
|
|
33
|
-
nestedPosition?: TooltTipPlacement
|
|
34
|
-
nestedOffset?: [number, number]
|
|
35
|
-
showSelectedLabel?: boolean
|
|
36
|
-
selectable?: boolean
|
|
37
|
-
doubleConfirmation?: boolean
|
|
38
|
-
layout?: 'default' | 'grouped'
|
|
39
|
-
columns?: number | string
|
|
40
|
-
// Pagination & Search
|
|
41
|
-
loading?: boolean
|
|
42
|
-
hasMore?: boolean
|
|
43
|
-
searchable?: boolean
|
|
44
|
-
remote?: boolean
|
|
45
|
-
}>(),
|
|
46
|
-
{
|
|
47
|
-
canCloseOutside: true,
|
|
48
|
-
closeOnSelect: true,
|
|
49
|
-
toggleSelection: true,
|
|
50
|
-
position: 'bottom-end',
|
|
51
|
-
emptyMessage: 'No options found',
|
|
52
|
-
offset: () => [0, 8],
|
|
53
|
-
isOpen: undefined,
|
|
54
|
-
teleport: true,
|
|
55
|
-
selectedIndex: null,
|
|
56
|
-
maxHeight: '300px',
|
|
57
|
-
showSelectedLabel: true,
|
|
58
|
-
selectable: true,
|
|
59
|
-
doubleConfirmation: false,
|
|
60
|
-
layout: 'default',
|
|
61
|
-
columns: 3,
|
|
62
|
-
loading: false,
|
|
63
|
-
hasMore: false,
|
|
64
|
-
searchable: true,
|
|
65
|
-
remote: false,
|
|
66
|
-
},
|
|
67
|
-
)
|
|
68
|
-
|
|
69
|
-
const emit = defineEmits<{
|
|
70
|
-
(e: 'onSelect', payload: { value: any; data?: any }): void
|
|
71
|
-
(e: 'update:modelValue', value: any): void
|
|
72
|
-
(e: 'onOpen'): void
|
|
73
|
-
(e: 'onClose'): void
|
|
74
|
-
(e: 'update:isOpen', value: boolean): void
|
|
75
|
-
// new events
|
|
76
|
-
(e: 'load-more'): void
|
|
77
|
-
(e: 'search', query: string): void
|
|
78
|
-
}>()
|
|
79
|
-
|
|
80
|
-
const showConfirmation = ref(false)
|
|
81
|
-
const pendingOption = ref<IDropdownOption | null>(null)
|
|
82
|
-
const confirmationConfig = ref<{
|
|
83
|
-
title: string
|
|
84
|
-
description: string
|
|
85
|
-
confirmText: string
|
|
86
|
-
cancelText: string
|
|
87
|
-
variant: 'danger' | 'primary' | 'warning' | 'success' | 'info'
|
|
88
|
-
}>({
|
|
89
|
-
title: 'Confirm Selection',
|
|
90
|
-
description: 'Are you sure you want to select this option?',
|
|
91
|
-
confirmText: 'Confirm',
|
|
92
|
-
cancelText: 'Cancel',
|
|
93
|
-
variant: 'primary',
|
|
94
|
-
})
|
|
95
|
-
|
|
96
|
-
// Internal State for Open/Close
|
|
97
|
-
// We need this because if no v-model:isOpen is passed, we still need to force close logic.
|
|
98
|
-
const internalIsOpen = ref(props.isOpen || false)
|
|
99
|
-
|
|
100
|
-
watch(
|
|
101
|
-
() => props.isOpen,
|
|
102
|
-
(val) => {
|
|
103
|
-
if (val !== undefined) {
|
|
104
|
-
internalIsOpen.value = val
|
|
105
|
-
}
|
|
106
|
-
},
|
|
107
|
-
)
|
|
108
|
-
|
|
109
|
-
const handleVisibilityChange = (val: boolean) => {
|
|
110
|
-
internalIsOpen.value = val
|
|
111
|
-
emit('update:isOpen', val)
|
|
112
|
-
if (val) emit('onOpen')
|
|
113
|
-
else emit('onClose')
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
// Internal Options Caching Logic
|
|
117
|
-
const internalOptions = ref<IDropdownOptions>([])
|
|
118
|
-
|
|
119
|
-
watch(
|
|
120
|
-
() => props.options,
|
|
121
|
-
(newVal) => {
|
|
122
|
-
if (!newVal) return
|
|
123
|
-
|
|
124
|
-
if (props.remote) {
|
|
125
|
-
// Merge logic: Add new options to internalOptions if not already present
|
|
126
|
-
const newOptions = [...internalOptions.value]
|
|
127
|
-
newVal.forEach((opt) => {
|
|
128
|
-
const exists = newOptions.some((existing) => {
|
|
129
|
-
// Unique check: Value or Label
|
|
130
|
-
if (
|
|
131
|
-
existing.value !== undefined &&
|
|
132
|
-
opt.value !== undefined
|
|
133
|
-
) {
|
|
134
|
-
// Check for object value equality if necessary, but typically value is primitive or has ID
|
|
135
|
-
// For complex objects, simple equality might trigger dupes. Assuming primitive or stable ref.
|
|
136
|
-
// If value is object, maybe check key?
|
|
137
|
-
if (
|
|
138
|
-
typeof existing.value === 'object' &&
|
|
139
|
-
existing.key &&
|
|
140
|
-
opt.key
|
|
141
|
-
) {
|
|
142
|
-
return (
|
|
143
|
-
existing.key === opt.key &&
|
|
144
|
-
existing.value[existing.key] ===
|
|
145
|
-
opt.value[opt.key]
|
|
146
|
-
)
|
|
147
|
-
}
|
|
148
|
-
return existing.value === opt.value
|
|
149
|
-
}
|
|
150
|
-
return existing.label === opt.label
|
|
151
|
-
})
|
|
152
|
-
|
|
153
|
-
if (!exists) {
|
|
154
|
-
newOptions.push(opt)
|
|
155
|
-
}
|
|
156
|
-
})
|
|
157
|
-
internalOptions.value = newOptions
|
|
158
|
-
} else {
|
|
159
|
-
internalOptions.value = newVal
|
|
160
|
-
}
|
|
161
|
-
},
|
|
162
|
-
{ immediate: true, deep: true },
|
|
163
|
-
)
|
|
164
|
-
|
|
165
|
-
const { getAllRecursiveIds } = useDropdownIds()
|
|
166
|
-
|
|
167
|
-
// useDropdownSelection needs ALL options to resolve labels correctly, especially for cached items not in current props.options
|
|
168
|
-
// We construct a reactive props proxy to inject internalOptions
|
|
169
|
-
const selectionProps = reactive({
|
|
170
|
-
...toRefs(props),
|
|
171
|
-
options: internalOptions,
|
|
172
|
-
})
|
|
173
|
-
|
|
174
|
-
const { currentValue, selectedLabel, selectOption } = useDropdownSelection(
|
|
175
|
-
selectionProps as any, // Cast to any to satisfy strict prop types if needed, or define interface
|
|
176
|
-
emit,
|
|
177
|
-
)
|
|
178
|
-
|
|
179
|
-
const finalIgnoreClickOutside = computed(() => {
|
|
180
|
-
const propsList = props.ignoreClickOutside || []
|
|
181
|
-
// Use internalOptions to include cached recursive IDs
|
|
182
|
-
const recursiveIds = getAllRecursiveIds(internalOptions.value)
|
|
183
|
-
return [...new Set([...propsList, ...recursiveIds])]
|
|
184
|
-
})
|
|
185
|
-
|
|
186
|
-
const handleOptionSelect = (
|
|
187
|
-
option: import('@/types/styles').IDropdownOption,
|
|
188
|
-
) => {
|
|
189
|
-
// Check if double confirmation is enabled globally or per-option
|
|
190
|
-
const needsConfirmation = props.doubleConfirmation || !!option.confirmation
|
|
191
|
-
|
|
192
|
-
if (needsConfirmation) {
|
|
193
|
-
pendingOption.value = option
|
|
194
|
-
|
|
195
|
-
// Configure Modal
|
|
196
|
-
if (typeof option.confirmation === 'object') {
|
|
197
|
-
confirmationConfig.value = {
|
|
198
|
-
title: option.confirmation.title || 'Confirm Selection',
|
|
199
|
-
description:
|
|
200
|
-
option.confirmation.description ||
|
|
201
|
-
'Are you sure you want to select this option?',
|
|
202
|
-
confirmText: option.confirmation.confirmText || 'Confirm',
|
|
203
|
-
cancelText: option.confirmation.cancelText || 'Cancel',
|
|
204
|
-
variant: option.confirmation.variant || 'primary',
|
|
205
|
-
}
|
|
206
|
-
} else {
|
|
207
|
-
// Default / Global
|
|
208
|
-
confirmationConfig.value = {
|
|
209
|
-
title: 'Confirm Selection',
|
|
210
|
-
description: `Are you sure you want to select "${option.label}"?`,
|
|
211
|
-
confirmText: 'Confirm',
|
|
212
|
-
cancelText: 'Cancel',
|
|
213
|
-
variant: 'primary',
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
showConfirmation.value = true
|
|
218
|
-
// Close dropdown immediately? Or wait?
|
|
219
|
-
// Requirement: "Visually state should only change after confirmation" implies we wait.
|
|
220
|
-
// So we don't close until confirm? Or we close dropdown to show modal?
|
|
221
|
-
// Modal usually overlays everything. Better to close dropdown to reduce clutter,
|
|
222
|
-
// but if we cancel, users might expect dropdown to stay open?
|
|
223
|
-
// Let's close dropdown to properly focus on modal.
|
|
224
|
-
handleClose()
|
|
225
|
-
} else {
|
|
226
|
-
performSelection(option)
|
|
227
|
-
if (props.closeOnSelect) {
|
|
228
|
-
handleClose()
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
const performSelection = (option: import('@/types/styles').IDropdownOption) => {
|
|
234
|
-
selectOption(option)
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
const confirmSelection = () => {
|
|
238
|
-
if (pendingOption.value) {
|
|
239
|
-
performSelection(pendingOption.value)
|
|
240
|
-
pendingOption.value = null
|
|
241
|
-
showConfirmation.value = false
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
const cancelSelection = () => {
|
|
246
|
-
pendingOption.value = null
|
|
247
|
-
showConfirmation.value = false
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
const handleClose = () => {
|
|
251
|
-
handleVisibilityChange(false)
|
|
252
|
-
}
|
|
253
|
-
</script>
|
|
254
|
-
|
|
255
|
-
<template>
|
|
256
|
-
<div class="relative inline-block text-left">
|
|
257
|
-
<ToolTip
|
|
258
|
-
content=""
|
|
259
|
-
trigger="click"
|
|
260
|
-
:arrow="false"
|
|
261
|
-
:teleport="teleport"
|
|
262
|
-
:offset="offset"
|
|
263
|
-
:placement="position"
|
|
264
|
-
:isOpen="internalIsOpen"
|
|
265
|
-
:menuId="menuId"
|
|
266
|
-
:ignoreClickOutside="finalIgnoreClickOutside"
|
|
267
|
-
class="w-full"
|
|
268
|
-
:className="'dropdown ' + (className || '')"
|
|
269
|
-
@onShow="$emit('onOpen')"
|
|
270
|
-
@onHide="$emit('onClose')"
|
|
271
|
-
@update:isOpen="handleVisibilityChange"
|
|
272
|
-
triggerClass="w-full"
|
|
273
|
-
:styles="{ padding: '0' }">
|
|
274
|
-
<template #trigger="{ isOpen }">
|
|
275
|
-
<slot
|
|
276
|
-
name="trigger"
|
|
277
|
-
v-bind="{ selectedLabel, isOpen }">
|
|
278
|
-
<DropdownTrigger
|
|
279
|
-
:selected-label="selectedLabel"
|
|
280
|
-
:is-open="isOpen"
|
|
281
|
-
class="w-full" />
|
|
282
|
-
</slot>
|
|
283
|
-
</template>
|
|
284
|
-
|
|
285
|
-
<template #default>
|
|
286
|
-
<slot />
|
|
287
|
-
|
|
288
|
-
<DropdownMenu
|
|
289
|
-
v-if="
|
|
290
|
-
options?.length ||
|
|
291
|
-
internalOptions.length ||
|
|
292
|
-
$slots.menu ||
|
|
293
|
-
$slots.item ||
|
|
294
|
-
remote ||
|
|
295
|
-
searchable
|
|
296
|
-
"
|
|
297
|
-
:options="options"
|
|
298
|
-
:cachedOptions="internalOptions"
|
|
299
|
-
:class="className"
|
|
300
|
-
:selected="currentValue"
|
|
301
|
-
:selectedIndex="selectedIndex"
|
|
302
|
-
:maxHeight="maxHeight"
|
|
303
|
-
:nestedPosition="nestedPosition"
|
|
304
|
-
:nestedOffset="nestedOffset"
|
|
305
|
-
:selectable="selectable"
|
|
306
|
-
:layout="layout"
|
|
307
|
-
:columns="columns"
|
|
308
|
-
:loading="loading"
|
|
309
|
-
:hasMore="hasMore"
|
|
310
|
-
:searchable="searchable"
|
|
311
|
-
:remote="remote"
|
|
312
|
-
@select="handleOptionSelect"
|
|
313
|
-
@close="handleClose"
|
|
314
|
-
@load-more="$emit('load-more')"
|
|
315
|
-
@search="(q) => $emit('search', q)">
|
|
316
|
-
<template #menu>
|
|
317
|
-
<slot name="menu" />
|
|
318
|
-
</template>
|
|
319
|
-
<template #item="slotProps">
|
|
320
|
-
<slot
|
|
321
|
-
name="item"
|
|
322
|
-
v-bind="slotProps" />
|
|
323
|
-
</template>
|
|
324
|
-
<template
|
|
325
|
-
#header
|
|
326
|
-
v-if="$slots.header">
|
|
327
|
-
<slot name="header" />
|
|
328
|
-
</template>
|
|
329
|
-
<template
|
|
330
|
-
#footer
|
|
331
|
-
v-if="$slots.footer">
|
|
332
|
-
<slot name="footer" />
|
|
333
|
-
</template>
|
|
334
|
-
</DropdownMenu>
|
|
335
|
-
</template>
|
|
336
|
-
</ToolTip>
|
|
337
|
-
|
|
338
|
-
<ConfirmationModal
|
|
339
|
-
:show="showConfirmation"
|
|
340
|
-
:title="confirmationConfig.title"
|
|
341
|
-
:description="confirmationConfig.description"
|
|
342
|
-
:confirm-text="confirmationConfig.confirmText"
|
|
343
|
-
:cancel-text="confirmationConfig.cancelText"
|
|
344
|
-
:variant="confirmationConfig.variant"
|
|
345
|
-
@confirm="confirmSelection"
|
|
346
|
-
@cancel="cancelSelection" />
|
|
347
|
-
</div>
|
|
348
|
-
</template>
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import Switch from '../Switch.vue'
|
|
3
|
-
import Icon from '../Icon.vue'
|
|
4
|
-
import type { IDropdownOption } from '@/types'
|
|
5
|
-
|
|
6
|
-
interface Props {
|
|
7
|
-
option: IDropdownOption
|
|
8
|
-
value: boolean
|
|
9
|
-
focused?: boolean
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
const props = defineProps<Props>()
|
|
13
|
-
|
|
14
|
-
const emit = defineEmits<{
|
|
15
|
-
(e: 'change', value: boolean, option: IDropdownOption): void
|
|
16
|
-
}>()
|
|
17
|
-
|
|
18
|
-
const handleToggle = (newValue: boolean) => {
|
|
19
|
-
emit('change', newValue, props.option)
|
|
20
|
-
}
|
|
21
|
-
</script>
|
|
22
|
-
|
|
23
|
-
<template>
|
|
24
|
-
<div
|
|
25
|
-
data-dropdown-item
|
|
26
|
-
class="relative flex cursor-pointer select-none items-center justify-between rounded-sm px-2 py-1.5 text-sm outline-none transition-colors"
|
|
27
|
-
:class="[
|
|
28
|
-
focused ? 'bg-accent text-accent-foreground' : 'hover:bg-accent hover:text-accent-foreground',
|
|
29
|
-
]"
|
|
30
|
-
@click.stop="handleToggle(!value)">
|
|
31
|
-
<div class="flex items-center gap-2 flex-1 min-w-0">
|
|
32
|
-
<Icon v-if="option.icon" :icon="option.icon" class="h-4 w-4 shrink-0 opacity-70" />
|
|
33
|
-
<span class="truncate font-medium">{{ option.label }}</span>
|
|
34
|
-
</div>
|
|
35
|
-
<Switch
|
|
36
|
-
:model-value="value"
|
|
37
|
-
class="ml-3 shrink-0 scale-75 origin-right"
|
|
38
|
-
@update:model-value="handleToggle" />
|
|
39
|
-
</div>
|
|
40
|
-
</template>
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { computed } from 'vue'
|
|
3
|
-
import Icon from '../Icon.vue'
|
|
4
|
-
import type { IDropdownOptions, IDropdownOption } from '@/types'
|
|
5
|
-
import DropdownItem from './DropdownItem.vue'
|
|
6
|
-
|
|
7
|
-
interface Props {
|
|
8
|
-
options: IDropdownOptions
|
|
9
|
-
selected?: any
|
|
10
|
-
selectable?: boolean
|
|
11
|
-
columns?: number | string
|
|
12
|
-
itemsClass?: string
|
|
13
|
-
headerClass?: string
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
const props = withDefaults(defineProps<Props>(), {
|
|
17
|
-
options: () => [],
|
|
18
|
-
selectable: true,
|
|
19
|
-
columns: 3,
|
|
20
|
-
})
|
|
21
|
-
|
|
22
|
-
const emit = defineEmits<{
|
|
23
|
-
(e: 'select', option: IDropdownOption): void
|
|
24
|
-
(e: 'mouseenter', payload: any): void
|
|
25
|
-
}>()
|
|
26
|
-
|
|
27
|
-
// Calculate Grid Columns
|
|
28
|
-
const gridStyle = computed(() => {
|
|
29
|
-
const cols = props.columns
|
|
30
|
-
if (typeof cols === 'number') {
|
|
31
|
-
return { gridTemplateColumns: `repeat(${cols}, minmax(0, 1fr))` }
|
|
32
|
-
}
|
|
33
|
-
return { gridTemplateColumns: cols } // Allow custom string like '200px 1fr'
|
|
34
|
-
})
|
|
35
|
-
|
|
36
|
-
// Check selection helper (reusing logic visual)
|
|
37
|
-
const isSelected = (option: IDropdownOption) => {
|
|
38
|
-
// Similar logic to parent, but we rely on simple check here for UI
|
|
39
|
-
// The parent DropdownMenu logic handles the 'selected' prop complexity usually.
|
|
40
|
-
// If selected is complex object, simple equality might fail, but let's assume parent passes relevant checker or we check values.
|
|
41
|
-
// Actually the parent `DropdownMenu` passes `selected` which is the value.
|
|
42
|
-
if (!props.selected) return false
|
|
43
|
-
|
|
44
|
-
// Array check
|
|
45
|
-
if (Array.isArray(props.selected)) return props.selected.includes(option.value)
|
|
46
|
-
|
|
47
|
-
// Object/Primitive check
|
|
48
|
-
if (typeof props.selected === 'object' && props.selected !== null) {
|
|
49
|
-
if (option.key && option.key in props.selected)
|
|
50
|
-
return props.selected[option.key] === option.value
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
return props.selected === option.value
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
// Flat list for simple linear index emulation if needed,
|
|
57
|
-
// but here we just render structurally.
|
|
58
|
-
// Keyboard nav relying on 'filteredOptions' in parent might need to map to this structure.
|
|
59
|
-
// For now, we render semantically.
|
|
60
|
-
</script>
|
|
61
|
-
|
|
62
|
-
<template>
|
|
63
|
-
<div class="grid gap-6 p-4" :style="gridStyle">
|
|
64
|
-
<div
|
|
65
|
-
v-for="(group, gIndex) in options"
|
|
66
|
-
:key="group.key || group.value || gIndex"
|
|
67
|
-
class="flex flex-col space-y-2 min-w-[150px]">
|
|
68
|
-
<!-- Group Header -->
|
|
69
|
-
<div class="flex items-center gap-2 px-2 py-1 mb-1" :class="headerClass">
|
|
70
|
-
<span class="font-semibold text-sm text-foreground">
|
|
71
|
-
{{ group.label }}
|
|
72
|
-
</span>
|
|
73
|
-
<Icon v-if="group.icon" :icon="group.icon" class="w-4 h-4 text-muted-foreground" />
|
|
74
|
-
</div>
|
|
75
|
-
|
|
76
|
-
<!-- Divider if needed? -->
|
|
77
|
-
<!-- <div class="h-px bg-border w-full mb-2"></div> -->
|
|
78
|
-
|
|
79
|
-
<!-- Children Items -->
|
|
80
|
-
<div class="flex flex-col space-y-1">
|
|
81
|
-
<template v-if="group.children && group.children.length">
|
|
82
|
-
<template
|
|
83
|
-
v-for="(child, cIndex) in group.children"
|
|
84
|
-
:key="child.key || child.value || cIndex">
|
|
85
|
-
<!-- Standard Item -->
|
|
86
|
-
<DropdownItem
|
|
87
|
-
:option="child"
|
|
88
|
-
:selected="isSelected(child)"
|
|
89
|
-
:selectable="selectable"
|
|
90
|
-
class="w-full"
|
|
91
|
-
@click="$emit('select', child)" />
|
|
92
|
-
|
|
93
|
-
<!-- Grandchildren (Flattened with Indent) -->
|
|
94
|
-
<!-- If we want to support 3rd level in grouped view, usually it's just indented below parent -->
|
|
95
|
-
<template v-if="child.children && child.children.length">
|
|
96
|
-
<div class="flex flex-col space-y-1 ml-3 pl-3 border-l border-border mt-0.5 mb-1.5">
|
|
97
|
-
<DropdownItem
|
|
98
|
-
v-for="(grandChild, gcIndex) in child.children"
|
|
99
|
-
:key="grandChild.key || grandChild.value || gcIndex"
|
|
100
|
-
:option="grandChild"
|
|
101
|
-
:selected="isSelected(grandChild)"
|
|
102
|
-
:selectable="selectable"
|
|
103
|
-
class="w-full text-xs"
|
|
104
|
-
@click="$emit('select', grandChild)" />
|
|
105
|
-
</div>
|
|
106
|
-
</template>
|
|
107
|
-
</template>
|
|
108
|
-
</template>
|
|
109
|
-
|
|
110
|
-
<!-- Empty State for Group -->
|
|
111
|
-
<div v-else class="px-2 text-xs text-muted-foreground italic">No items</div>
|
|
112
|
-
</div>
|
|
113
|
-
</div>
|
|
114
|
-
</div>
|
|
115
|
-
</template>
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import Icon from '../Icon.vue'
|
|
3
|
-
import type { IDropdownOption } from '@/types'
|
|
4
|
-
|
|
5
|
-
interface Props {
|
|
6
|
-
option: IDropdownOption
|
|
7
|
-
selected?: boolean
|
|
8
|
-
focused?: boolean
|
|
9
|
-
selectable?: boolean
|
|
10
|
-
index?: number
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
defineProps<Props>()
|
|
14
|
-
|
|
15
|
-
const emit = defineEmits<{
|
|
16
|
-
(e: 'click', option: IDropdownOption): void
|
|
17
|
-
(e: 'mouseenter', index: number): void
|
|
18
|
-
}>()
|
|
19
|
-
</script>
|
|
20
|
-
|
|
21
|
-
<template>
|
|
22
|
-
<div
|
|
23
|
-
data-dropdown-item
|
|
24
|
-
class="relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors data-disabled:pointer-events-none data-disabled:opacity-50"
|
|
25
|
-
:class="[
|
|
26
|
-
selectable && selected && !option.children ? 'bg-accent' : '',
|
|
27
|
-
focused ? 'bg-accent text-accent-foreground' : 'hover:bg-accent hover:text-accent-foreground',
|
|
28
|
-
option.disabled ? 'opacity-50 cursor-not-allowed' : 'cursor-pointer',
|
|
29
|
-
]"
|
|
30
|
-
:data-disabled="option.disabled ? true : undefined"
|
|
31
|
-
@click="emit('click', option)"
|
|
32
|
-
@mouseenter="$emit('mouseenter', index ?? -1)">
|
|
33
|
-
<slot name="default" v-bind="{ option, index, selected }">
|
|
34
|
-
<Icon v-if="option.icon" :icon="option.icon" class="mr-2 h-4 w-4 shrink-0 mt-0.5" />
|
|
35
|
-
<div class="flex flex-col flex-1 min-w-0">
|
|
36
|
-
<div class="flex items-center justify-between gap-2">
|
|
37
|
-
<span class="truncate font-medium">{{ option.label }}</span>
|
|
38
|
-
<span
|
|
39
|
-
v-if="option.subtitle"
|
|
40
|
-
class="text-xs text-muted-foreground whitespace-nowrap opacity-90"
|
|
41
|
-
>{{ option.subtitle }}</span
|
|
42
|
-
>
|
|
43
|
-
</div>
|
|
44
|
-
<span
|
|
45
|
-
v-if="option.description"
|
|
46
|
-
class="text-[10px] text-muted-foreground truncate opacity-70"
|
|
47
|
-
>{{ option.description }}</span
|
|
48
|
-
>
|
|
49
|
-
</div>
|
|
50
|
-
<Icon
|
|
51
|
-
v-if="selectable && selected"
|
|
52
|
-
icon="lucide:check"
|
|
53
|
-
class="ml-2 h-4 w-4 shrink-0 text-primary" />
|
|
54
|
-
</slot>
|
|
55
|
-
</div>
|
|
56
|
-
</template>
|