@sakoa/ui 0.1.0
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/README.md +171 -0
- package/dist/App.d.ts +2 -0
- package/dist/cli/index.js +9243 -0
- package/dist/components/DemoSection.d.ts +30 -0
- package/dist/components/SApiKeyboard.d.ts +22 -0
- package/dist/components/SApiSection.d.ts +21 -0
- package/dist/components/SApiTable.d.ts +46 -0
- package/dist/components/STableOfContents.d.ts +2 -0
- package/dist/components/ui/SAlert.d.ts +76 -0
- package/dist/components/ui/SBadge.d.ts +56 -0
- package/dist/components/ui/SButton.d.ts +67 -0
- package/dist/components/ui/SCheckbox.d.ts +64 -0
- package/dist/components/ui/SChip.d.ts +43 -0
- package/dist/components/ui/SDatePicker.d.ts +77 -0
- package/dist/components/ui/SGlassButton.d.ts +70 -0
- package/dist/components/ui/SIcon.d.ts +29 -0
- package/dist/components/ui/SInput.d.ts +129 -0
- package/dist/components/ui/SKbd.d.ts +24 -0
- package/dist/components/ui/SKbdShortcut.d.ts +14 -0
- package/dist/components/ui/SSelect.d.ts +148 -0
- package/dist/components/ui/SSkeleton.d.ts +37 -0
- package/dist/components/ui/SSwitch.d.ts +61 -0
- package/dist/components/ui/STooltip.d.ts +82 -0
- package/dist/components/ui/accordion/SAccordionContent.d.ts +23 -0
- package/dist/components/ui/accordion/SAccordionItem.d.ts +70 -0
- package/dist/components/ui/accordion/SAccordionTrigger.d.ts +37 -0
- package/dist/components/ui/accordion/index.d.ts +4 -0
- package/dist/components/ui/avatar/SAvatar.d.ts +36 -0
- package/dist/components/ui/avatar/SAvatarFallback.d.ts +26 -0
- package/dist/components/ui/avatar/SAvatarGroup.d.ts +30 -0
- package/dist/components/ui/avatar/SAvatarImage.d.ts +23 -0
- package/dist/components/ui/avatar/index.d.ts +4 -0
- package/dist/components/ui/breadcrumb/SBreadcrumb.d.ts +22 -0
- package/dist/components/ui/breadcrumb/SBreadcrumbEllipsis.d.ts +17 -0
- package/dist/components/ui/breadcrumb/SBreadcrumbItem.d.ts +17 -0
- package/dist/components/ui/breadcrumb/SBreadcrumbLink.d.ts +26 -0
- package/dist/components/ui/breadcrumb/SBreadcrumbList.d.ts +17 -0
- package/dist/components/ui/breadcrumb/SBreadcrumbPage.d.ts +17 -0
- package/dist/components/ui/breadcrumb/SBreadcrumbSeparator.d.ts +17 -0
- package/dist/components/ui/breadcrumb/index.d.ts +7 -0
- package/dist/components/ui/card/SCard.d.ts +103 -0
- package/dist/components/ui/card/SCardActions.d.ts +44 -0
- package/dist/components/ui/card/SCardContent.d.ts +35 -0
- package/dist/components/ui/card/SCardFooter.d.ts +38 -0
- package/dist/components/ui/card/SCardHeader.d.ts +53 -0
- package/dist/components/ui/card/SCardMedia.d.ts +83 -0
- package/dist/components/ui/card/SGlassCard.d.ts +103 -0
- package/dist/components/ui/card/SMorphingCardContent.d.ts +18 -0
- package/dist/components/ui/card/index.d.ts +24 -0
- package/dist/components/ui/carousel/SCarousel.d.ts +166 -0
- package/dist/components/ui/carousel/index.d.ts +2 -0
- package/dist/components/ui/color-picker/SColorPickerAlphaSlider.d.ts +4 -0
- package/dist/components/ui/color-picker/SColorPickerCopy.d.ts +19 -0
- package/dist/components/ui/color-picker/SColorPickerEyeDropper.d.ts +17 -0
- package/dist/components/ui/color-picker/SColorPickerHueSlider.d.ts +4 -0
- package/dist/components/ui/color-picker/SColorPickerInputs.d.ts +2 -0
- package/dist/components/ui/color-picker/SColorPickerPresets.d.ts +9 -0
- package/dist/components/ui/color-picker/SColorPickerPreview.d.ts +2 -0
- package/dist/components/ui/color-picker/SColorPickerRecent.d.ts +7 -0
- package/dist/components/ui/color-picker/SColorPickerSpectrum.d.ts +4 -0
- package/dist/components/ui/color-picker/index.d.ts +11 -0
- package/dist/components/ui/drawer/index.d.ts +11 -0
- package/dist/components/ui/dropdown/SDropdownDivider.d.ts +8 -0
- package/dist/components/ui/dropdown/SDropdownGroup.d.ts +25 -0
- package/dist/components/ui/dropdown/SDropdownItem.d.ts +56 -0
- package/dist/components/ui/dropdown/index.d.ts +4 -0
- package/dist/components/ui/form/SForm.d.ts +38 -0
- package/dist/components/ui/form/SFormField.d.ts +31 -0
- package/dist/components/ui/form/index.d.ts +5 -0
- package/dist/components/ui/modal/index.d.ts +19 -0
- package/dist/components/ui/option/SOption.d.ts +32 -0
- package/dist/components/ui/option/SOptionGroup.d.ts +28 -0
- package/dist/components/ui/option/index.d.ts +2 -0
- package/dist/components/ui/otp/SOTP.d.ts +122 -0
- package/dist/components/ui/otp/SOTPGroup.d.ts +23 -0
- package/dist/components/ui/otp/SOTPSeparator.d.ts +17 -0
- package/dist/components/ui/otp/SOTPSlot.d.ts +49 -0
- package/dist/components/ui/otp/index.d.ts +7 -0
- package/dist/components/ui/otp/types.d.ts +26 -0
- package/dist/components/ui/otp/useOTPContext.d.ts +42 -0
- package/dist/components/ui/pagination/SPagination.d.ts +151 -0
- package/dist/components/ui/pagination/index.d.ts +2 -0
- package/dist/components/ui/progress/SProgress.d.ts +62 -0
- package/dist/components/ui/progress/SProgressRange.d.ts +91 -0
- package/dist/components/ui/progress/index.d.ts +4 -0
- package/dist/components/ui/radio/SRadio.d.ts +58 -0
- package/dist/components/ui/radio/SRadioGroup.d.ts +52 -0
- package/dist/components/ui/radio/index.d.ts +2 -0
- package/dist/components/ui/stepper/SStepper.d.ts +83 -0
- package/dist/components/ui/stepper/SStepperContent.d.ts +24 -0
- package/dist/components/ui/stepper/SStepperDescription.d.ts +20 -0
- package/dist/components/ui/stepper/SStepperIndicator.d.ts +37 -0
- package/dist/components/ui/stepper/SStepperItem.d.ts +37 -0
- package/dist/components/ui/stepper/SStepperSeparator.d.ts +5 -0
- package/dist/components/ui/stepper/SStepperTitle.d.ts +20 -0
- package/dist/components/ui/stepper/SStepperTrigger.d.ts +22 -0
- package/dist/components/ui/stepper/index.d.ts +11 -0
- package/dist/components/ui/table/STableBody.d.ts +27 -0
- package/dist/components/ui/table/STableCell.d.ts +55 -0
- package/dist/components/ui/table/STableColumn.d.ts +87 -0
- package/dist/components/ui/table/STableEmpty.d.ts +54 -0
- package/dist/components/ui/table/STableHeader.d.ts +25 -0
- package/dist/components/ui/table/STableRow.d.ts +38 -0
- package/dist/components/ui/table/STableSkeleton.d.ts +29 -0
- package/dist/components/ui/table/index.d.ts +98 -0
- package/dist/components/ui/table/useDataTable.d.ts +80 -0
- package/dist/components/ui/tabs/STabPane.d.ts +31 -0
- package/dist/components/ui/tabs/STabsContent.d.ts +21 -0
- package/dist/components/ui/tabs/STabsIndicator.d.ts +9 -0
- package/dist/components/ui/tabs/STabsTrigger.d.ts +28 -0
- package/dist/components/ui/tabs/index.d.ts +6 -0
- package/dist/components/ui/toast/SToast.d.ts +49 -0
- package/dist/components/ui/toast/SToastContainer.d.ts +21 -0
- package/dist/components/ui/toast/index.d.ts +2 -0
- package/dist/composables/useAsync.d.ts +134 -0
- package/dist/composables/useClickOutside.d.ts +69 -0
- package/dist/composables/useClipboard.d.ts +46 -0
- package/dist/composables/useDebounce.d.ts +150 -0
- package/dist/composables/useDialog.d.ts +118 -0
- package/dist/composables/useForm.d.ts +204 -0
- package/dist/composables/useHotkey.d.ts +128 -0
- package/dist/composables/useIntersectionObserver.d.ts +156 -0
- package/dist/composables/useLocalStorage.d.ts +120 -0
- package/dist/composables/useMediaQuery.d.ts +115 -0
- package/dist/composables/useTheme.d.ts +8 -0
- package/dist/composables/useToast.d.ts +1619 -0
- package/dist/index.d.ts +71 -0
- package/dist/layouts/UILayout.d.ts +2 -0
- package/dist/lib/utils.d.ts +2 -0
- package/dist/main.d.ts +0 -0
- package/dist/router.d.ts +2 -0
- package/dist/saka-ui.css +1 -0
- package/dist/saka-ui.js +18513 -0
- package/dist/saka-ui.umd.cjs +38 -0
- package/dist/views/docs/CustomizationView.d.ts +2 -0
- package/dist/views/docs/FormValidationView.d.ts +2 -0
- package/dist/views/docs/StylingGuideView.d.ts +2 -0
- package/dist/views/docs/UseAsyncView.d.ts +2 -0
- package/dist/views/docs/UseClickOutsideView.d.ts +124 -0
- package/dist/views/docs/UseClipboardView.d.ts +4 -0
- package/dist/views/docs/UseDebounceView.d.ts +2 -0
- package/dist/views/docs/UseHotkeyView.d.ts +205 -0
- package/dist/views/docs/UseIntersectionObserverView.d.ts +5 -0
- package/dist/views/docs/UseLocalStorageView.d.ts +2 -0
- package/dist/views/docs/UseMediaQueryView.d.ts +2 -0
- package/dist/views/docs/UseThemeView.d.ts +2 -0
- package/dist/views/examples/AuthFormView.d.ts +2 -0
- package/dist/views/examples/CreditCardFormView.d.ts +6 -0
- package/dist/views/examples/FormFieldExampleView.d.ts +2 -0
- package/dist/views/examples/ProjectFormView.d.ts +2 -0
- package/dist/views/ui/AccordionView.d.ts +2 -0
- package/dist/views/ui/AlertView.d.ts +2 -0
- package/dist/views/ui/AvatarView.d.ts +2 -0
- package/dist/views/ui/BadgeView.d.ts +2 -0
- package/dist/views/ui/BreadcrumbView.d.ts +2 -0
- package/dist/views/ui/ButtonView.d.ts +2 -0
- package/dist/views/ui/CardView.d.ts +2 -0
- package/dist/views/ui/CarouselView.d.ts +274 -0
- package/dist/views/ui/CheckboxView.d.ts +2 -0
- package/dist/views/ui/ChipView.d.ts +2 -0
- package/dist/views/ui/ColorPickerView.d.ts +2 -0
- package/dist/views/ui/DatePickerView.d.ts +2 -0
- package/dist/views/ui/DialogView.d.ts +2 -0
- package/dist/views/ui/DrawerView.d.ts +2 -0
- package/dist/views/ui/DropdownView.d.ts +2 -0
- package/dist/views/ui/GlassButtonView.d.ts +2 -0
- package/dist/views/ui/GlassCardView.d.ts +2 -0
- package/dist/views/ui/HomeView.d.ts +2 -0
- package/dist/views/ui/IconsView.d.ts +2 -0
- package/dist/views/ui/InputView.d.ts +2 -0
- package/dist/views/ui/KbdView.d.ts +2 -0
- package/dist/views/ui/ModalView.d.ts +2 -0
- package/dist/views/ui/MorphingCardView.d.ts +2 -0
- package/dist/views/ui/MorphingModalView.d.ts +2 -0
- package/dist/views/ui/OTPView.d.ts +206 -0
- package/dist/views/ui/PaginationView.d.ts +2 -0
- package/dist/views/ui/ProgressView.d.ts +2 -0
- package/dist/views/ui/RadioView.d.ts +2 -0
- package/dist/views/ui/SelectView.d.ts +2 -0
- package/dist/views/ui/SkeletonView.d.ts +2 -0
- package/dist/views/ui/StepperView.d.ts +2 -0
- package/dist/views/ui/SwitchView.d.ts +2 -0
- package/dist/views/ui/TableView.d.ts +2 -0
- package/dist/views/ui/TabsView.d.ts +2 -0
- package/dist/views/ui/ToastView.d.ts +2 -0
- package/dist/views/ui/TooltipView.d.ts +2 -0
- package/dist/vite.svg +1 -0
- package/package.json +64 -0
- package/registry/components/accordion.json +19 -0
- package/registry/components/alert.json +17 -0
- package/registry/components/avatar.json +18 -0
- package/registry/components/badge.json +14 -0
- package/registry/components/breadcrumb.json +24 -0
- package/registry/components/button.json +17 -0
- package/registry/components/card.json +23 -0
- package/registry/components/carousel.json +19 -0
- package/registry/components/checkbox.json +17 -0
- package/registry/components/chip.json +17 -0
- package/registry/components/color-picker.json +24 -0
- package/registry/components/date-picker.json +17 -0
- package/registry/components/drawer.json +26 -0
- package/registry/components/dropdown.json +21 -0
- package/registry/components/form.json +16 -0
- package/registry/components/glass-button.json +17 -0
- package/registry/components/icon.json +17 -0
- package/registry/components/input.json +17 -0
- package/registry/components/kbd.json +16 -0
- package/registry/components/modal.json +32 -0
- package/registry/components/option.json +16 -0
- package/registry/components/otp.json +23 -0
- package/registry/components/pagination.json +18 -0
- package/registry/components/progress.json +16 -0
- package/registry/components/radio.json +19 -0
- package/registry/components/select.json +17 -0
- package/registry/components/skeleton.json +14 -0
- package/registry/components/switch.json +17 -0
- package/registry/components/table.json +26 -0
- package/registry/components/tabs.json +19 -0
- package/registry/components/toast.json +19 -0
- package/registry/components/tooltip.json +14 -0
- package/registry/index.json +4 -0
- package/registry/source/components/ui/SAlert.vue +388 -0
- package/registry/source/components/ui/SBadge.vue +243 -0
- package/registry/source/components/ui/SButton.vue +387 -0
- package/registry/source/components/ui/SCheckbox.vue +310 -0
- package/registry/source/components/ui/SChip.vue +130 -0
- package/registry/source/components/ui/SDatePicker.vue +1290 -0
- package/registry/source/components/ui/SGlassButton.vue +547 -0
- package/registry/source/components/ui/SIcon.vue +78 -0
- package/registry/source/components/ui/SInput.vue +1054 -0
- package/registry/source/components/ui/SKbd.vue +96 -0
- package/registry/source/components/ui/SKbdShortcut.vue +36 -0
- package/registry/source/components/ui/SSelect.vue +1290 -0
- package/registry/source/components/ui/SSkeleton.vue +185 -0
- package/registry/source/components/ui/SSwitch.vue +275 -0
- package/registry/source/components/ui/STooltip.vue +491 -0
- package/registry/source/components/ui/accordion/SAccordion.vue +248 -0
- package/registry/source/components/ui/accordion/SAccordionItem.vue +353 -0
- package/registry/source/components/ui/accordion/index.ts +5 -0
- package/registry/source/components/ui/avatar/SAvatar.vue +169 -0
- package/registry/source/components/ui/avatar/SAvatarFallback.vue +66 -0
- package/registry/source/components/ui/avatar/SAvatarGroup.vue +69 -0
- package/registry/source/components/ui/avatar/SAvatarImage.vue +92 -0
- package/registry/source/components/ui/avatar/index.ts +5 -0
- package/registry/source/components/ui/breadcrumb/SBreadcrumb.vue +23 -0
- package/registry/source/components/ui/breadcrumb/SBreadcrumbEllipsis.vue +17 -0
- package/registry/source/components/ui/breadcrumb/SBreadcrumbItem.vue +14 -0
- package/registry/source/components/ui/breadcrumb/SBreadcrumbLink.vue +46 -0
- package/registry/source/components/ui/breadcrumb/SBreadcrumbList.vue +17 -0
- package/registry/source/components/ui/breadcrumb/SBreadcrumbPage.vue +15 -0
- package/registry/source/components/ui/breadcrumb/SBreadcrumbSeparator.vue +18 -0
- package/registry/source/components/ui/breadcrumb/index.ts +7 -0
- package/registry/source/components/ui/card/SCard.vue +517 -0
- package/registry/source/components/ui/card/SCardActions.vue +129 -0
- package/registry/source/components/ui/card/SCardContent.vue +117 -0
- package/registry/source/components/ui/card/SCardFooter.vue +103 -0
- package/registry/source/components/ui/card/SCardHeader.vue +163 -0
- package/registry/source/components/ui/card/SCardMedia.vue +312 -0
- package/registry/source/components/ui/card/index.ts +34 -0
- package/registry/source/components/ui/carousel/SCarousel.vue +1069 -0
- package/registry/source/components/ui/carousel/SCarouselSlide.vue +107 -0
- package/registry/source/components/ui/carousel/index.ts +3 -0
- package/registry/source/components/ui/color-picker/SColorPicker.vue +772 -0
- package/registry/source/components/ui/color-picker/SColorPickerAlphaSlider.vue +158 -0
- package/registry/source/components/ui/color-picker/SColorPickerCopy.vue +76 -0
- package/registry/source/components/ui/color-picker/SColorPickerEyeDropper.vue +68 -0
- package/registry/source/components/ui/color-picker/SColorPickerHueSlider.vue +138 -0
- package/registry/source/components/ui/color-picker/SColorPickerInputs.vue +227 -0
- package/registry/source/components/ui/color-picker/SColorPickerPresets.vue +87 -0
- package/registry/source/components/ui/color-picker/SColorPickerPreview.vue +46 -0
- package/registry/source/components/ui/color-picker/SColorPickerRecent.vue +74 -0
- package/registry/source/components/ui/color-picker/SColorPickerSpectrum.vue +149 -0
- package/registry/source/components/ui/color-picker/index.ts +11 -0
- package/registry/source/components/ui/drawer/SDrawer.vue +797 -0
- package/registry/source/components/ui/drawer/SDrawerClose.vue +64 -0
- package/registry/source/components/ui/drawer/SDrawerContent.vue +81 -0
- package/registry/source/components/ui/drawer/SDrawerDescription.vue +40 -0
- package/registry/source/components/ui/drawer/SDrawerFooter.vue +97 -0
- package/registry/source/components/ui/drawer/SDrawerHandle.vue +79 -0
- package/registry/source/components/ui/drawer/SDrawerHeader.vue +117 -0
- package/registry/source/components/ui/drawer/SDrawerTitle.vue +40 -0
- package/registry/source/components/ui/drawer/SDrawerTrigger.vue +51 -0
- package/registry/source/components/ui/drawer/index.ts +20 -0
- package/registry/source/components/ui/dropdown/SDropdown.vue +843 -0
- package/registry/source/components/ui/dropdown/SDropdownDivider.vue +23 -0
- package/registry/source/components/ui/dropdown/SDropdownGroup.vue +53 -0
- package/registry/source/components/ui/dropdown/SDropdownItem.vue +179 -0
- package/registry/source/components/ui/dropdown/index.ts +5 -0
- package/registry/source/components/ui/form/SForm.vue +84 -0
- package/registry/source/components/ui/form/SFormField.vue +78 -0
- package/registry/source/components/ui/form/index.ts +8 -0
- package/registry/source/components/ui/modal/SModal.vue +648 -0
- package/registry/source/components/ui/modal/SModalClose.vue +49 -0
- package/registry/source/components/ui/modal/SModalContent.vue +74 -0
- package/registry/source/components/ui/modal/SModalDescription.vue +39 -0
- package/registry/source/components/ui/modal/SModalFooter.vue +84 -0
- package/registry/source/components/ui/modal/SModalHeader.vue +107 -0
- package/registry/source/components/ui/modal/SModalTitle.vue +39 -0
- package/registry/source/components/ui/modal/SModalTrigger.vue +61 -0
- package/registry/source/components/ui/modal/SMorphingModal.vue +429 -0
- package/registry/source/components/ui/modal/SMorphingModalClose.vue +42 -0
- package/registry/source/components/ui/modal/SMorphingModalDescription.vue +49 -0
- package/registry/source/components/ui/modal/SMorphingModalImage.vue +44 -0
- package/registry/source/components/ui/modal/SMorphingModalSubtitle.vue +29 -0
- package/registry/source/components/ui/modal/SMorphingModalTitle.vue +34 -0
- package/registry/source/components/ui/modal/SMorphingModalTrigger.vue +95 -0
- package/registry/source/components/ui/modal/index.ts +32 -0
- package/registry/source/components/ui/option/SOption.vue +180 -0
- package/registry/source/components/ui/option/SOptionGroup.vue +77 -0
- package/registry/source/components/ui/option/index.ts +3 -0
- package/registry/source/components/ui/otp/SOTP.vue +843 -0
- package/registry/source/components/ui/otp/SOTPGroup.vue +29 -0
- package/registry/source/components/ui/otp/SOTPSeparator.vue +15 -0
- package/registry/source/components/ui/otp/SOTPSlot.vue +462 -0
- package/registry/source/components/ui/otp/index.ts +7 -0
- package/registry/source/components/ui/otp/types.ts +27 -0
- package/registry/source/components/ui/otp/useOTPContext.ts +62 -0
- package/registry/source/components/ui/pagination/SPagination.vue +923 -0
- package/registry/source/components/ui/pagination/index.ts +8 -0
- package/registry/source/components/ui/progress/SProgress.vue +635 -0
- package/registry/source/components/ui/progress/SProgressRange.vue +715 -0
- package/registry/source/components/ui/progress/index.ts +4 -0
- package/registry/source/components/ui/radio/SRadio.vue +407 -0
- package/registry/source/components/ui/radio/SRadioGroup.vue +200 -0
- package/registry/source/components/ui/radio/index.ts +3 -0
- package/registry/source/components/ui/table/SDataTable.vue +828 -0
- package/registry/source/components/ui/table/STableBody.vue +70 -0
- package/registry/source/components/ui/table/STableCell.vue +147 -0
- package/registry/source/components/ui/table/STableColumn.vue +120 -0
- package/registry/source/components/ui/table/STableEmpty.vue +159 -0
- package/registry/source/components/ui/table/STableHeader.vue +132 -0
- package/registry/source/components/ui/table/STableRow.vue +106 -0
- package/registry/source/components/ui/table/STableSkeleton.vue +208 -0
- package/registry/source/components/ui/table/index.ts +126 -0
- package/registry/source/components/ui/table/useDataTable.ts +519 -0
- package/registry/source/components/ui/tabs/STabPane.vue +130 -0
- package/registry/source/components/ui/tabs/STabs.vue +467 -0
- package/registry/source/components/ui/tabs/index.ts +7 -0
- package/registry/source/components/ui/toast/SToast.vue +261 -0
- package/registry/source/components/ui/toast/SToastContainer.vue +209 -0
- package/registry/source/components/ui/toast/index.ts +2 -0
- package/registry/source/composables/useForm.ts +960 -0
- package/registry/source/composables/useTheme.ts +86 -0
- package/registry/source/composables/useToast.ts +440 -0
- package/registry/source/lib/utils.ts +6 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
/** Number of skeleton rows to show */
|
|
3
|
+
rows?: number;
|
|
4
|
+
/** Number of columns (auto-detected from context if available) */
|
|
5
|
+
columns?: number;
|
|
6
|
+
/** Show selection column */
|
|
7
|
+
showSelection?: boolean;
|
|
8
|
+
/** Show actions column */
|
|
9
|
+
showActions?: boolean;
|
|
10
|
+
/** Custom class for skeleton rows */
|
|
11
|
+
skeletonClass?: string;
|
|
12
|
+
/** Animation style */
|
|
13
|
+
animation?: 'shimmer' | 'pulse' | 'none';
|
|
14
|
+
/** Progressive loading - stagger row appearance */
|
|
15
|
+
progressive?: boolean;
|
|
16
|
+
/** Delay between progressive rows (ms) */
|
|
17
|
+
progressiveDelay?: number;
|
|
18
|
+
}
|
|
19
|
+
declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
20
|
+
animation: "shimmer" | "pulse" | "none";
|
|
21
|
+
columns: number;
|
|
22
|
+
rows: number;
|
|
23
|
+
skeletonClass: string;
|
|
24
|
+
showSelection: boolean;
|
|
25
|
+
showActions: boolean;
|
|
26
|
+
progressive: boolean;
|
|
27
|
+
progressiveDelay: number;
|
|
28
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
29
|
+
export default _default;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { InjectionKey, Ref, ComputedRef } from 'vue';
|
|
2
|
+
/** Table design variants */
|
|
3
|
+
export type TableVariant = 'default' | 'compact' | 'bordered' | 'striped' | 'minimal';
|
|
4
|
+
/** Table size presets */
|
|
5
|
+
export type TableSize = 'sm' | 'md' | 'lg';
|
|
6
|
+
/** Sort direction */
|
|
7
|
+
export type SortDirection = 'asc' | 'desc' | null;
|
|
8
|
+
/** Column alignment */
|
|
9
|
+
export type ColumnAlign = 'left' | 'center' | 'right';
|
|
10
|
+
/** Selection mode */
|
|
11
|
+
export type SelectionMode = 'none' | 'single' | 'multiple';
|
|
12
|
+
/** Column definition */
|
|
13
|
+
export interface TableColumn<T = unknown> {
|
|
14
|
+
/** Unique key for the column */
|
|
15
|
+
key: string;
|
|
16
|
+
/** Display label for header */
|
|
17
|
+
label?: string;
|
|
18
|
+
/** Data accessor - can be a key of T or a function */
|
|
19
|
+
accessor?: keyof T | ((row: T, index: number) => unknown);
|
|
20
|
+
/** Column width (CSS value) */
|
|
21
|
+
width?: string;
|
|
22
|
+
/** Minimum width */
|
|
23
|
+
minWidth?: string;
|
|
24
|
+
/** Maximum width */
|
|
25
|
+
maxWidth?: string;
|
|
26
|
+
/** Text alignment */
|
|
27
|
+
align?: ColumnAlign;
|
|
28
|
+
/** Whether column is sortable */
|
|
29
|
+
sortable?: boolean;
|
|
30
|
+
/** Custom sort function */
|
|
31
|
+
sortFn?: (a: T, b: T, direction: SortDirection) => number;
|
|
32
|
+
/** Whether column is visible */
|
|
33
|
+
visible?: boolean;
|
|
34
|
+
/** Sticky column position */
|
|
35
|
+
sticky?: 'left' | 'right';
|
|
36
|
+
/** Custom header class */
|
|
37
|
+
headerClass?: string;
|
|
38
|
+
/** Custom cell class */
|
|
39
|
+
cellClass?: string;
|
|
40
|
+
/** Render priority for responsive hiding */
|
|
41
|
+
priority?: number;
|
|
42
|
+
}
|
|
43
|
+
/** Sort state */
|
|
44
|
+
export interface SortState {
|
|
45
|
+
column: string | null;
|
|
46
|
+
direction: SortDirection;
|
|
47
|
+
}
|
|
48
|
+
/** Pagination state */
|
|
49
|
+
export interface PaginationState {
|
|
50
|
+
page: number;
|
|
51
|
+
pageSize: number;
|
|
52
|
+
total: number;
|
|
53
|
+
}
|
|
54
|
+
/** Row data with meta */
|
|
55
|
+
export interface TableRowData<T = unknown> {
|
|
56
|
+
data: T;
|
|
57
|
+
index: number;
|
|
58
|
+
originalIndex: number;
|
|
59
|
+
selected: boolean;
|
|
60
|
+
expanded: boolean;
|
|
61
|
+
}
|
|
62
|
+
/** Context provided to table children */
|
|
63
|
+
export interface SDataTableContext<T = unknown> {
|
|
64
|
+
variant: TableVariant;
|
|
65
|
+
size: TableSize;
|
|
66
|
+
selectionMode: SelectionMode;
|
|
67
|
+
loading: Ref<boolean>;
|
|
68
|
+
hoverable: boolean;
|
|
69
|
+
stickyHeader: boolean;
|
|
70
|
+
animateRows: boolean;
|
|
71
|
+
columns: Ref<TableColumn<T>[]>;
|
|
72
|
+
visibleColumns: ComputedRef<TableColumn<T>[]>;
|
|
73
|
+
sortState: Ref<SortState>;
|
|
74
|
+
selectedKeys: Ref<Set<string | number>>;
|
|
75
|
+
expandedKeys: Ref<Set<string | number>>;
|
|
76
|
+
getRowKey: (row: T, index: number) => string | number;
|
|
77
|
+
toggleSort: (column: string) => void;
|
|
78
|
+
toggleRowSelection: (key: string | number) => void;
|
|
79
|
+
toggleAllSelection: () => void;
|
|
80
|
+
toggleRowExpansion: (key: string | number) => void;
|
|
81
|
+
isRowSelected: (key: string | number) => boolean;
|
|
82
|
+
isRowExpanded: (key: string | number) => boolean;
|
|
83
|
+
isAllSelected: ComputedRef<boolean>;
|
|
84
|
+
isSomeSelected: ComputedRef<boolean>;
|
|
85
|
+
showColumn: (key: string) => void;
|
|
86
|
+
hideColumn: (key: string) => void;
|
|
87
|
+
toggleColumn: (key: string) => void;
|
|
88
|
+
}
|
|
89
|
+
export declare const SDataTableContextKey: InjectionKey<SDataTableContext>;
|
|
90
|
+
export { default as SDataTable } from './SDataTable';
|
|
91
|
+
export { default as STableHeader } from './STableHeader';
|
|
92
|
+
export { default as STableBody } from './STableBody';
|
|
93
|
+
export { default as STableRow } from './STableRow';
|
|
94
|
+
export { default as STableCell } from './STableCell';
|
|
95
|
+
export { default as STableColumn } from './STableColumn';
|
|
96
|
+
export { default as STableSkeleton } from './STableSkeleton';
|
|
97
|
+
export { default as STableEmpty } from './STableEmpty';
|
|
98
|
+
export { useDataTable } from './useDataTable';
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { Ref, ComputedRef } from 'vue';
|
|
2
|
+
import { TableColumn, SortState, SortDirection, PaginationState } from './index';
|
|
3
|
+
export interface UseDataTableOptions<T> {
|
|
4
|
+
/** Initial data */
|
|
5
|
+
data?: T[] | Ref<T[]>;
|
|
6
|
+
/** Column definitions */
|
|
7
|
+
columns?: TableColumn<T>[] | Ref<TableColumn<T>[]>;
|
|
8
|
+
/** Function to get unique key from row */
|
|
9
|
+
rowKey?: keyof T | ((row: T, index: number) => string | number);
|
|
10
|
+
/** Initial sort state */
|
|
11
|
+
initialSort?: SortState;
|
|
12
|
+
/** Enable pagination */
|
|
13
|
+
pagination?: boolean | Partial<PaginationState>;
|
|
14
|
+
/** Enable selection */
|
|
15
|
+
selection?: boolean;
|
|
16
|
+
/** Enable multi-select */
|
|
17
|
+
multiSelect?: boolean;
|
|
18
|
+
/** Enable row expansion */
|
|
19
|
+
expandable?: boolean;
|
|
20
|
+
/** Async data loader */
|
|
21
|
+
loader?: (params: DataLoaderParams) => Promise<DataLoaderResult<T>>;
|
|
22
|
+
/** Debounce delay for async operations */
|
|
23
|
+
debounce?: number;
|
|
24
|
+
}
|
|
25
|
+
export interface DataLoaderParams {
|
|
26
|
+
page: number;
|
|
27
|
+
pageSize: number;
|
|
28
|
+
sort: SortState;
|
|
29
|
+
filters?: Record<string, unknown>;
|
|
30
|
+
}
|
|
31
|
+
export interface DataLoaderResult<T> {
|
|
32
|
+
data: T[];
|
|
33
|
+
total: number;
|
|
34
|
+
}
|
|
35
|
+
export interface UseDataTableReturn<T> {
|
|
36
|
+
data: Ref<T[]>;
|
|
37
|
+
processedData: ComputedRef<T[]>;
|
|
38
|
+
paginatedData: ComputedRef<T[]>;
|
|
39
|
+
columns: Ref<TableColumn<T>[]>;
|
|
40
|
+
visibleColumns: ComputedRef<TableColumn<T>[]>;
|
|
41
|
+
sortState: Ref<SortState>;
|
|
42
|
+
toggleSort: (columnKey: string) => void;
|
|
43
|
+
setSort: (columnKey: string, direction: SortDirection) => void;
|
|
44
|
+
clearSort: () => void;
|
|
45
|
+
selectedKeys: Ref<Set<string | number>>;
|
|
46
|
+
selectedRows: ComputedRef<T[]>;
|
|
47
|
+
toggleRowSelection: (key: string | number) => void;
|
|
48
|
+
selectRow: (key: string | number) => void;
|
|
49
|
+
deselectRow: (key: string | number) => void;
|
|
50
|
+
selectAll: () => void;
|
|
51
|
+
deselectAll: () => void;
|
|
52
|
+
toggleAllSelection: () => void;
|
|
53
|
+
isRowSelected: (key: string | number) => boolean;
|
|
54
|
+
isAllSelected: ComputedRef<boolean>;
|
|
55
|
+
isSomeSelected: ComputedRef<boolean>;
|
|
56
|
+
expandedKeys: Ref<Set<string | number>>;
|
|
57
|
+
toggleRowExpansion: (key: string | number) => void;
|
|
58
|
+
expandRow: (key: string | number) => void;
|
|
59
|
+
collapseRow: (key: string | number) => void;
|
|
60
|
+
expandAll: () => void;
|
|
61
|
+
collapseAll: () => void;
|
|
62
|
+
isRowExpanded: (key: string | number) => boolean;
|
|
63
|
+
pagination: Ref<PaginationState>;
|
|
64
|
+
totalPages: ComputedRef<number>;
|
|
65
|
+
goToPage: (page: number) => void;
|
|
66
|
+
nextPage: () => void;
|
|
67
|
+
prevPage: () => void;
|
|
68
|
+
setPageSize: (size: number) => void;
|
|
69
|
+
showColumn: (key: string) => void;
|
|
70
|
+
hideColumn: (key: string) => void;
|
|
71
|
+
toggleColumn: (key: string) => void;
|
|
72
|
+
setColumnVisibility: (key: string, visible: boolean) => void;
|
|
73
|
+
loading: Ref<boolean>;
|
|
74
|
+
error: Ref<Error | null>;
|
|
75
|
+
getRowKey: (row: T, index: number) => string | number;
|
|
76
|
+
refresh: () => Promise<void>;
|
|
77
|
+
setData: (newData: T[]) => void;
|
|
78
|
+
}
|
|
79
|
+
export declare function useDataTable<T extends Record<string, unknown>>(options?: UseDataTableOptions<T>): UseDataTableReturn<T>;
|
|
80
|
+
export default useDataTable;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
/** Unique tab identifier (required) */
|
|
3
|
+
name: string | number;
|
|
4
|
+
/** Tab label text (required) */
|
|
5
|
+
tab: string;
|
|
6
|
+
/** Optional MDI icon name (without mdi- prefix) */
|
|
7
|
+
icon?: string;
|
|
8
|
+
/** Disable this tab */
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
/** Override parent closable setting */
|
|
11
|
+
closable?: boolean;
|
|
12
|
+
/** Additional classes for this tab button */
|
|
13
|
+
tabClass?: string;
|
|
14
|
+
}
|
|
15
|
+
declare function __VLS_template(): {
|
|
16
|
+
attrs: Partial<{}>;
|
|
17
|
+
slots: {
|
|
18
|
+
default?(_: {}): any;
|
|
19
|
+
};
|
|
20
|
+
refs: {};
|
|
21
|
+
rootEl: any;
|
|
22
|
+
};
|
|
23
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
24
|
+
declare const __VLS_component: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
25
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
26
|
+
export default _default;
|
|
27
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
28
|
+
new (): {
|
|
29
|
+
$slots: S;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
value: string | number;
|
|
3
|
+
class?: string;
|
|
4
|
+
}
|
|
5
|
+
declare function __VLS_template(): {
|
|
6
|
+
attrs: Partial<{}>;
|
|
7
|
+
slots: {
|
|
8
|
+
default?(_: {}): any;
|
|
9
|
+
};
|
|
10
|
+
refs: {};
|
|
11
|
+
rootEl: any;
|
|
12
|
+
};
|
|
13
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
14
|
+
declare const __VLS_component: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
15
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
16
|
+
export default _default;
|
|
17
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
18
|
+
new (): {
|
|
19
|
+
$slots: S;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
color?: string;
|
|
3
|
+
class?: string;
|
|
4
|
+
}
|
|
5
|
+
declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
6
|
+
class: string;
|
|
7
|
+
color: string;
|
|
8
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLSpanElement>;
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
value: string | number;
|
|
3
|
+
disabled?: boolean;
|
|
4
|
+
class?: string;
|
|
5
|
+
}
|
|
6
|
+
declare function __VLS_template(): {
|
|
7
|
+
attrs: Partial<{}>;
|
|
8
|
+
slots: {
|
|
9
|
+
default?(_: {
|
|
10
|
+
active: boolean;
|
|
11
|
+
disabled: boolean;
|
|
12
|
+
}): any;
|
|
13
|
+
};
|
|
14
|
+
refs: {};
|
|
15
|
+
rootEl: any;
|
|
16
|
+
};
|
|
17
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
18
|
+
declare const __VLS_component: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
19
|
+
disabled: boolean;
|
|
20
|
+
class: string;
|
|
21
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
22
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
23
|
+
export default _default;
|
|
24
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
25
|
+
new (): {
|
|
26
|
+
$slots: S;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { default as STabs } from './STabs';
|
|
2
|
+
export { default as STabPane } from './STabPane';
|
|
3
|
+
export { default as STabsList } from './STabsList';
|
|
4
|
+
export { default as STabsTrigger } from './STabsTrigger';
|
|
5
|
+
export { default as STabsContent } from './STabsContent';
|
|
6
|
+
export { default as STabsIndicator } from './STabsIndicator';
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { ToastType } from '../../../composables/useToast';
|
|
2
|
+
export interface Props {
|
|
3
|
+
/** Unique toast ID */
|
|
4
|
+
id: string;
|
|
5
|
+
/** Toast type */
|
|
6
|
+
type: ToastType;
|
|
7
|
+
/** Toast title */
|
|
8
|
+
title?: string;
|
|
9
|
+
/** Toast description */
|
|
10
|
+
description?: string;
|
|
11
|
+
/** Duration in ms (for display purposes) */
|
|
12
|
+
duration?: number;
|
|
13
|
+
/** Show progress bar */
|
|
14
|
+
showProgress?: boolean;
|
|
15
|
+
/** Show close button */
|
|
16
|
+
closable?: boolean;
|
|
17
|
+
/** Icon name or false to hide */
|
|
18
|
+
icon?: string | boolean;
|
|
19
|
+
/** Custom color for custom type */
|
|
20
|
+
color?: string;
|
|
21
|
+
/** Progress percentage (0-100) */
|
|
22
|
+
progress?: number;
|
|
23
|
+
/** Whether toast is paused */
|
|
24
|
+
paused?: boolean;
|
|
25
|
+
/** Custom component to render */
|
|
26
|
+
component?: object;
|
|
27
|
+
/** Props for custom component */
|
|
28
|
+
componentProps?: Record<string, unknown>;
|
|
29
|
+
}
|
|
30
|
+
declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
31
|
+
click: () => any;
|
|
32
|
+
close: () => any;
|
|
33
|
+
}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
|
|
34
|
+
onClick?: (() => any) | undefined;
|
|
35
|
+
onClose?: (() => any) | undefined;
|
|
36
|
+
}>, {
|
|
37
|
+
closable: boolean;
|
|
38
|
+
icon: string | boolean;
|
|
39
|
+
progress: number;
|
|
40
|
+
title: string;
|
|
41
|
+
duration: number;
|
|
42
|
+
component: object;
|
|
43
|
+
color: string;
|
|
44
|
+
description: string;
|
|
45
|
+
showProgress: boolean;
|
|
46
|
+
paused: boolean;
|
|
47
|
+
componentProps: Record<string, unknown>;
|
|
48
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
49
|
+
export default _default;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ToastPosition } from '../../../composables/useToast';
|
|
2
|
+
export interface Props {
|
|
3
|
+
/** Position to render toasts (defaults to global config) */
|
|
4
|
+
position?: ToastPosition;
|
|
5
|
+
/** Maximum toasts to show (defaults to global config) */
|
|
6
|
+
maxToasts?: number;
|
|
7
|
+
/** Gap between toasts in px */
|
|
8
|
+
gap?: number;
|
|
9
|
+
/** Teleport target */
|
|
10
|
+
teleport?: boolean | string;
|
|
11
|
+
/** Z-index for the container */
|
|
12
|
+
zIndex?: number;
|
|
13
|
+
}
|
|
14
|
+
declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
15
|
+
position: ToastPosition;
|
|
16
|
+
zIndex: number;
|
|
17
|
+
teleport: boolean | string;
|
|
18
|
+
gap: number;
|
|
19
|
+
maxToasts: number;
|
|
20
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
21
|
+
export default _default;
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { Ref, DeepReadonly } from 'vue';
|
|
2
|
+
export interface UseAsyncOptions<T> {
|
|
3
|
+
/** Execute immediately on mount */
|
|
4
|
+
immediate?: boolean;
|
|
5
|
+
/** Number of retry attempts on failure */
|
|
6
|
+
retry?: number;
|
|
7
|
+
/** Delay between retry attempts in ms */
|
|
8
|
+
retryDelay?: number;
|
|
9
|
+
/** Cache the result and prevent duplicate requests */
|
|
10
|
+
cache?: boolean;
|
|
11
|
+
/** Callback when the async operation succeeds */
|
|
12
|
+
onSuccess?: (data: T) => void;
|
|
13
|
+
/** Callback when the async operation fails */
|
|
14
|
+
onError?: (error: Error) => void;
|
|
15
|
+
/** Callback when the async operation finishes (success or error) */
|
|
16
|
+
onFinally?: () => void;
|
|
17
|
+
/** Reset error state before each execution */
|
|
18
|
+
resetOnExecute?: boolean;
|
|
19
|
+
/** Throw error instead of catching it */
|
|
20
|
+
throwOnError?: boolean;
|
|
21
|
+
}
|
|
22
|
+
export interface UseAsyncReturn<T, P extends any[]> {
|
|
23
|
+
/** The result data */
|
|
24
|
+
data: DeepReadonly<Ref<T | null>>;
|
|
25
|
+
/** Whether the async operation is in progress */
|
|
26
|
+
loading: DeepReadonly<Ref<boolean>>;
|
|
27
|
+
/** Error from the last failed operation */
|
|
28
|
+
error: DeepReadonly<Ref<Error | null>>;
|
|
29
|
+
/** Whether the operation has been executed at least once */
|
|
30
|
+
isFinished: DeepReadonly<Ref<boolean>>;
|
|
31
|
+
/** Whether the last execution was successful */
|
|
32
|
+
isSuccess: DeepReadonly<Ref<boolean>>;
|
|
33
|
+
/** Execute the async function */
|
|
34
|
+
execute: (...args: P) => Promise<T | null>;
|
|
35
|
+
/** Retry the last execution */
|
|
36
|
+
retry: () => Promise<T | null>;
|
|
37
|
+
/** Reset the state */
|
|
38
|
+
reset: () => void;
|
|
39
|
+
/** Abort the current execution */
|
|
40
|
+
abort: () => void;
|
|
41
|
+
/** Whether the operation is currently aborted */
|
|
42
|
+
isAborted: DeepReadonly<Ref<boolean>>;
|
|
43
|
+
}
|
|
44
|
+
export type AsyncFn<T, P extends any[]> = (...args: P) => Promise<T>;
|
|
45
|
+
/**
|
|
46
|
+
* Clear the async cache
|
|
47
|
+
*/
|
|
48
|
+
export declare function clearAsyncCache(): void;
|
|
49
|
+
/**
|
|
50
|
+
* Handle async operations with automatic loading/error state management.
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* // Basic usage
|
|
54
|
+
* const { data, loading, error, execute } = useAsync(async () => {
|
|
55
|
+
* const response = await fetch('/api/users')
|
|
56
|
+
* return response.json()
|
|
57
|
+
* })
|
|
58
|
+
*
|
|
59
|
+
* // Execute on button click
|
|
60
|
+
* <button @click="execute" :disabled="loading">
|
|
61
|
+
* {{ loading ? 'Loading...' : 'Fetch Users' }}
|
|
62
|
+
* </button>
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* // With immediate execution
|
|
66
|
+
* const { data, loading } = useAsync(fetchUsers, {
|
|
67
|
+
* immediate: true,
|
|
68
|
+
* onSuccess: (users) => console.log('Loaded', users.length, 'users')
|
|
69
|
+
* })
|
|
70
|
+
*
|
|
71
|
+
* @example
|
|
72
|
+
* // With retry logic
|
|
73
|
+
* const { data, execute, retry, error } = useAsync(
|
|
74
|
+
* async (id: string) => fetchUser(id),
|
|
75
|
+
* {
|
|
76
|
+
* retry: 3,
|
|
77
|
+
* retryDelay: 1000,
|
|
78
|
+
* onError: (err) => console.error('Failed after 3 retries:', err)
|
|
79
|
+
* }
|
|
80
|
+
* )
|
|
81
|
+
*
|
|
82
|
+
* // Retry the last call
|
|
83
|
+
* <button v-if="error" @click="retry">Retry</button>
|
|
84
|
+
*
|
|
85
|
+
* @example
|
|
86
|
+
* // With abort controller
|
|
87
|
+
* const { data, execute, abort, isAborted } = useAsync(
|
|
88
|
+
* async (signal: AbortSignal) => {
|
|
89
|
+
* const response = await fetch('/api/data', { signal })
|
|
90
|
+
* return response.json()
|
|
91
|
+
* }
|
|
92
|
+
* )
|
|
93
|
+
*
|
|
94
|
+
* // Cancel ongoing request
|
|
95
|
+
* <button @click="abort">Cancel</button>
|
|
96
|
+
*
|
|
97
|
+
* @example
|
|
98
|
+
* // With caching
|
|
99
|
+
* const { data, execute } = useAsync(fetchData, { cache: true })
|
|
100
|
+
*
|
|
101
|
+
* // Second call returns cached result
|
|
102
|
+
* await execute('same-args')
|
|
103
|
+
* await execute('same-args') // Uses cache
|
|
104
|
+
*/
|
|
105
|
+
export declare function useAsync<T, P extends any[] = []>(asyncFn: AsyncFn<T, P>, options?: UseAsyncOptions<T>): UseAsyncReturn<T, P>;
|
|
106
|
+
/**
|
|
107
|
+
* Create a lazy async composable that only executes when called.
|
|
108
|
+
* This is an alias for useAsync with immediate: false.
|
|
109
|
+
*
|
|
110
|
+
* @example
|
|
111
|
+
* const { data, execute, loading } = useLazyAsync(fetchUser)
|
|
112
|
+
*
|
|
113
|
+
* // Execute with parameters
|
|
114
|
+
* const user = await execute(userId)
|
|
115
|
+
*/
|
|
116
|
+
export declare function useLazyAsync<T, P extends any[] = []>(asyncFn: AsyncFn<T, P>, options?: Omit<UseAsyncOptions<T>, 'immediate'>): UseAsyncReturn<T, P>;
|
|
117
|
+
/**
|
|
118
|
+
* Execute an async function with loading state management.
|
|
119
|
+
* Returns a promise that resolves to the result.
|
|
120
|
+
*
|
|
121
|
+
* @example
|
|
122
|
+
* const { loading, run } = useAsyncState()
|
|
123
|
+
*
|
|
124
|
+
* const result = await run(async () => {
|
|
125
|
+
* const response = await fetch('/api/data')
|
|
126
|
+
* return response.json()
|
|
127
|
+
* })
|
|
128
|
+
*/
|
|
129
|
+
export declare function useAsyncState(): {
|
|
130
|
+
loading: Readonly<Ref<boolean, boolean>>;
|
|
131
|
+
error: Readonly<Ref<Error | null, Error | null>>;
|
|
132
|
+
run: <T>(fn: () => Promise<T>) => Promise<T | null>;
|
|
133
|
+
};
|
|
134
|
+
export default useAsync;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { MaybeRef } from 'vue';
|
|
2
|
+
export type MaybeElementRef = MaybeRef<HTMLElement | null | undefined>;
|
|
3
|
+
export interface ClickOutsideOptions {
|
|
4
|
+
/** Elements to exclude from triggering the callback */
|
|
5
|
+
exclude?: MaybeElementRef[];
|
|
6
|
+
/** Whether to trigger callback on Escape key press */
|
|
7
|
+
triggerOnEscape?: boolean;
|
|
8
|
+
/** Whether the handler is active */
|
|
9
|
+
enabled?: MaybeRef<boolean>;
|
|
10
|
+
/** Event to listen for */
|
|
11
|
+
event?: 'click' | 'mousedown' | 'mouseup' | 'pointerdown' | 'pointerup';
|
|
12
|
+
/** Whether to use capture phase */
|
|
13
|
+
capture?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export type ClickOutsideHandler = (event: MouseEvent | KeyboardEvent) => void;
|
|
16
|
+
export interface UseClickOutsideReturn {
|
|
17
|
+
/** Stop listening for click outside events */
|
|
18
|
+
stop: () => void;
|
|
19
|
+
/** Start listening for click outside events */
|
|
20
|
+
start: () => void;
|
|
21
|
+
/** Whether the listener is currently active */
|
|
22
|
+
isActive: boolean;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Detect clicks outside an element
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* // Basic usage
|
|
29
|
+
* const targetRef = ref<HTMLElement>()
|
|
30
|
+
*
|
|
31
|
+
* useClickOutside(targetRef, () => {
|
|
32
|
+
* console.log('Clicked outside!')
|
|
33
|
+
* })
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* // With options
|
|
37
|
+
* const dropdownRef = ref<HTMLElement>()
|
|
38
|
+
* const buttonRef = ref<HTMLElement>()
|
|
39
|
+
*
|
|
40
|
+
* useClickOutside(dropdownRef, () => {
|
|
41
|
+
* closeDropdown()
|
|
42
|
+
* }, {
|
|
43
|
+
* exclude: [buttonRef],
|
|
44
|
+
* triggerOnEscape: true
|
|
45
|
+
* })
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* // Multiple targets
|
|
49
|
+
* const refs = [ref<HTMLElement>(), ref<HTMLElement>()]
|
|
50
|
+
*
|
|
51
|
+
* useClickOutside(refs, () => {
|
|
52
|
+
* closeAll()
|
|
53
|
+
* })
|
|
54
|
+
*/
|
|
55
|
+
export declare function useClickOutside(target: MaybeElementRef | MaybeElementRef[], handler: ClickOutsideHandler, options?: ClickOutsideOptions): UseClickOutsideReturn;
|
|
56
|
+
/**
|
|
57
|
+
* Directive-style helper for click outside
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* const { onClickOutside } = createClickOutsideHandler(() => {
|
|
61
|
+
* isOpen.value = false
|
|
62
|
+
* })
|
|
63
|
+
*
|
|
64
|
+
* // Use in template: @clickoutside="onClickOutside"
|
|
65
|
+
*/
|
|
66
|
+
export declare function createClickOutsideHandler(handler: ClickOutsideHandler): {
|
|
67
|
+
onClickOutside: ClickOutsideHandler;
|
|
68
|
+
};
|
|
69
|
+
export default useClickOutside;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export interface CopyOptions {
|
|
2
|
+
/** Show toast notification on copy */
|
|
3
|
+
showToast?: boolean;
|
|
4
|
+
/** Custom success message for toast */
|
|
5
|
+
successMessage?: string;
|
|
6
|
+
/** Custom error message for toast */
|
|
7
|
+
errorMessage?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface ClipboardState {
|
|
10
|
+
/** Whether the last copy was successful */
|
|
11
|
+
copied: boolean;
|
|
12
|
+
/** The last copied text */
|
|
13
|
+
text: string | null;
|
|
14
|
+
/** Any error from the last operation */
|
|
15
|
+
error: Error | null;
|
|
16
|
+
}
|
|
17
|
+
export interface UseClipboardReturn {
|
|
18
|
+
/** Copy text to clipboard */
|
|
19
|
+
copy: (text: string, options?: CopyOptions) => Promise<boolean>;
|
|
20
|
+
/** Copy text content from an element */
|
|
21
|
+
copyFromElement: (element: HTMLElement | null, options?: CopyOptions) => Promise<boolean>;
|
|
22
|
+
/** Whether the Clipboard API is supported */
|
|
23
|
+
isSupported: boolean;
|
|
24
|
+
/** Last copied state */
|
|
25
|
+
state: ClipboardState;
|
|
26
|
+
/** Reset the state */
|
|
27
|
+
reset: () => void;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Clipboard composable for copying text
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* const clipboard = useClipboard()
|
|
34
|
+
*
|
|
35
|
+
* // Basic usage
|
|
36
|
+
* await clipboard.copy('Hello, World!')
|
|
37
|
+
*
|
|
38
|
+
* // With toast notification
|
|
39
|
+
* await clipboard.copy('Hello, World!', { showToast: true })
|
|
40
|
+
*
|
|
41
|
+
* // Copy from element
|
|
42
|
+
* const elementRef = ref<HTMLElement>()
|
|
43
|
+
* await clipboard.copyFromElement(elementRef.value)
|
|
44
|
+
*/
|
|
45
|
+
export declare function useClipboard(): UseClipboardReturn;
|
|
46
|
+
export default useClipboard;
|