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
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { InputSize, InputRounded } from '../../types';
|
|
2
|
+
export interface FilePickerValue {
|
|
3
|
+
fileName: string;
|
|
4
|
+
fileType: string;
|
|
5
|
+
fileSize: number;
|
|
6
|
+
file: File;
|
|
7
|
+
base64: string;
|
|
8
|
+
}
|
|
9
|
+
interface Props {
|
|
10
|
+
modelValue?: FilePickerValue | FilePickerValue[] | null;
|
|
11
|
+
multiSelect?: boolean;
|
|
12
|
+
fileTypes?: string[];
|
|
13
|
+
returnFormat?: 'file' | 'base64';
|
|
14
|
+
loading?: boolean;
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
maxSize?: number;
|
|
17
|
+
variant?: 'dropzone' | 'input';
|
|
18
|
+
placeholder?: string;
|
|
19
|
+
size?: InputSize;
|
|
20
|
+
rounded?: InputRounded;
|
|
21
|
+
}
|
|
22
|
+
declare function __VLS_template(): {
|
|
23
|
+
attrs: Partial<{}>;
|
|
24
|
+
slots: {
|
|
25
|
+
trigger?(_: {
|
|
26
|
+
trigger: () => void;
|
|
27
|
+
isDragging: boolean;
|
|
28
|
+
isLoading: boolean;
|
|
29
|
+
files: any[];
|
|
30
|
+
}): any;
|
|
31
|
+
};
|
|
32
|
+
refs: {
|
|
33
|
+
fileInput: HTMLInputElement;
|
|
34
|
+
};
|
|
35
|
+
rootEl: HTMLDivElement;
|
|
36
|
+
};
|
|
37
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
38
|
+
declare const __VLS_component: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
39
|
+
"update:modelValue": (value: FilePickerValue | FilePickerValue[]) => any;
|
|
40
|
+
change: (value: FilePickerValue | FilePickerValue[]) => any;
|
|
41
|
+
error: (error: string) => any;
|
|
42
|
+
}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
|
|
43
|
+
"onUpdate:modelValue"?: (value: FilePickerValue | FilePickerValue[]) => any;
|
|
44
|
+
onChange?: (value: FilePickerValue | FilePickerValue[]) => any;
|
|
45
|
+
onError?: (error: string) => any;
|
|
46
|
+
}>, {
|
|
47
|
+
disabled: boolean;
|
|
48
|
+
size: InputSize;
|
|
49
|
+
variant: "dropzone" | "input";
|
|
50
|
+
modelValue: FilePickerValue | FilePickerValue[] | null;
|
|
51
|
+
loading: boolean;
|
|
52
|
+
rounded: InputRounded;
|
|
53
|
+
multiSelect: boolean;
|
|
54
|
+
fileTypes: string[];
|
|
55
|
+
returnFormat: "file" | "base64";
|
|
56
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {
|
|
57
|
+
fileInput: HTMLInputElement;
|
|
58
|
+
}, HTMLDivElement>;
|
|
59
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
60
|
+
export default _default;
|
|
61
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
62
|
+
new (): {
|
|
63
|
+
$slots: S;
|
|
64
|
+
};
|
|
65
|
+
};
|
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
import { defineComponent as K, ref as S, useSlots as O, computed as v, openBlock as a, createElementBlock as u, createElementVNode as s, renderSlot as q, normalizeClass as z, createBlock as y, withModifiers as D, createVNode as b, createTextVNode as H, toDisplayString as F, createCommentVNode as x, Fragment as J, renderList as Q } from "vue";
|
|
2
|
+
import f from "../Icon.vue.js";
|
|
3
|
+
import T from "../Button.vue.js";
|
|
4
|
+
const X = { class: "w-full" }, Y = ["multiple", "accept"], Z = ["value", "placeholder", "disabled"], _ = { class: "absolute right-3 top-1/2 -translate-y-1/2 flex items-center justify-center gap-2 bg-background" }, ee = { class: "p-3 bg-muted rounded-full text-muted-foreground" }, le = { class: "space-y-1" }, te = {
|
|
5
|
+
key: 0,
|
|
6
|
+
class: "text-xs text-muted-foreground"
|
|
7
|
+
}, oe = {
|
|
8
|
+
key: 1,
|
|
9
|
+
class: "space-y-3"
|
|
10
|
+
}, ie = { class: "shrink-0 mr-3" }, re = { class: "p-2 bg-primary/10 rounded text-primary" }, ae = { class: "flex-1 min-w-0" }, ne = { class: "text-sm font-medium text-foreground truncate" }, se = { class: "text-xs text-muted-foreground" }, de = { class: "flex-shrink-0 ml-3 flex gap-2" }, ue = {
|
|
11
|
+
key: 0,
|
|
12
|
+
class: "flex gap-2"
|
|
13
|
+
}, ce = {
|
|
14
|
+
key: 2,
|
|
15
|
+
class: "absolute inset-0 bg-white/60 backdrop-blur-[1px] flex items-center justify-center rounded-lg z-10"
|
|
16
|
+
}, fe = { class: "bg-white p-2 rounded-full shadow-lg" }, ve = /* @__PURE__ */ K({
|
|
17
|
+
name: "FilePicker",
|
|
18
|
+
__name: "FilePicker",
|
|
19
|
+
props: {
|
|
20
|
+
modelValue: { default: null },
|
|
21
|
+
multiSelect: { type: Boolean, default: !1 },
|
|
22
|
+
fileTypes: { default: () => [] },
|
|
23
|
+
returnFormat: { default: "file" },
|
|
24
|
+
loading: { type: Boolean, default: !1 },
|
|
25
|
+
disabled: { type: Boolean, default: !1 },
|
|
26
|
+
maxSize: {},
|
|
27
|
+
variant: { default: "dropzone" },
|
|
28
|
+
placeholder: {},
|
|
29
|
+
size: { default: "md" },
|
|
30
|
+
rounded: { default: "md" }
|
|
31
|
+
},
|
|
32
|
+
emits: ["update:modelValue", "change", "error"],
|
|
33
|
+
setup(o, { emit: B }) {
|
|
34
|
+
const e = o, c = B, C = S(null), m = S(!1), d = S(!1);
|
|
35
|
+
O();
|
|
36
|
+
const N = v(() => e.fileTypes.join(",")), k = v(() => Array.isArray(e.modelValue) ? e.modelValue.length > 0 : e.modelValue !== null), w = v(() => {
|
|
37
|
+
let t = [];
|
|
38
|
+
return Array.isArray(e.modelValue) ? t = e.modelValue : e.modelValue && (t = [e.modelValue]), t.map((l) => {
|
|
39
|
+
if (typeof l == "string") {
|
|
40
|
+
const r = l.split("/").pop() || "Unknown File";
|
|
41
|
+
return {
|
|
42
|
+
fileName: decodeURIComponent(r),
|
|
43
|
+
fileType: "unknown",
|
|
44
|
+
fileSize: 0,
|
|
45
|
+
file: null,
|
|
46
|
+
base64: l,
|
|
47
|
+
isUrl: !0
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
return l;
|
|
51
|
+
});
|
|
52
|
+
}), g = () => {
|
|
53
|
+
e.disabled || e.loading || d.value || C.value?.click();
|
|
54
|
+
}, j = (t) => {
|
|
55
|
+
t.preventDefault(), !(e.disabled || e.loading) && (m.value = !0);
|
|
56
|
+
}, $ = (t) => {
|
|
57
|
+
t.preventDefault(), m.value = !1;
|
|
58
|
+
}, M = (t) => {
|
|
59
|
+
t.preventDefault(), m.value = !1, !(e.disabled || e.loading || d.value) && t.dataTransfer?.files && A(t.dataTransfer.files);
|
|
60
|
+
}, I = (t) => {
|
|
61
|
+
const l = t.target;
|
|
62
|
+
l.files && A(l.files), l.value = "";
|
|
63
|
+
}, L = (t) => {
|
|
64
|
+
if (t === 0 || !t) return "";
|
|
65
|
+
const l = 1024, r = ["Bytes", "KB", "MB", "GB", "TB"], n = Math.floor(Math.log(t) / Math.log(l));
|
|
66
|
+
return parseFloat((t / Math.pow(l, n)).toFixed(2)) + " " + r[n];
|
|
67
|
+
}, P = (t) => new Promise((l, r) => {
|
|
68
|
+
const n = new FileReader();
|
|
69
|
+
n.readAsDataURL(t), n.onload = () => {
|
|
70
|
+
typeof n.result == "string" ? l(n.result) : r(new Error("Failed to read file as base64"));
|
|
71
|
+
}, n.onerror = (p) => r(p);
|
|
72
|
+
}), A = async (t) => {
|
|
73
|
+
if (t.length === 0) return;
|
|
74
|
+
d.value = !0;
|
|
75
|
+
const l = [], r = [], n = Array.from(t), p = e.multiSelect ? n : [n[0]];
|
|
76
|
+
try {
|
|
77
|
+
for (const i of p) {
|
|
78
|
+
if (e.fileTypes.length > 0 && !e.fileTypes.some((h) => {
|
|
79
|
+
if (h.startsWith("."))
|
|
80
|
+
return i.name.toLowerCase().endsWith(h.toLowerCase());
|
|
81
|
+
if (h.endsWith("/*")) {
|
|
82
|
+
const G = h.split("/")[0];
|
|
83
|
+
return i.type.startsWith(G);
|
|
84
|
+
}
|
|
85
|
+
return i.type === h;
|
|
86
|
+
})) {
|
|
87
|
+
r.push(`File type not allowed: ${i.name}`);
|
|
88
|
+
continue;
|
|
89
|
+
}
|
|
90
|
+
if (e.maxSize && i.size > e.maxSize) {
|
|
91
|
+
r.push(`File too large: ${i.name}`);
|
|
92
|
+
continue;
|
|
93
|
+
}
|
|
94
|
+
let V = "";
|
|
95
|
+
e.returnFormat === "base64" && (V = await P(i)), l.push({
|
|
96
|
+
fileName: i.name,
|
|
97
|
+
fileType: i.type,
|
|
98
|
+
fileSize: i.size,
|
|
99
|
+
file: i,
|
|
100
|
+
base64: V
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
if (r.length > 0 && c("error", r.join("; ")), l.length > 0) {
|
|
104
|
+
let i;
|
|
105
|
+
e.multiSelect ? i = [...Array.isArray(e.modelValue) ? e.modelValue : [], ...l] : i = l[0], c("update:modelValue", i), c("change", i);
|
|
106
|
+
}
|
|
107
|
+
} catch (i) {
|
|
108
|
+
console.error("Error processing files:", i), c("error", "Failed to process files");
|
|
109
|
+
} finally {
|
|
110
|
+
d.value = !1;
|
|
111
|
+
}
|
|
112
|
+
}, E = (t) => {
|
|
113
|
+
if (!(e.disabled || e.loading))
|
|
114
|
+
if (e.multiSelect && Array.isArray(e.modelValue)) {
|
|
115
|
+
const l = [...e.modelValue];
|
|
116
|
+
l.splice(t, 1), c("update:modelValue", l), c("change", l);
|
|
117
|
+
} else
|
|
118
|
+
c("update:modelValue", null), c("change", null);
|
|
119
|
+
}, U = () => {
|
|
120
|
+
e.disabled || e.loading || (c("update:modelValue", null), c("change", null));
|
|
121
|
+
}, W = v(() => k.value ? w.value.map((l) => l.fileName).join(", ") : ""), R = v(() => {
|
|
122
|
+
const t = "block w-full bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50 transition-all focus-visible:outline-none cursor-pointer", l = {
|
|
123
|
+
sm: "h-8 text-xs",
|
|
124
|
+
md: "h-10 text-sm",
|
|
125
|
+
lg: "h-12 text-base"
|
|
126
|
+
}, r = {
|
|
127
|
+
none: "rounded-none",
|
|
128
|
+
sm: "rounded-sm",
|
|
129
|
+
md: "rounded-md",
|
|
130
|
+
lg: "rounded-lg",
|
|
131
|
+
xl: "rounded-xl",
|
|
132
|
+
"2xl": "rounded-2xl",
|
|
133
|
+
full: "rounded-full"
|
|
134
|
+
};
|
|
135
|
+
return [
|
|
136
|
+
t,
|
|
137
|
+
"border border-input focus-visible:border-primary",
|
|
138
|
+
// Default outline style
|
|
139
|
+
l[e.size],
|
|
140
|
+
r[e.rounded],
|
|
141
|
+
"pr-10",
|
|
142
|
+
// Space for icon
|
|
143
|
+
e.disabled ? "cursor-not-allowed opacity-50" : ""
|
|
144
|
+
].join(" ");
|
|
145
|
+
});
|
|
146
|
+
return (t, l) => (a(), u("div", X, [
|
|
147
|
+
s("input", {
|
|
148
|
+
ref_key: "fileInput",
|
|
149
|
+
ref: C,
|
|
150
|
+
type: "file",
|
|
151
|
+
multiple: o.multiSelect,
|
|
152
|
+
accept: N.value,
|
|
153
|
+
class: "hidden",
|
|
154
|
+
onChange: I
|
|
155
|
+
}, null, 40, Y),
|
|
156
|
+
q(t.$slots, "trigger", {
|
|
157
|
+
trigger: g,
|
|
158
|
+
isDragging: m.value,
|
|
159
|
+
isLoading: o.loading || d.value,
|
|
160
|
+
files: w.value
|
|
161
|
+
}, () => [
|
|
162
|
+
o.variant === "input" ? (a(), u("div", {
|
|
163
|
+
key: 0,
|
|
164
|
+
class: "relative",
|
|
165
|
+
onClick: g
|
|
166
|
+
}, [
|
|
167
|
+
s("input", {
|
|
168
|
+
type: "text",
|
|
169
|
+
value: W.value,
|
|
170
|
+
placeholder: o.placeholder || "Select file...",
|
|
171
|
+
readonly: "",
|
|
172
|
+
class: z(R.value),
|
|
173
|
+
disabled: o.disabled || o.loading || d.value
|
|
174
|
+
}, null, 10, Z),
|
|
175
|
+
s("div", _, [
|
|
176
|
+
o.loading || d.value ? (a(), y(f, {
|
|
177
|
+
key: 0,
|
|
178
|
+
icon: "lucide:loader-2",
|
|
179
|
+
class: "h-4 w-4 animate-spin text-muted-foreground"
|
|
180
|
+
})) : k.value && !o.disabled ? (a(), u("button", {
|
|
181
|
+
key: 1,
|
|
182
|
+
type: "button",
|
|
183
|
+
class: "text-muted-foreground hover:text-foreground focus:outline-none",
|
|
184
|
+
onClick: D(U, ["stop"])
|
|
185
|
+
}, [
|
|
186
|
+
b(f, {
|
|
187
|
+
icon: "lucide:x-circle",
|
|
188
|
+
class: "h-4 w-4"
|
|
189
|
+
})
|
|
190
|
+
])) : (a(), y(f, {
|
|
191
|
+
key: 2,
|
|
192
|
+
icon: "lucide:upload",
|
|
193
|
+
class: "h-4 w-4 text-muted-foreground"
|
|
194
|
+
}))
|
|
195
|
+
])
|
|
196
|
+
])) : (a(), u("div", {
|
|
197
|
+
key: 1,
|
|
198
|
+
class: "relative",
|
|
199
|
+
onDragover: j,
|
|
200
|
+
onDragleave: $,
|
|
201
|
+
onDrop: M
|
|
202
|
+
}, [
|
|
203
|
+
k.value ? (a(), u("div", oe, [
|
|
204
|
+
(a(!0), u(J, null, Q(w.value, (r, n) => (a(), u("div", {
|
|
205
|
+
key: n,
|
|
206
|
+
class: z(["relative flex items-center p-3 border border-border rounded-lg bg-card shadow-sm transition-colors group", [!o.multiSelect && !o.disabled ? "cursor-pointer hover:border-primary/50" : ""]]),
|
|
207
|
+
onClick: l[0] || (l[0] = (p) => !o.multiSelect && !o.disabled ? g() : null)
|
|
208
|
+
}, [
|
|
209
|
+
s("div", ie, [
|
|
210
|
+
s("div", re, [
|
|
211
|
+
b(f, {
|
|
212
|
+
icon: "lucide:file-text",
|
|
213
|
+
class: "w-5 h-5"
|
|
214
|
+
})
|
|
215
|
+
])
|
|
216
|
+
]),
|
|
217
|
+
s("div", ae, [
|
|
218
|
+
s("p", ne, F(r.fileName), 1),
|
|
219
|
+
s("p", se, F(L(r.fileSize)), 1)
|
|
220
|
+
]),
|
|
221
|
+
s("div", de, [
|
|
222
|
+
!o.disabled && !o.loading ? (a(), y(T, {
|
|
223
|
+
key: 0,
|
|
224
|
+
size: "xs",
|
|
225
|
+
variant: "ghost",
|
|
226
|
+
icon: "lucide:x",
|
|
227
|
+
rounded: "full",
|
|
228
|
+
class: "text-muted-foreground hover:text-destructive hover:bg-destructive/10",
|
|
229
|
+
onClick: D((p) => E(n), ["stop"])
|
|
230
|
+
}, null, 8, ["onClick"])) : x("", !0)
|
|
231
|
+
])
|
|
232
|
+
], 2))), 128)),
|
|
233
|
+
o.multiSelect ? (a(), u("div", ue, [
|
|
234
|
+
b(T, {
|
|
235
|
+
size: "sm",
|
|
236
|
+
variant: "outline",
|
|
237
|
+
icon: "lucide:plus",
|
|
238
|
+
text: "Add more",
|
|
239
|
+
disabled: o.disabled || o.loading || d.value,
|
|
240
|
+
onClick: g
|
|
241
|
+
}, null, 8, ["disabled"])
|
|
242
|
+
])) : x("", !0)
|
|
243
|
+
])) : (a(), u("div", {
|
|
244
|
+
key: 0,
|
|
245
|
+
class: z(["border-2 border-dashed border-border rounded-lg p-6 transition-all duration-200 ease-in-out cursor-pointer flex flex-col items-center justify-center text-center gap-3", [
|
|
246
|
+
m.value ? "border-primary bg-primary/5" : "hover:border-primary/50 hover:bg-muted/50",
|
|
247
|
+
o.disabled || o.loading || d.value ? "opacity-50 cursor-not-allowed" : ""
|
|
248
|
+
]]),
|
|
249
|
+
onClick: g
|
|
250
|
+
}, [
|
|
251
|
+
s("div", ee, [
|
|
252
|
+
o.loading || d.value ? (a(), y(f, {
|
|
253
|
+
key: 0,
|
|
254
|
+
icon: "lucide:loader-2",
|
|
255
|
+
class: "w-6 h-6 animate-spin"
|
|
256
|
+
})) : (a(), y(f, {
|
|
257
|
+
key: 1,
|
|
258
|
+
icon: "lucide:upload-cloud",
|
|
259
|
+
class: "w-6 h-6"
|
|
260
|
+
}))
|
|
261
|
+
]),
|
|
262
|
+
s("div", le, [
|
|
263
|
+
l[1] || (l[1] = s("p", { class: "text-sm font-medium text-foreground" }, [
|
|
264
|
+
s("span", { class: "text-primary hover:underline" }, "Click to upload"),
|
|
265
|
+
H(" or drag and drop ")
|
|
266
|
+
], -1)),
|
|
267
|
+
o.fileTypes.length ? (a(), u("p", te, F(o.fileTypes.join(", ")), 1)) : x("", !0)
|
|
268
|
+
])
|
|
269
|
+
], 2)),
|
|
270
|
+
o.loading || d.value ? (a(), u("div", ce, [
|
|
271
|
+
s("div", fe, [
|
|
272
|
+
b(f, {
|
|
273
|
+
icon: "lucide:loader-2",
|
|
274
|
+
class: "w-6 h-6 animate-spin text-primary"
|
|
275
|
+
})
|
|
276
|
+
])
|
|
277
|
+
])) : x("", !0)
|
|
278
|
+
], 32))
|
|
279
|
+
])
|
|
280
|
+
]));
|
|
281
|
+
}
|
|
282
|
+
});
|
|
283
|
+
export {
|
|
284
|
+
ve as default
|
|
285
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { FileNode, FileTreeProps } from './types';
|
|
2
|
+
declare const _default: import('vue').DefineComponent<FileTreeProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
3
|
+
select: (node: FileNode, selected: boolean) => any;
|
|
4
|
+
"update:modelValue": (keys: string[]) => any;
|
|
5
|
+
expand: (node: FileNode, expanded: boolean) => any;
|
|
6
|
+
"node-click": (node: FileNode) => any;
|
|
7
|
+
}, string, import('vue').PublicProps, Readonly<FileTreeProps> & Readonly<{
|
|
8
|
+
onSelect?: (node: FileNode, selected: boolean) => any;
|
|
9
|
+
"onUpdate:modelValue"?: (keys: string[]) => any;
|
|
10
|
+
onExpand?: (node: FileNode, expanded: boolean) => any;
|
|
11
|
+
"onNode-click"?: (node: FileNode) => any;
|
|
12
|
+
}>, {
|
|
13
|
+
data: FileNode[];
|
|
14
|
+
modelValue: string[];
|
|
15
|
+
selectionMode: import('./types').FileTreeSelectionMode;
|
|
16
|
+
showCheckboxes: boolean;
|
|
17
|
+
highlightSearch: boolean;
|
|
18
|
+
defaultExpandedKeys: string[];
|
|
19
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
20
|
+
export default _default;
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { defineComponent as N, ref as g, watch as E, computed as w, openBlock as p, createElementBlock as S, normalizeClass as T, Fragment as q, renderList as Q, createBlock as V } from "vue";
|
|
2
|
+
import F from "./FileTreeNode.vue.js";
|
|
3
|
+
const z = {
|
|
4
|
+
key: 1,
|
|
5
|
+
class: "text-sm text-muted-foreground p-4 text-center"
|
|
6
|
+
}, $ = /* @__PURE__ */ N({
|
|
7
|
+
__name: "FileTree",
|
|
8
|
+
props: {
|
|
9
|
+
modelValue: { default: () => [] },
|
|
10
|
+
data: { default: () => [] },
|
|
11
|
+
selectionMode: { default: "single" },
|
|
12
|
+
showCheckboxes: { type: Boolean, default: !1 },
|
|
13
|
+
defaultExpandedKeys: { default: () => [] },
|
|
14
|
+
loadData: {},
|
|
15
|
+
highlightSearch: { type: Boolean, default: !1 },
|
|
16
|
+
searchQuery: {},
|
|
17
|
+
class: {}
|
|
18
|
+
},
|
|
19
|
+
emits: ["update:modelValue", "select", "expand", "node-click"],
|
|
20
|
+
setup(h, { emit: C }) {
|
|
21
|
+
const l = h, f = C, u = g(new Set(l.defaultExpandedKeys)), y = g(/* @__PURE__ */ new Set()), m = g(/* @__PURE__ */ new Map()), k = g(/* @__PURE__ */ new Map()), M = (t, a) => {
|
|
22
|
+
for (const e of t)
|
|
23
|
+
m.value.set(e.id, e), a && k.value.set(e.id, a), e.children && M(e.children, e.id);
|
|
24
|
+
};
|
|
25
|
+
E(
|
|
26
|
+
() => l.data,
|
|
27
|
+
(t) => {
|
|
28
|
+
m.value.clear(), k.value.clear(), M(t);
|
|
29
|
+
},
|
|
30
|
+
{ immediate: !0, deep: !0 }
|
|
31
|
+
);
|
|
32
|
+
const v = (t) => {
|
|
33
|
+
let a = [];
|
|
34
|
+
if (t.children)
|
|
35
|
+
for (const e of t.children)
|
|
36
|
+
a.push(e.id), a = a.concat(v(e));
|
|
37
|
+
return a;
|
|
38
|
+
}, x = w(() => new Set(l.modelValue)), K = w(() => {
|
|
39
|
+
const t = /* @__PURE__ */ new Set();
|
|
40
|
+
if (l.selectionMode !== "multiple") return t;
|
|
41
|
+
const a = (e) => {
|
|
42
|
+
if (!e.children || e.children.length === 0)
|
|
43
|
+
return x.value.has(e.id) ? { status: "checked" } : { status: "unchecked" };
|
|
44
|
+
let c = !1, s = !1, i = !1;
|
|
45
|
+
for (const d of e.children) {
|
|
46
|
+
const n = a(d);
|
|
47
|
+
n.status === "checked" && (c = !0), n.status === "unchecked" && (s = !0), n.status === "indeterminate" && (i = !0);
|
|
48
|
+
}
|
|
49
|
+
return i || c && s ? (t.add(e.id), { status: "indeterminate" }) : c ? { status: "checked" } : { status: "unchecked" };
|
|
50
|
+
};
|
|
51
|
+
return l.data.forEach(a), t;
|
|
52
|
+
}), L = async (t) => {
|
|
53
|
+
if (t.disabled) return;
|
|
54
|
+
if (u.value.has(t.id)) {
|
|
55
|
+
u.value.delete(t.id);
|
|
56
|
+
const e = m.value.get(t.id) || t;
|
|
57
|
+
v(e).forEach((s) => u.value.delete(s)), f("expand", t, !1);
|
|
58
|
+
} else if (u.value.add(t.id), f("expand", t, !0), l.loadData && !t.isLoaded && (!t.children || t.children.length === 0)) {
|
|
59
|
+
y.value.add(t.id);
|
|
60
|
+
try {
|
|
61
|
+
await l.loadData(t);
|
|
62
|
+
} finally {
|
|
63
|
+
y.value.delete(t.id);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}, B = (t) => {
|
|
67
|
+
if (t.disabled) return;
|
|
68
|
+
const a = m.value.get(t.id) || t;
|
|
69
|
+
let e = new Set(x.value);
|
|
70
|
+
const c = e.has(t.id);
|
|
71
|
+
if (l.selectionMode === "single")
|
|
72
|
+
e.clear(), c || e.add(t.id);
|
|
73
|
+
else if (l.selectionMode === "multiple") {
|
|
74
|
+
const s = v(a), i = !c, d = (o, r) => {
|
|
75
|
+
r ? e.add(o) : e.delete(o);
|
|
76
|
+
};
|
|
77
|
+
d(t.id, i), s.forEach((o) => d(o, i));
|
|
78
|
+
let n = a;
|
|
79
|
+
for (; ; ) {
|
|
80
|
+
const o = k.value.get(n.id);
|
|
81
|
+
if (!o) break;
|
|
82
|
+
const r = m.value.get(o);
|
|
83
|
+
if (!r || !r.children) break;
|
|
84
|
+
r.children.every((D) => e.has(D.id)) ? e.add(r.id) : e.delete(r.id), n = r;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
f("update:modelValue", Array.from(e)), f("select", a, !c);
|
|
88
|
+
}, b = w(() => {
|
|
89
|
+
if (!l.searchQuery) return l.data;
|
|
90
|
+
const t = l.searchQuery.toLowerCase(), a = (e) => {
|
|
91
|
+
const c = e.label.toLowerCase().includes(t), s = !!e.searchMatch;
|
|
92
|
+
let i = [];
|
|
93
|
+
return e.children && (i = e.children.map(a).filter((d) => d !== null)), c || s || i.length > 0 ? {
|
|
94
|
+
...e,
|
|
95
|
+
children: i
|
|
96
|
+
} : null;
|
|
97
|
+
};
|
|
98
|
+
return l.data.map(a).filter((e) => e !== null);
|
|
99
|
+
});
|
|
100
|
+
return E(
|
|
101
|
+
() => [l.searchQuery, l.data],
|
|
102
|
+
([t]) => {
|
|
103
|
+
if (t) {
|
|
104
|
+
const a = t.toLowerCase(), e = /* @__PURE__ */ new Set(), c = (s) => {
|
|
105
|
+
let i = !1;
|
|
106
|
+
if (s.children)
|
|
107
|
+
for (const n of s.children)
|
|
108
|
+
c(n) && (i = !0);
|
|
109
|
+
const d = s.label.toLowerCase().includes(a) || !!s.searchMatch;
|
|
110
|
+
return i && e.add(s.id), d || i;
|
|
111
|
+
};
|
|
112
|
+
l.data.forEach(c), e.forEach((s) => u.value.add(s));
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
{ deep: !0 }
|
|
116
|
+
), (t, a) => (p(), S("div", {
|
|
117
|
+
class: T(["w-full h-full overflow-y-auto", l.class])
|
|
118
|
+
}, [
|
|
119
|
+
b.value.length > 0 ? (p(!0), S(q, { key: 0 }, Q(b.value, (e) => (p(), V(F, {
|
|
120
|
+
key: e.id,
|
|
121
|
+
node: e,
|
|
122
|
+
"selection-mode": h.selectionMode,
|
|
123
|
+
"selected-keys": x.value,
|
|
124
|
+
"expanded-keys": u.value,
|
|
125
|
+
"indeterminate-keys": K.value,
|
|
126
|
+
"loading-keys": y.value,
|
|
127
|
+
"show-checkboxes": h.showCheckboxes,
|
|
128
|
+
"highlight-search": h.highlightSearch,
|
|
129
|
+
"search-query": h.searchQuery,
|
|
130
|
+
onToggleExpand: L,
|
|
131
|
+
onToggleSelect: B,
|
|
132
|
+
onClickNode: a[0] || (a[0] = (c) => f("node-click", c))
|
|
133
|
+
}, null, 8, ["node", "selection-mode", "selected-keys", "expanded-keys", "indeterminate-keys", "loading-keys", "show-checkboxes", "highlight-search", "search-query"]))), 128)) : (p(), S("div", z, "No results found."))
|
|
134
|
+
], 2));
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
export {
|
|
138
|
+
$ as default
|
|
139
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { FileNode, FileTreeSelectionMode } from './types';
|
|
2
|
+
interface Props {
|
|
3
|
+
node: FileNode;
|
|
4
|
+
depth?: number;
|
|
5
|
+
selectionMode?: FileTreeSelectionMode;
|
|
6
|
+
selectedKeys: Set<string>;
|
|
7
|
+
indeterminateKeys: Set<string>;
|
|
8
|
+
expandedKeys: Set<string>;
|
|
9
|
+
loadingKeys: Set<string>;
|
|
10
|
+
showCheckboxes?: boolean;
|
|
11
|
+
highlightSearch?: boolean;
|
|
12
|
+
searchQuery?: string;
|
|
13
|
+
}
|
|
14
|
+
declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
15
|
+
"toggle-expand": (node: FileNode) => any;
|
|
16
|
+
"toggle-select": (node: FileNode) => any;
|
|
17
|
+
"click-node": (node: FileNode) => any;
|
|
18
|
+
}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
|
|
19
|
+
"onToggle-expand"?: (node: FileNode) => any;
|
|
20
|
+
"onToggle-select"?: (node: FileNode) => any;
|
|
21
|
+
"onClick-node"?: (node: FileNode) => any;
|
|
22
|
+
}>, {
|
|
23
|
+
depth: number;
|
|
24
|
+
selectionMode: FileTreeSelectionMode;
|
|
25
|
+
showCheckboxes: boolean;
|
|
26
|
+
highlightSearch: boolean;
|
|
27
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
28
|
+
export default _default;
|