dxd-style-code 0.1.7 → 0.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dxd-style-code.js +11974 -3725
- package/dist/dxd-style-code.umd.cjs +10 -1
- package/dist/style.css +1 -1
- package/package.json +13 -6
- package/src/components/atoms/DXAvatar/DXAvatar.stories.js +319 -0
- package/src/components/atoms/DXAvatar/DXAvatar.vue +167 -0
- package/src/components/atoms/DXAvatar/index.js +2 -0
- package/src/components/atoms/DXBackdrop/DXBackdrop.stories.js +341 -0
- package/src/components/atoms/DXBackdrop/DXBackdrop.vue +102 -0
- package/src/components/atoms/DXBackdrop/index.js +2 -0
- package/src/components/atoms/DXBadge/DXBadge.stories.js +239 -0
- package/src/components/atoms/DXBadge/DXBadge.vue +45 -0
- package/src/components/atoms/DXBadge/index.js +2 -0
- package/src/components/atoms/DXButton/DXButton.stories.js +178 -0
- package/src/components/atoms/DXButton/DXButton.vue +84 -0
- package/src/components/atoms/DXButton/index.js +2 -0
- package/src/components/atoms/DXCard/DXCard.stories.js +133 -0
- package/src/components/atoms/DXCard/DXCard.vue +46 -0
- package/src/components/atoms/DXCard/index.js +2 -0
- package/src/components/atoms/DXCheckbox/DXCheckbox.stories.js +294 -0
- package/src/components/atoms/DXCheckbox/DXCheckbox.vue +191 -0
- package/src/components/atoms/DXCheckbox/index.js +2 -0
- package/src/components/atoms/DXDivider/DXDivider.stories.js +135 -0
- package/src/components/atoms/DXDivider/DXDivider.vue +74 -0
- package/src/components/atoms/DXDivider/index.js +2 -0
- package/src/components/atoms/DXDropdownItem/DXDropdownItem.vue +116 -0
- package/src/components/atoms/DXDropdownItem/index.js +2 -0
- package/src/components/atoms/DXFormLabel/DXFormLabel.stories.js +194 -0
- package/src/components/atoms/DXFormLabel/DXFormLabel.vue +94 -0
- package/src/components/atoms/DXFormLabel/index.js +2 -0
- package/src/components/atoms/DXIcon/DXIcon.stories.js +156 -0
- package/src/components/atoms/DXIcon/DXIcon.vue +102 -0
- package/src/components/atoms/DXIcon/index.js +3 -0
- package/src/components/atoms/DXIconWrapper/DXIconWrapper.stories.js +237 -0
- package/src/components/atoms/DXIconWrapper/DXIconWrapper.vue +79 -0
- package/src/components/atoms/DXIconWrapper/index.js +2 -0
- package/src/components/atoms/DXInputAddon/DXInputAddon.stories.js +230 -0
- package/src/components/atoms/DXInputAddon/DXInputAddon.vue +64 -0
- package/src/components/atoms/DXInputAddon/index.js +2 -0
- package/src/components/atoms/DXLink/DXLink.stories.js +475 -0
- package/src/components/atoms/DXLink/DXLink.vue +229 -0
- package/src/components/atoms/DXLink/index.js +2 -0
- package/src/components/atoms/DXLoader/DXLoader.stories.js +280 -0
- package/src/components/atoms/DXLoader/DXLoader.vue +78 -0
- package/src/components/atoms/DXLoader/index.js +2 -0
- package/src/components/atoms/DXProgress/DXProgress.stories.js +312 -0
- package/src/components/atoms/DXProgress/DXProgress.vue +85 -0
- package/src/components/atoms/DXProgress/index.js +2 -0
- package/src/components/atoms/DXQuote/DXQuote.stories.js +255 -0
- package/src/components/atoms/DXQuote/DXQuote.vue +97 -0
- package/src/components/atoms/DXQuote/index.js +2 -0
- package/src/components/atoms/DXRadio/DXRadio.stories.js +277 -0
- package/src/components/atoms/DXRadio/DXRadio.vue +144 -0
- package/src/components/atoms/DXRadio/index.js +2 -0
- package/src/components/atoms/DXSkeleton/DXSkeleton.stories.js +50 -0
- package/src/components/atoms/DXSkeleton/DXSkeleton.vue +19 -0
- package/src/components/atoms/DXSkeleton/index.js +2 -0
- package/src/components/atoms/DXSlider/DXSlider.stories.js +522 -0
- package/src/components/atoms/DXSlider/DXSlider.vue +338 -0
- package/src/components/atoms/DXSlider/index.js +2 -0
- package/src/components/atoms/DXTags/DXTags.stories.js +206 -0
- package/src/components/atoms/DXTags/DXTags.vue +111 -0
- package/src/components/atoms/DXTags/index.js +2 -0
- package/src/components/atoms/DXToast/DXToast.stories.js +40 -0
- package/src/components/atoms/DXToast/DXToast.vue +32 -0
- package/src/components/atoms/DXToast/index.js +2 -0
- package/src/components/atoms/DXToggle/DXToggle.stories.js +143 -0
- package/src/components/atoms/DXToggle/DXToggle.vue +142 -0
- package/src/components/atoms/DXToggle/index.js +2 -0
- package/src/components/atoms/DXToggleButton/DXToggleButton.stories.js +513 -0
- package/src/components/atoms/DXToggleButton/DXToggleButton.vue +140 -0
- package/src/components/atoms/DXToggleButton/index.js +2 -0
- package/src/components/atoms/DXTooltip/DXTooltip.stories.js +243 -0
- package/src/components/atoms/DXTooltip/DXTooltip.vue +151 -0
- package/src/components/atoms/DXTooltip/index.js +2 -0
- package/src/components/atoms/index.js +24 -0
- package/src/components/layout/DXBox/DXBox.stories.js +238 -0
- package/src/components/layout/DXBox/DXBox.vue +198 -0
- package/src/components/layout/DXBox/index.js +2 -0
- package/src/components/layout/DXContainer/DXContainer.stories.js +147 -0
- package/src/components/layout/DXContainer/DXContainer.vue +83 -0
- package/src/components/layout/DXContainer/index.js +2 -0
- package/src/components/layout/DXFlex/DXFlex.stories.js +210 -0
- package/src/components/layout/DXFlex/DXFlex.vue +149 -0
- package/src/components/layout/DXFlex/index.js +2 -0
- package/src/components/layout/DXGrid/DXGrid.stories.js +238 -0
- package/src/components/layout/DXGrid/DXGrid.vue +167 -0
- package/src/components/layout/DXGrid/index.js +2 -0
- package/src/components/layout/DXSpacer/DXSpacer.stories.js +187 -0
- package/src/components/layout/DXSpacer/DXSpacer.vue +102 -0
- package/src/components/layout/DXSpacer/index.js +2 -0
- package/src/components/layout/DXStack/DXStack.stories.js +199 -0
- package/src/components/layout/DXStack/DXStack.vue +140 -0
- package/src/components/layout/DXStack/index.js +2 -0
- package/src/components/layout/index.js +8 -0
- package/src/components/molecules/DXActionButtons/DXActionButtons.stories.js +288 -0
- package/src/components/molecules/DXActionButtons/DXActionButtons.vue +106 -0
- package/src/components/molecules/DXActionButtons/index.js +2 -0
- package/src/components/molecules/DXAlert/DXAlert.stories.js +70 -0
- package/src/components/molecules/DXAlert/DXAlert.vue +116 -0
- package/src/components/molecules/DXAlert/index.js +2 -0
- package/src/components/molecules/DXBaseTable/DXBaseTable.stories.js +433 -0
- package/src/components/molecules/DXBaseTable/DXBaseTable.vue +459 -0
- package/src/components/molecules/DXBaseTable/index.js +4 -0
- package/src/components/molecules/DXBreadcrumb/DXBreadcrumb.stories.js +227 -0
- package/src/components/molecules/DXBreadcrumb/DXBreadcrumb.vue +96 -0
- package/src/components/molecules/DXBreadcrumb/index.js +2 -0
- package/src/components/molecules/DXButtonGroup/DXButtonGroup.stories.js +26 -0
- package/src/components/molecules/DXButtonGroup/DXButtonGroup.vue +78 -0
- package/src/components/molecules/DXButtonGroup/index.js +2 -0
- package/src/components/molecules/DXCloseButton/DXCloseButton.stories.js +53 -0
- package/src/components/molecules/DXCloseButton/DXCloseButton.vue +62 -0
- package/src/components/molecules/DXCloseButton/index.js +3 -0
- package/src/components/molecules/DXComboBox/DXComboBox.stories.js +62 -0
- package/src/components/molecules/DXComboBox/DXComboBox.vue +167 -0
- package/src/components/molecules/DXComboBox/index.js +2 -0
- package/src/components/molecules/DXCopyField/DXCopyField.stories.js +231 -0
- package/src/components/molecules/DXCopyField/DXCopyField.vue +75 -0
- package/src/components/molecules/DXCopyField/index.js +2 -0
- package/src/components/molecules/DXDataFilter/DXDataFilter.stories.js +275 -0
- package/src/components/molecules/DXDataFilter/DXDataFilter.vue +385 -0
- package/src/components/molecules/DXDataFilter/index.js +2 -0
- package/src/components/molecules/DXDatePicker/DXDatePicker.stories.js +42 -0
- package/src/components/molecules/DXDatePicker/DXDatePicker.vue +121 -0
- package/src/components/molecules/DXDatePicker/index.js +2 -0
- package/src/components/molecules/DXDropdownDivider/DXDropdownDivider.vue +30 -0
- package/src/components/molecules/DXDropdownDivider/index.js +2 -0
- package/src/components/molecules/DXFileUpload/DXFileUpload.stories.js +53 -0
- package/src/components/molecules/DXFileUpload/DXFileUpload.vue +199 -0
- package/src/components/molecules/DXFileUpload/index.js +2 -0
- package/src/components/molecules/DXFilterGroup/DXFilterGroup.stories.js +43 -0
- package/src/components/molecules/DXFilterGroup/DXFilterGroup.vue +43 -0
- package/src/components/molecules/DXFilterGroup/index.js +2 -0
- package/src/components/molecules/DXFormControl/DXFormControl.stories.js +69 -0
- package/src/components/molecules/DXFormControl/DXFormControl.vue +72 -0
- package/src/components/molecules/DXFormControl/index.js +2 -0
- package/src/components/molecules/DXInput/DXInput.stories.js +291 -0
- package/src/components/molecules/DXInput/DXInput.vue +156 -0
- package/src/components/molecules/DXInput/index.js +3 -0
- package/src/components/molecules/DXInputGroup/DXInputGroup.stories.js +228 -0
- package/src/components/molecules/DXInputGroup/DXInputGroup.vue +64 -0
- package/src/components/molecules/DXInputGroup/index.js +2 -0
- package/src/components/molecules/DXInputMask/DXInputMask.stories.js +53 -0
- package/src/components/molecules/DXInputMask/DXInputMask.vue +89 -0
- package/src/components/molecules/DXInputMask/index.js +2 -0
- package/src/components/molecules/DXMenu/DXMenu.stories.js +379 -0
- package/src/components/molecules/DXMenu/DXMenu.vue +331 -0
- package/src/components/molecules/DXMenu/README.md +479 -0
- package/src/components/molecules/DXMenu/index.js +2 -0
- package/src/components/molecules/DXPagination/DXPagination.stories.js +62 -0
- package/src/components/molecules/DXPagination/DXPagination.vue +123 -0
- package/src/components/molecules/DXPagination/index.js +2 -0
- package/src/components/molecules/DXPasswordInput/DXPasswordInput.stories.js +42 -0
- package/src/components/molecules/DXPasswordInput/DXPasswordInput.vue +74 -0
- package/src/components/molecules/DXPasswordInput/index.js +2 -0
- package/src/components/molecules/DXRadioCard/DXRadioCard.stories.js +60 -0
- package/src/components/molecules/DXRadioCard/DXRadioCard.vue +71 -0
- package/src/components/molecules/DXRadioCard/index.js +2 -0
- package/src/components/molecules/DXRadioGroup/DXRadioGroup.stories.js +297 -0
- package/src/components/molecules/DXRadioGroup/DXRadioGroup.vue +73 -0
- package/src/components/molecules/DXRadioGroup/index.js +2 -0
- package/src/components/molecules/DXRating/DXRating.stories.js +322 -0
- package/src/components/molecules/DXRating/DXRating.vue +402 -0
- package/src/components/molecules/DXRating/index.js +2 -0
- package/src/components/molecules/DXSearchBar/DXSearchBar.stories.js +357 -0
- package/src/components/molecules/DXSearchBar/DXSearchBar.vue +525 -0
- package/src/components/molecules/DXSearchBar/index.js +2 -0
- package/src/components/molecules/DXSearchSelect/DXSearchSelect.stories.js +50 -0
- package/src/components/molecules/DXSearchSelect/DXSearchSelect.vue +207 -0
- package/src/components/molecules/DXSearchSelect/index.js +2 -0
- package/src/components/molecules/DXSegmentedControl/DXSegmentedControl.stories.js +326 -0
- package/src/components/molecules/DXSegmentedControl/DXSegmentedControl.vue +116 -0
- package/src/components/molecules/DXSegmentedControl/index.js +2 -0
- package/src/components/molecules/DXSelect/DXSelect.stories.js +259 -0
- package/src/components/molecules/DXSelect/DXSelect.vue +149 -0
- package/src/components/molecules/DXSelect/index.js +3 -0
- package/src/components/molecules/DXStatCard/DXStatCard.stories.js +335 -0
- package/src/components/molecules/DXStatCard/DXStatCard.vue +309 -0
- package/src/components/molecules/DXStatCard/index.js +2 -0
- package/src/components/molecules/DXTableFiltersPanel/DXTableFiltersPanel.vue +72 -0
- package/src/components/molecules/DXTableFiltersPanel/index.js +7 -0
- package/src/components/molecules/DXTablePagination/DXTablePagination.stories.js +236 -0
- package/src/components/molecules/DXTablePagination/DXTablePagination.vue +93 -0
- package/src/components/molecules/DXTablePagination/index.js +2 -0
- package/src/components/molecules/DXTableToolbar/DXTableToolbar.stories.js +271 -0
- package/src/components/molecules/DXTableToolbar/DXTableToolbar.vue +102 -0
- package/src/components/molecules/DXTableToolbar/index.js +2 -0
- package/src/components/molecules/DXTextarea/DXTextarea.stories.js +239 -0
- package/src/components/molecules/DXTextarea/DXTextarea.vue +158 -0
- package/src/components/molecules/DXTextarea/index.js +3 -0
- package/src/components/molecules/DXTimePicker/DXTimePicker.stories.js +282 -0
- package/src/components/molecules/DXTimePicker/DXTimePicker.vue +640 -0
- package/src/components/molecules/DXTimePicker/index.js +2 -0
- package/src/components/molecules/DXValidationIcon/DXValidationIcon.stories.js +60 -0
- package/src/components/molecules/DXValidationIcon/DXValidationIcon.vue +53 -0
- package/src/components/molecules/DXValidationIcon/index.js +3 -0
- package/src/components/molecules/index.js +34 -0
- package/src/components/organisms/DXAccordion/DXAccordion.stories.js +33 -0
- package/src/components/organisms/DXAccordion/DXAccordion.vue +104 -0
- package/src/components/organisms/DXAccordion/index.js +2 -0
- package/src/components/organisms/DXAppLayout/DXAppLayout.stories.js +689 -0
- package/src/components/organisms/DXAppLayout/DXAppLayout.vue +460 -0
- package/src/components/organisms/DXAppLayout/index.js +2 -0
- package/src/components/organisms/DXAuthenticationForm/DXAuthenticationForm.stories.js +232 -0
- package/src/components/organisms/DXAuthenticationForm/DXAuthenticationForm.vue +458 -0
- package/src/components/organisms/DXAuthenticationForm/index.js +2 -0
- package/src/components/organisms/DXChartContainer/DXChartContainer.stories.js +286 -0
- package/src/components/organisms/DXChartContainer/DXChartContainer.vue +273 -0
- package/src/components/organisms/DXChartContainer/index.js +2 -0
- package/src/components/organisms/DXChatInterface/DXChatInterface.stories.js +164 -0
- package/src/components/organisms/DXChatInterface/DXChatInterface.vue +583 -0
- package/src/components/organisms/DXChatInterface/index.js +2 -0
- package/src/components/organisms/DXCommentSection/DXCommentSection.stories.js +173 -0
- package/src/components/organisms/DXCommentSection/DXCommentSection.vue +487 -0
- package/src/components/organisms/DXCommentSection/index.js +2 -0
- package/src/components/organisms/DXDashboardGrid/DXDashboardGrid.stories.js +331 -0
- package/src/components/organisms/DXDashboardGrid/DXDashboardGrid.vue +309 -0
- package/src/components/organisms/DXDashboardGrid/index.js +2 -0
- package/src/components/organisms/DXDashboardWidget/DXDashboardWidget.stories.js +271 -0
- package/src/components/organisms/DXDashboardWidget/DXDashboardWidget.vue +260 -0
- package/src/components/organisms/DXDashboardWidget/index.js +2 -0
- package/src/components/organisms/DXDataTable/DXDataTable.stories.js +247 -0
- package/src/components/organisms/DXDataTable/DXDataTable.vue +496 -0
- package/src/components/organisms/DXDataTable/index.js +2 -0
- package/src/components/organisms/DXDropdown/DXDropdown.stories.js +795 -0
- package/src/components/organisms/DXDropdown/DXDropdown.vue +238 -0
- package/src/components/organisms/DXDropdown/index.js +2 -0
- package/src/components/organisms/DXEmptyState/DXEmptyState.stories.js +37 -0
- package/src/components/organisms/DXEmptyState/DXEmptyState.vue +41 -0
- package/src/components/organisms/DXEmptyState/index.js +2 -0
- package/src/components/organisms/DXFormWizard/DXFormWizard.stories.js +378 -0
- package/src/components/organisms/DXFormWizard/DXFormWizard.vue +578 -0
- package/src/components/organisms/DXFormWizard/index.js +2 -0
- package/src/components/organisms/DXHeaderBar/DXHeaderBar.stories.js +448 -0
- package/src/components/organisms/DXHeaderBar/DXHeaderBar.vue +190 -0
- package/src/components/organisms/DXHeaderBar/index.js +2 -0
- package/src/components/organisms/DXMediaGallery/DXMediaGallery.stories.js +347 -0
- package/src/components/organisms/DXMediaGallery/DXMediaGallery.vue +422 -0
- package/src/components/organisms/DXMediaGallery/index.js +2 -0
- package/src/components/organisms/DXModal/DXModal.stories.js +138 -0
- package/src/components/organisms/DXModal/DXModal.vue +213 -0
- package/src/components/organisms/DXModal/index.js +2 -0
- package/src/components/organisms/DXNotificationCenter/DXNotificationCenter.stories.js +183 -0
- package/src/components/organisms/DXNotificationCenter/DXNotificationCenter.vue +566 -0
- package/src/components/organisms/DXNotificationCenter/index.js +2 -0
- package/src/components/organisms/DXReportGenerator/DXReportGenerator.stories.js +199 -0
- package/src/components/organisms/DXReportGenerator/DXReportGenerator.vue +344 -0
- package/src/components/organisms/DXReportGenerator/index.js +2 -0
- package/src/components/organisms/DXSettingsPanel/DXSettingsPanel.stories.js +245 -0
- package/src/components/organisms/DXSettingsPanel/DXSettingsPanel.vue +454 -0
- package/src/components/organisms/DXSettingsPanel/index.js +2 -0
- package/src/components/organisms/DXSidebar/DXSidebar.stories.js +316 -0
- package/src/components/organisms/DXSidebar/DXSidebar.vue +212 -0
- package/src/components/organisms/DXSidebar/index.js +2 -0
- package/src/components/organisms/DXSidebarMenu/DATA_STRUCTURE.md +299 -0
- package/src/components/organisms/DXSidebarMenu/DXSidebarMenu.stories.js +729 -0
- package/src/components/organisms/DXSidebarMenu/DXSidebarMenu.vue +257 -0
- package/src/components/organisms/DXSidebarMenu/DXSidebarMenuItem.vue +249 -0
- package/src/components/organisms/DXSidebarMenu/README.md +333 -0
- package/src/components/organisms/DXSidebarMenu/index.js +3 -0
- package/src/components/organisms/DXTable/DXTable.stories.js +550 -0
- package/src/components/organisms/DXTable/DXTable.vue +324 -0
- package/src/components/organisms/DXTable/index.js +2 -0
- package/src/components/organisms/DXTabs/DXTabs.stories.js +407 -0
- package/src/components/organisms/DXTabs/DXTabs.vue +301 -0
- package/src/components/organisms/DXTabs/index.js +2 -0
- package/src/components/organisms/DXUserProfileCard/DXUserProfileCard.stories.js +194 -0
- package/src/components/organisms/DXUserProfileCard/DXUserProfileCard.vue +403 -0
- package/src/components/organisms/DXUserProfileCard/index.js +2 -0
- package/src/components/organisms/DXWizard/DXWizard.stories.js +212 -0
- package/src/components/organisms/DXWizard/DXWizard.vue +615 -0
- package/src/components/organisms/DXWizard/index.js +2 -0
- package/src/components/organisms/index.js +25 -0
- package/src/components/typography/DXBlockquote/DXBlockquote.stories.js +33 -0
- package/src/components/typography/DXBlockquote/DXBlockquote.vue +44 -0
- package/src/components/typography/DXBlockquote/index.js +2 -0
- package/src/components/typography/DXCode/DXCode.stories.js +29 -0
- package/src/components/typography/DXCode/DXCode.vue +46 -0
- package/src/components/typography/DXCode/index.js +2 -0
- package/src/components/typography/DXHeading/DXHeading.stories.js +54 -0
- package/src/components/typography/DXHeading/DXHeading.vue +68 -0
- package/src/components/typography/DXHeading/index.js +2 -0
- package/src/components/typography/DXLabel/DXLabel.stories.js +40 -0
- package/src/components/typography/DXLabel/DXLabel.vue +49 -0
- package/src/components/typography/DXLabel/index.js +2 -0
- package/src/components/typography/DXList/DXList.stories.js +50 -0
- package/src/components/typography/DXList/DXList.vue +55 -0
- package/src/components/typography/DXList/index.js +2 -0
- package/src/components/typography/DXText/DXText.stories.js +47 -0
- package/src/components/typography/DXText/DXText.vue +67 -0
- package/src/components/typography/DXText/index.js +2 -0
- package/src/components/typography/index.js +8 -0
- package/src/components/utilities/DXAnimatePresence/DXAnimatePresence.stories.js +335 -0
- package/src/components/utilities/DXAnimatePresence/DXAnimatePresence.vue +207 -0
- package/src/components/utilities/DXAnimatePresence/index.js +2 -0
- package/src/components/utilities/DXBreakpointProvider/DXBreakpointProvider.stories.js +321 -0
- package/src/components/utilities/DXBreakpointProvider/DXBreakpointProvider.vue +158 -0
- package/src/components/utilities/DXBreakpointProvider/index.js +2 -0
- package/src/components/utilities/DXObserver/DXObserver.stories.js +324 -0
- package/src/components/utilities/DXObserver/DXObserver.vue +182 -0
- package/src/components/utilities/DXObserver/index.js +2 -0
- package/src/components/utilities/DXPortal/DXPortal.stories.js +267 -0
- package/src/components/utilities/DXPortal/DXPortal.vue +69 -0
- package/src/components/utilities/DXPortal/index.js +2 -0
- package/src/components/utilities/DXStaggeredAnimation/DXStaggeredAnimation.stories.js +339 -0
- package/src/components/utilities/DXStaggeredAnimation/DXStaggeredAnimation.vue +155 -0
- package/src/components/utilities/DXStaggeredAnimation/index.js +2 -0
- package/src/components/utilities/DXThemeProvider/DXThemeProvider.stories.js +327 -0
- package/src/components/utilities/DXThemeProvider/DXThemeProvider.vue +227 -0
- package/src/components/utilities/DXThemeProvider/index.js +2 -0
- package/src/components/utilities/DXTransitionGroup/DXTransitionGroup.stories.js +368 -0
- package/src/components/utilities/DXTransitionGroup/DXTransitionGroup.vue +212 -0
- package/src/components/utilities/DXTransitionGroup/index.js +2 -0
- package/src/components/utilities/index.js +9 -0
- package/src/composables/useAnimation.js +264 -0
- package/src/composables/useClassComposition.js +35 -0
- package/src/composables/useDataAttributes.js +83 -0
- package/src/composables/useMenu.js +88 -0
- package/src/composables/useSize.js +135 -0
- package/src/composables/useSpacing.js +37 -0
- package/src/composables/useTableColumns.js +88 -0
- package/src/composables/useTableData.js +82 -0
- package/src/composables/useTableFilter.js +158 -0
- package/src/composables/useTablePagination.js +89 -0
- package/src/composables/useTableSelection.js +77 -0
- package/src/composables/useTableSort.js +75 -0
- package/src/composables/useTabsScroll.js +88 -0
- package/src/composables/useVariant.js +700 -0
- package/src/index.js +86 -0
- package/src/styles/animations.css +171 -0
- package/src/styles/index.css +99 -0
- package/src/styles/tokens.js +123 -0
- package/src/utils/propTypes.js +77 -0
- package/src/utils/toggleButtonPresets.js +115 -0
|
@@ -0,0 +1,407 @@
|
|
|
1
|
+
import { ref } from 'vue';
|
|
2
|
+
import DXTabs from './DXTabs.vue';
|
|
3
|
+
import {
|
|
4
|
+
HomeIcon,
|
|
5
|
+
UserIcon,
|
|
6
|
+
Cog6ToothIcon,
|
|
7
|
+
DocumentTextIcon,
|
|
8
|
+
PhotoIcon,
|
|
9
|
+
VideoCameraIcon,
|
|
10
|
+
ChartBarIcon,
|
|
11
|
+
BellIcon,
|
|
12
|
+
EnvelopeIcon,
|
|
13
|
+
FolderIcon,
|
|
14
|
+
} from '@heroicons/vue/24/outline';
|
|
15
|
+
|
|
16
|
+
export default {
|
|
17
|
+
title: 'Organisms/DXTabs',
|
|
18
|
+
component: DXTabs,
|
|
19
|
+
tags: ['autodocs'],
|
|
20
|
+
argTypes: {
|
|
21
|
+
variant: {
|
|
22
|
+
control: 'select',
|
|
23
|
+
options: ['buttons', 'tabs-top', 'tabs-bottom'],
|
|
24
|
+
},
|
|
25
|
+
align: {
|
|
26
|
+
control: 'select',
|
|
27
|
+
options: ['left', 'center', 'right'],
|
|
28
|
+
},
|
|
29
|
+
iconAnimation: {
|
|
30
|
+
control: 'select',
|
|
31
|
+
options: ['none', 'wiggle', 'scale', 'rotate'],
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
// Sample data
|
|
37
|
+
const simpleTabs = [
|
|
38
|
+
{ value: 'overview', label: 'Overview' },
|
|
39
|
+
{ value: 'features', label: 'Features' },
|
|
40
|
+
{ value: 'pricing', label: 'Pricing' },
|
|
41
|
+
{ value: 'faq', label: 'FAQ' },
|
|
42
|
+
];
|
|
43
|
+
|
|
44
|
+
const tabsWithCounts = [
|
|
45
|
+
{ value: 'all', label: 'All', count: 42 },
|
|
46
|
+
{ value: 'active', label: 'Active', count: 28 },
|
|
47
|
+
{ value: 'archived', label: 'Archived', count: 14 },
|
|
48
|
+
];
|
|
49
|
+
|
|
50
|
+
const tabsWithIcons = [
|
|
51
|
+
{ value: 'home', label: 'Home', icon: HomeIcon },
|
|
52
|
+
{ value: 'profile', label: 'Profile', icon: UserIcon },
|
|
53
|
+
{ value: 'settings', label: 'Settings', icon: Cog6ToothIcon },
|
|
54
|
+
];
|
|
55
|
+
|
|
56
|
+
const tabsWithIconsAndCounts = [
|
|
57
|
+
{ value: 'all', label: 'All', icon: DocumentTextIcon, count: 156 },
|
|
58
|
+
{ value: 'photos', label: 'Photos', icon: PhotoIcon, count: 89 },
|
|
59
|
+
{ value: 'videos', label: 'Videos', icon: VideoCameraIcon, count: 45 },
|
|
60
|
+
];
|
|
61
|
+
|
|
62
|
+
const manyTabs = [
|
|
63
|
+
{ value: 'dashboard', label: 'Dashboard', icon: ChartBarIcon },
|
|
64
|
+
{ value: 'notifications', label: 'Notifications', icon: BellIcon, count: 12 },
|
|
65
|
+
{ value: 'messages', label: 'Messages', icon: EnvelopeIcon, count: 5 },
|
|
66
|
+
{ value: 'documents', label: 'Documents', icon: DocumentTextIcon, count: 156 },
|
|
67
|
+
{ value: 'photos', label: 'Photos', icon: PhotoIcon, count: 89 },
|
|
68
|
+
{ value: 'videos', label: 'Videos', icon: VideoCameraIcon, count: 45 },
|
|
69
|
+
{ value: 'files', label: 'Files', icon: FolderIcon, count: 234 },
|
|
70
|
+
{ value: 'settings', label: 'Settings', icon: Cog6ToothIcon },
|
|
71
|
+
];
|
|
72
|
+
|
|
73
|
+
// 1. Default (Buttons variant)
|
|
74
|
+
export const Default = {
|
|
75
|
+
render: () => ({
|
|
76
|
+
components: { DXTabs },
|
|
77
|
+
setup() {
|
|
78
|
+
const activeTab = ref('overview');
|
|
79
|
+
return { activeTab, tabs: simpleTabs };
|
|
80
|
+
},
|
|
81
|
+
template: '<DXTabs v-model="activeTab" :tabs="tabs" />',
|
|
82
|
+
}),
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
// 2. Tabs Top Variant
|
|
86
|
+
export const TabsTopVariant = {
|
|
87
|
+
render: () => ({
|
|
88
|
+
components: { DXTabs },
|
|
89
|
+
setup() {
|
|
90
|
+
const activeTab = ref('overview');
|
|
91
|
+
return { activeTab, tabs: simpleTabs };
|
|
92
|
+
},
|
|
93
|
+
template: '<DXTabs v-model="activeTab" :tabs="tabs" variant="tabs-top" />',
|
|
94
|
+
}),
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
// 3. Tabs Bottom Variant
|
|
98
|
+
export const TabsBottomVariant = {
|
|
99
|
+
render: () => ({
|
|
100
|
+
components: { DXTabs },
|
|
101
|
+
setup() {
|
|
102
|
+
const activeTab = ref('overview');
|
|
103
|
+
return { activeTab, tabs: simpleTabs };
|
|
104
|
+
},
|
|
105
|
+
template: '<DXTabs v-model="activeTab" :tabs="tabs" variant="tabs-bottom" />',
|
|
106
|
+
}),
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
// 4. All Variants Comparison
|
|
110
|
+
export const AllVariants = {
|
|
111
|
+
render: () => ({
|
|
112
|
+
components: { DXTabs },
|
|
113
|
+
setup() {
|
|
114
|
+
const tab1 = ref('overview');
|
|
115
|
+
const tab2 = ref('overview');
|
|
116
|
+
const tab3 = ref('overview');
|
|
117
|
+
return { tab1, tab2, tab3, tabs: simpleTabs };
|
|
118
|
+
},
|
|
119
|
+
template: `
|
|
120
|
+
<div class="space-y-8">
|
|
121
|
+
<div>
|
|
122
|
+
<h3 class="text-sm font-semibold text-slate-900 mb-3">Buttons (default)</h3>
|
|
123
|
+
<DXTabs v-model="tab1" :tabs="tabs" variant="buttons" />
|
|
124
|
+
</div>
|
|
125
|
+
|
|
126
|
+
<div>
|
|
127
|
+
<h3 class="text-sm font-semibold text-slate-900 mb-3">Tabs Top</h3>
|
|
128
|
+
<DXTabs v-model="tab2" :tabs="tabs" variant="tabs-top" />
|
|
129
|
+
</div>
|
|
130
|
+
|
|
131
|
+
<div>
|
|
132
|
+
<h3 class="text-sm font-semibold text-slate-900 mb-3">Tabs Bottom</h3>
|
|
133
|
+
<DXTabs v-model="tab3" :tabs="tabs" variant="tabs-bottom" />
|
|
134
|
+
</div>
|
|
135
|
+
</div>
|
|
136
|
+
`,
|
|
137
|
+
}),
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
// 5. With Alignment
|
|
141
|
+
export const WithAlignment = {
|
|
142
|
+
render: () => ({
|
|
143
|
+
components: { DXTabs },
|
|
144
|
+
setup() {
|
|
145
|
+
const tab1 = ref('overview');
|
|
146
|
+
const tab2 = ref('overview');
|
|
147
|
+
const tab3 = ref('overview');
|
|
148
|
+
return { tab1, tab2, tab3, tabs: simpleTabs };
|
|
149
|
+
},
|
|
150
|
+
template: `
|
|
151
|
+
<div class="space-y-8">
|
|
152
|
+
<div>
|
|
153
|
+
<h3 class="text-sm font-semibold text-slate-900 mb-3">Left (default)</h3>
|
|
154
|
+
<DXTabs v-model="tab1" :tabs="tabs" variant="tabs-top" align="left" />
|
|
155
|
+
</div>
|
|
156
|
+
|
|
157
|
+
<div>
|
|
158
|
+
<h3 class="text-sm font-semibold text-slate-900 mb-3">Center</h3>
|
|
159
|
+
<DXTabs v-model="tab2" :tabs="tabs" variant="tabs-top" align="center" />
|
|
160
|
+
</div>
|
|
161
|
+
|
|
162
|
+
<div>
|
|
163
|
+
<h3 class="text-sm font-semibold text-slate-900 mb-3">Right</h3>
|
|
164
|
+
<DXTabs v-model="tab3" :tabs="tabs" variant="tabs-top" align="right" />
|
|
165
|
+
</div>
|
|
166
|
+
</div>
|
|
167
|
+
`,
|
|
168
|
+
}),
|
|
169
|
+
};
|
|
170
|
+
|
|
171
|
+
// 6. With Counts
|
|
172
|
+
export const WithCounts = {
|
|
173
|
+
render: () => ({
|
|
174
|
+
components: { DXTabs },
|
|
175
|
+
setup() {
|
|
176
|
+
const activeTab = ref('all');
|
|
177
|
+
return { activeTab, tabs: tabsWithCounts };
|
|
178
|
+
},
|
|
179
|
+
template: '<DXTabs v-model="activeTab" :tabs="tabs" />',
|
|
180
|
+
}),
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
// 7. With Icons
|
|
184
|
+
export const WithIcons = {
|
|
185
|
+
render: () => ({
|
|
186
|
+
components: { DXTabs },
|
|
187
|
+
setup() {
|
|
188
|
+
const activeTab = ref('home');
|
|
189
|
+
return { activeTab, tabs: tabsWithIcons };
|
|
190
|
+
},
|
|
191
|
+
template: '<DXTabs v-model="activeTab" :tabs="tabs" />',
|
|
192
|
+
}),
|
|
193
|
+
};
|
|
194
|
+
|
|
195
|
+
// 8. With Icons and Counts
|
|
196
|
+
export const WithIconsAndCounts = {
|
|
197
|
+
render: () => ({
|
|
198
|
+
components: { DXTabs },
|
|
199
|
+
setup() {
|
|
200
|
+
const activeTab = ref('all');
|
|
201
|
+
return { activeTab, tabs: tabsWithIconsAndCounts };
|
|
202
|
+
},
|
|
203
|
+
template: '<DXTabs v-model="activeTab" :tabs="tabs" icon-animation="scale" />',
|
|
204
|
+
}),
|
|
205
|
+
};
|
|
206
|
+
|
|
207
|
+
// 9. With Scrolling
|
|
208
|
+
export const WithScrolling = {
|
|
209
|
+
render: () => ({
|
|
210
|
+
components: { DXTabs },
|
|
211
|
+
setup() {
|
|
212
|
+
const activeTab = ref('dashboard');
|
|
213
|
+
return { activeTab, tabs: manyTabs };
|
|
214
|
+
},
|
|
215
|
+
template: `
|
|
216
|
+
<div class="max-w-2xl">
|
|
217
|
+
<DXTabs
|
|
218
|
+
v-model="activeTab"
|
|
219
|
+
:tabs="tabs"
|
|
220
|
+
variant="tabs-top"
|
|
221
|
+
:scrollable="true"
|
|
222
|
+
/>
|
|
223
|
+
</div>
|
|
224
|
+
`,
|
|
225
|
+
}),
|
|
226
|
+
};
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
// 11. Compact Mode - Icon Only
|
|
230
|
+
export const CompactModeIconOnly = {
|
|
231
|
+
render: () => ({
|
|
232
|
+
components: { DXTabs },
|
|
233
|
+
setup() {
|
|
234
|
+
const activeTab = ref('all');
|
|
235
|
+
return { activeTab, tabs: tabsWithIconsAndCounts };
|
|
236
|
+
},
|
|
237
|
+
template: `
|
|
238
|
+
<div>
|
|
239
|
+
<p class="text-sm text-slate-600 mb-4">Наведите на таб или выберите его, чтобы увидеть полный текст</p>
|
|
240
|
+
<DXTabs
|
|
241
|
+
v-model="activeTab"
|
|
242
|
+
:tabs="tabs"
|
|
243
|
+
:compact="true"
|
|
244
|
+
compactDisplay="icon"
|
|
245
|
+
/>
|
|
246
|
+
</div>
|
|
247
|
+
`,
|
|
248
|
+
}),
|
|
249
|
+
};
|
|
250
|
+
|
|
251
|
+
// 12. Compact Mode - Icon and Badge
|
|
252
|
+
export const CompactModeIconBadge = {
|
|
253
|
+
render: () => ({
|
|
254
|
+
components: { DXTabs },
|
|
255
|
+
setup() {
|
|
256
|
+
const activeTab = ref('all');
|
|
257
|
+
return { activeTab, tabs: tabsWithIconsAndCounts };
|
|
258
|
+
},
|
|
259
|
+
template: `
|
|
260
|
+
<div>
|
|
261
|
+
<p class="text-sm text-slate-600 mb-4">Наведите на таб или выберите его, чтобы увидеть полный текст</p>
|
|
262
|
+
<DXTabs
|
|
263
|
+
v-model="activeTab"
|
|
264
|
+
:tabs="tabs"
|
|
265
|
+
:compact="true"
|
|
266
|
+
compactDisplay="icon-badge"
|
|
267
|
+
/>
|
|
268
|
+
</div>
|
|
269
|
+
`,
|
|
270
|
+
}),
|
|
271
|
+
};
|
|
272
|
+
|
|
273
|
+
// 13. Compact with Tabs Top
|
|
274
|
+
export const CompactTabsTop = {
|
|
275
|
+
render: () => ({
|
|
276
|
+
components: { DXTabs },
|
|
277
|
+
setup() {
|
|
278
|
+
const activeTab = ref('dashboard');
|
|
279
|
+
return { activeTab, tabs: manyTabs };
|
|
280
|
+
},
|
|
281
|
+
template: `
|
|
282
|
+
<div>
|
|
283
|
+
<p class="text-sm text-slate-600 mb-4">Компактный режим с классическими табами</p>
|
|
284
|
+
<DXTabs
|
|
285
|
+
v-model="activeTab"
|
|
286
|
+
:tabs="tabs"
|
|
287
|
+
variant="tabs-top"
|
|
288
|
+
:compact="true"
|
|
289
|
+
compactDisplay="icon-badge"
|
|
290
|
+
/>
|
|
291
|
+
</div>
|
|
292
|
+
`,
|
|
293
|
+
}),
|
|
294
|
+
};
|
|
295
|
+
|
|
296
|
+
// 14. Compact with Scrolling
|
|
297
|
+
export const CompactWithScrolling = {
|
|
298
|
+
render: () => ({
|
|
299
|
+
components: { DXTabs },
|
|
300
|
+
setup() {
|
|
301
|
+
const activeTab = ref('dashboard');
|
|
302
|
+
return { activeTab, tabs: manyTabs };
|
|
303
|
+
},
|
|
304
|
+
template: `
|
|
305
|
+
<div class="max-w-xl">
|
|
306
|
+
<p class="text-sm text-slate-600 mb-4">Компактный режим с прокруткой</p>
|
|
307
|
+
<DXTabs
|
|
308
|
+
v-model="activeTab"
|
|
309
|
+
:tabs="tabs"
|
|
310
|
+
variant="tabs-top"
|
|
311
|
+
:compact="true"
|
|
312
|
+
compactDisplay="icon-badge"
|
|
313
|
+
:scrollable="true"
|
|
314
|
+
/>
|
|
315
|
+
</div>
|
|
316
|
+
`,
|
|
317
|
+
}),
|
|
318
|
+
};
|
|
319
|
+
|
|
320
|
+
// 15. Custom Icon Animations
|
|
321
|
+
export const CustomIconAnimations = {
|
|
322
|
+
render: () => ({
|
|
323
|
+
components: { DXTabs },
|
|
324
|
+
setup() {
|
|
325
|
+
const activeTab = ref('home');
|
|
326
|
+
const tabs = [
|
|
327
|
+
{ value: 'home', label: 'Wiggle', icon: HomeIcon, iconAnimation: 'wiggle' },
|
|
328
|
+
{ value: 'profile', label: 'Scale', icon: UserIcon, iconAnimation: 'scale' },
|
|
329
|
+
{ value: 'settings', label: 'Rotate', icon: Cog6ToothIcon, iconAnimation: 'rotate' },
|
|
330
|
+
{ value: 'none', label: 'None', icon: DocumentTextIcon, iconAnimation: 'none' },
|
|
331
|
+
];
|
|
332
|
+
return { activeTab, tabs };
|
|
333
|
+
},
|
|
334
|
+
template: '<DXTabs v-model="activeTab" :tabs="tabs" :animateActiveOnly="false" />',
|
|
335
|
+
}),
|
|
336
|
+
};
|
|
337
|
+
|
|
338
|
+
// 16. All Features Combined
|
|
339
|
+
export const AllFeatures = {
|
|
340
|
+
render: () => ({
|
|
341
|
+
components: { DXTabs },
|
|
342
|
+
setup() {
|
|
343
|
+
const activeTab = ref('dashboard');
|
|
344
|
+
return { activeTab, tabs: manyTabs };
|
|
345
|
+
},
|
|
346
|
+
template: `
|
|
347
|
+
<div class="space-y-8">
|
|
348
|
+
<div>
|
|
349
|
+
<h3 class="text-sm font-semibold text-slate-900 mb-3">Buttons + Compact + Center</h3>
|
|
350
|
+
<DXTabs
|
|
351
|
+
v-model="activeTab"
|
|
352
|
+
:tabs="tabs"
|
|
353
|
+
variant="buttons"
|
|
354
|
+
align="center"
|
|
355
|
+
:compact="true"
|
|
356
|
+
compactDisplay="icon-badge"
|
|
357
|
+
/>
|
|
358
|
+
</div>
|
|
359
|
+
|
|
360
|
+
<div class="max-w-2xl">
|
|
361
|
+
<h3 class="text-sm font-semibold text-slate-900 mb-3">Tabs Top + Scroll + Compact</h3>
|
|
362
|
+
<DXTabs
|
|
363
|
+
v-model="activeTab"
|
|
364
|
+
:tabs="tabs"
|
|
365
|
+
variant="tabs-top"
|
|
366
|
+
:compact="true"
|
|
367
|
+
compactDisplay="icon-badge"
|
|
368
|
+
:scrollable="true"
|
|
369
|
+
/>
|
|
370
|
+
</div>
|
|
371
|
+
|
|
372
|
+
<div class="max-w-2xl">
|
|
373
|
+
<h3 class="text-sm font-semibold text-slate-900 mb-3">Tabs Bottom + Scroll + Right Align</h3>
|
|
374
|
+
<DXTabs
|
|
375
|
+
v-model="activeTab"
|
|
376
|
+
:tabs="tabs"
|
|
377
|
+
variant="tabs-bottom"
|
|
378
|
+
align="right"
|
|
379
|
+
:scrollable="true"
|
|
380
|
+
/>
|
|
381
|
+
</div>
|
|
382
|
+
</div>
|
|
383
|
+
`,
|
|
384
|
+
}),
|
|
385
|
+
};
|
|
386
|
+
|
|
387
|
+
// 17. Playground
|
|
388
|
+
export const Playground = {
|
|
389
|
+
args: {
|
|
390
|
+
variant: 'buttons',
|
|
391
|
+
align: 'left',
|
|
392
|
+
scrollable: true,
|
|
393
|
+
showScrollButtons: false,
|
|
394
|
+
compact: false,
|
|
395
|
+
compactDisplay: 'icon-badge',
|
|
396
|
+
iconAnimation: 'wiggle',
|
|
397
|
+
animateActiveOnly: true,
|
|
398
|
+
},
|
|
399
|
+
render: (args) => ({
|
|
400
|
+
components: { DXTabs },
|
|
401
|
+
setup() {
|
|
402
|
+
const activeTab = ref('all');
|
|
403
|
+
return { activeTab, tabs: tabsWithIconsAndCounts, args };
|
|
404
|
+
},
|
|
405
|
+
template: '<DXTabs v-model="activeTab" :tabs="tabs" v-bind="args" />',
|
|
406
|
+
}),
|
|
407
|
+
};
|
|
@@ -0,0 +1,301 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
ref="tabsContainer"
|
|
4
|
+
:class="containerClasses"
|
|
5
|
+
data-component="DXTabs"
|
|
6
|
+
:data-variant="variant"
|
|
7
|
+
:data-align="align"
|
|
8
|
+
>
|
|
9
|
+
<!-- Tabs -->
|
|
10
|
+
<button
|
|
11
|
+
v-for="tab in tabs"
|
|
12
|
+
:key="tab.value"
|
|
13
|
+
:class="getTabClasses(tab)"
|
|
14
|
+
@click="selectTab(tab.value)"
|
|
15
|
+
@mouseenter="hoveredTab = tab.value"
|
|
16
|
+
@mouseleave="hoveredTab = null"
|
|
17
|
+
type="button"
|
|
18
|
+
:aria-selected="modelValue === tab.value"
|
|
19
|
+
role="tab"
|
|
20
|
+
class="group"
|
|
21
|
+
>
|
|
22
|
+
<span class="flex items-center gap-2">
|
|
23
|
+
<!-- Icon -->
|
|
24
|
+
<DXIcon
|
|
25
|
+
v-if="tab.icon"
|
|
26
|
+
:icon="tab.icon"
|
|
27
|
+
size="sm"
|
|
28
|
+
:animation="getIconAnimation(tab)"
|
|
29
|
+
:groupHover="true"
|
|
30
|
+
class="flex-shrink-0"
|
|
31
|
+
/>
|
|
32
|
+
|
|
33
|
+
<!-- Label (hidden in compact mode when not active/hovered) -->
|
|
34
|
+
<span
|
|
35
|
+
v-show="!isCompactAndHidden(tab)"
|
|
36
|
+
class="tab-label whitespace-nowrap"
|
|
37
|
+
>
|
|
38
|
+
{{ tab.label }}
|
|
39
|
+
</span>
|
|
40
|
+
|
|
41
|
+
<!-- Count Badge -->
|
|
42
|
+
<span
|
|
43
|
+
v-if="tab.count !== undefined && shouldShowBadge(tab)"
|
|
44
|
+
class="tab-badge inline-flex items-center justify-center min-w-[24px] px-2 py-1 text-[11px] rounded-full flex-shrink-0"
|
|
45
|
+
:class="getBadgeClasses(tab)"
|
|
46
|
+
>
|
|
47
|
+
{{ tab.count }}
|
|
48
|
+
</span>
|
|
49
|
+
</span>
|
|
50
|
+
</button>
|
|
51
|
+
</div>
|
|
52
|
+
</template>
|
|
53
|
+
|
|
54
|
+
<script setup>
|
|
55
|
+
import { computed, ref, watch, nextTick } from 'vue';
|
|
56
|
+
import DXIcon from '../../atoms/DXIcon/DXIcon.vue';
|
|
57
|
+
|
|
58
|
+
const props = defineProps({
|
|
59
|
+
/** Текущее значение (v-model) */
|
|
60
|
+
modelValue: {
|
|
61
|
+
type: [String, Number],
|
|
62
|
+
},
|
|
63
|
+
|
|
64
|
+
/** Табы: [{ value, label, icon?, count?, iconAnimation? }] */
|
|
65
|
+
tabs: {
|
|
66
|
+
type: Array,
|
|
67
|
+
default: () => [],
|
|
68
|
+
},
|
|
69
|
+
|
|
70
|
+
/** Вариант отображения */
|
|
71
|
+
variant: {
|
|
72
|
+
type: String,
|
|
73
|
+
default: 'buttons',
|
|
74
|
+
validator: (v) => ['buttons', 'tabs-top', 'tabs-bottom'].includes(v),
|
|
75
|
+
},
|
|
76
|
+
|
|
77
|
+
/** Выравнивание табов */
|
|
78
|
+
align: {
|
|
79
|
+
type: String,
|
|
80
|
+
default: 'left',
|
|
81
|
+
validator: (v) => ['left', 'center', 'right'].includes(v),
|
|
82
|
+
},
|
|
83
|
+
|
|
84
|
+
/** Включить прокрутку при overflow */
|
|
85
|
+
scrollable: {
|
|
86
|
+
type: Boolean,
|
|
87
|
+
default: true,
|
|
88
|
+
},
|
|
89
|
+
|
|
90
|
+
/** Компактный режим */
|
|
91
|
+
compact: {
|
|
92
|
+
type: Boolean,
|
|
93
|
+
default: false,
|
|
94
|
+
},
|
|
95
|
+
|
|
96
|
+
/** Что показывать в компактном режиме */
|
|
97
|
+
compactDisplay: {
|
|
98
|
+
type: String,
|
|
99
|
+
default: 'icon-badge',
|
|
100
|
+
validator: (v) => ['icon', 'icon-badge'].includes(v),
|
|
101
|
+
},
|
|
102
|
+
|
|
103
|
+
/** Анимация иконок: none | wiggle | scale | rotate */
|
|
104
|
+
iconAnimation: {
|
|
105
|
+
type: String,
|
|
106
|
+
default: 'wiggle',
|
|
107
|
+
},
|
|
108
|
+
|
|
109
|
+
/** Анимировать только активную иконку */
|
|
110
|
+
animateActiveOnly: {
|
|
111
|
+
type: Boolean,
|
|
112
|
+
default: true,
|
|
113
|
+
},
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
const emit = defineEmits(['update:modelValue']);
|
|
117
|
+
|
|
118
|
+
// Refs
|
|
119
|
+
const tabsContainer = ref(null);
|
|
120
|
+
const hoveredTab = ref(null);
|
|
121
|
+
|
|
122
|
+
// Container classes
|
|
123
|
+
const containerClasses = computed(() => [
|
|
124
|
+
'dx-tabs',
|
|
125
|
+
'flex',
|
|
126
|
+
'items-center',
|
|
127
|
+
|
|
128
|
+
// Variant
|
|
129
|
+
props.variant === 'buttons' && 'flex-wrap gap-2',
|
|
130
|
+
props.variant === 'tabs-top' && 'border-b border-slate-200',
|
|
131
|
+
props.variant === 'tabs-bottom' && 'border-t border-slate-200',
|
|
132
|
+
|
|
133
|
+
// Align
|
|
134
|
+
props.align === 'left' && 'justify-start',
|
|
135
|
+
props.align === 'center' && 'justify-center',
|
|
136
|
+
props.align === 'right' && 'justify-end',
|
|
137
|
+
|
|
138
|
+
// Scrollable
|
|
139
|
+
props.scrollable && 'overflow-x-auto',
|
|
140
|
+
props.scrollable && 'scroll-smooth',
|
|
141
|
+
]);
|
|
142
|
+
|
|
143
|
+
// Tab classes
|
|
144
|
+
const getTabClasses = (tab) => {
|
|
145
|
+
const isActive = props.modelValue === tab.value;
|
|
146
|
+
const isHovered = hoveredTab.value === tab.value;
|
|
147
|
+
const isCompact = props.compact && !isActive && !isHovered;
|
|
148
|
+
|
|
149
|
+
return [
|
|
150
|
+
'tab-btn',
|
|
151
|
+
'text-sm',
|
|
152
|
+
'font-semibold',
|
|
153
|
+
'transition-all',
|
|
154
|
+
'duration-200',
|
|
155
|
+
'flex-shrink-0',
|
|
156
|
+
|
|
157
|
+
// Variant base styles
|
|
158
|
+
props.variant === 'buttons' && 'px-3 py-2.5 rounded-xl border',
|
|
159
|
+
props.variant === 'tabs-top' && [
|
|
160
|
+
'px-4 py-2.5 rounded-t-xl border-x border-t',
|
|
161
|
+
isActive ? '-mb-px' : 'border-b-0',
|
|
162
|
+
],
|
|
163
|
+
props.variant === 'tabs-bottom' && [
|
|
164
|
+
'px-4 py-2.5 rounded-b-xl border-x border-b',
|
|
165
|
+
isActive ? '-mt-px' : 'border-t-0',
|
|
166
|
+
],
|
|
167
|
+
|
|
168
|
+
// Active/Inactive for buttons variant
|
|
169
|
+
props.variant === 'buttons' && isActive && 'bg-slate-800 text-white border-slate-800',
|
|
170
|
+
props.variant === 'buttons' && !isActive && 'border-slate-200 text-slate-700 hover:border-slate-300',
|
|
171
|
+
|
|
172
|
+
// Active/Inactive for tabs variants
|
|
173
|
+
(props.variant === 'tabs-top' || props.variant === 'tabs-bottom') && isActive && [
|
|
174
|
+
'bg-white text-slate-900 border-slate-200',
|
|
175
|
+
props.variant === 'tabs-top' && 'border-b-white',
|
|
176
|
+
props.variant === 'tabs-bottom' && 'border-t-white',
|
|
177
|
+
],
|
|
178
|
+
(props.variant === 'tabs-top' || props.variant === 'tabs-bottom') && !isActive && [
|
|
179
|
+
'bg-slate-50 text-slate-600 border-slate-200',
|
|
180
|
+
'hover:bg-slate-100 hover:text-slate-900',
|
|
181
|
+
],
|
|
182
|
+
|
|
183
|
+
// Compact mode
|
|
184
|
+
isCompact && 'px-2',
|
|
185
|
+
];
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
// Badge classes
|
|
189
|
+
const getBadgeClasses = (tab) => {
|
|
190
|
+
const isActive = props.modelValue === tab.value;
|
|
191
|
+
|
|
192
|
+
if (props.variant === 'buttons') {
|
|
193
|
+
return isActive ? 'bg-white/20 text-white' : 'bg-slate-100 text-slate-700';
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
return isActive ? 'bg-slate-200 text-slate-900' : 'bg-slate-200 text-slate-600';
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
// Check if tab is active
|
|
200
|
+
const isActive = (tab) => props.modelValue === tab.value;
|
|
201
|
+
|
|
202
|
+
// Check if tab is hovered
|
|
203
|
+
const isHovered = (tab) => hoveredTab.value === tab.value;
|
|
204
|
+
|
|
205
|
+
// Check if compact and should hide label
|
|
206
|
+
const isCompactAndHidden = (tab) => {
|
|
207
|
+
if (!props.compact) return false;
|
|
208
|
+
if (isActive(tab)) return false;
|
|
209
|
+
if (isHovered(tab)) return false;
|
|
210
|
+
return true;
|
|
211
|
+
};
|
|
212
|
+
|
|
213
|
+
// Check if should show badge in compact mode
|
|
214
|
+
const shouldShowBadge = (tab) => {
|
|
215
|
+
if (!props.compact) return true;
|
|
216
|
+
if (props.compactDisplay === 'icon') return false;
|
|
217
|
+
if (props.compactDisplay === 'icon-badge') {
|
|
218
|
+
// Show badge always in compact mode if compactDisplay is icon-badge
|
|
219
|
+
return true;
|
|
220
|
+
}
|
|
221
|
+
return true;
|
|
222
|
+
};
|
|
223
|
+
|
|
224
|
+
// Get icon animation for tab
|
|
225
|
+
const getIconAnimation = (tab) => {
|
|
226
|
+
// If tab has its own animation
|
|
227
|
+
if (tab.iconAnimation) return tab.iconAnimation;
|
|
228
|
+
|
|
229
|
+
// If tab is hovered - always animate
|
|
230
|
+
if (isHovered(tab)) return props.iconAnimation;
|
|
231
|
+
|
|
232
|
+
// If animate only active tab
|
|
233
|
+
if (props.animateActiveOnly) {
|
|
234
|
+
return isActive(tab) ? props.iconAnimation : 'none';
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
// Global animation
|
|
238
|
+
return props.iconAnimation;
|
|
239
|
+
};
|
|
240
|
+
|
|
241
|
+
// Select tab
|
|
242
|
+
const selectTab = (value) => {
|
|
243
|
+
emit('update:modelValue', value);
|
|
244
|
+
};
|
|
245
|
+
|
|
246
|
+
// Scroll to active tab when it changes
|
|
247
|
+
watch(() => props.modelValue, async () => {
|
|
248
|
+
if (props.scrollable && tabsContainer.value) {
|
|
249
|
+
await nextTick();
|
|
250
|
+
const activeTab = tabsContainer.value.querySelector('.tab-btn[aria-selected="true"]');
|
|
251
|
+
if (activeTab) {
|
|
252
|
+
activeTab.scrollIntoView({
|
|
253
|
+
behavior: 'smooth',
|
|
254
|
+
block: 'nearest',
|
|
255
|
+
inline: 'center',
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
}, { immediate: true });
|
|
260
|
+
</script>
|
|
261
|
+
|
|
262
|
+
<style scoped>
|
|
263
|
+
.dx-tabs {
|
|
264
|
+
position: relative;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
/* Скрытие скроллбара для более чистого вида */
|
|
268
|
+
.dx-tabs::-webkit-scrollbar {
|
|
269
|
+
height: 4px;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
.dx-tabs::-webkit-scrollbar-track {
|
|
273
|
+
background: transparent;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
.dx-tabs::-webkit-scrollbar-thumb {
|
|
277
|
+
background: rgb(203 213 225);
|
|
278
|
+
border-radius: 2px;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
.dx-tabs::-webkit-scrollbar-thumb:hover {
|
|
282
|
+
background: rgb(148 163 184);
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
/* Плавные переходы для компактного режима */
|
|
286
|
+
.tab-btn {
|
|
287
|
+
transition-property: all;
|
|
288
|
+
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
289
|
+
transition-duration: 200ms;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
.tab-label {
|
|
293
|
+
transition: opacity 0.2s ease;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
/* Tabs variants - дополнительные стили */
|
|
297
|
+
.tab-btn[data-variant="tabs-top"],
|
|
298
|
+
.tab-btn[data-variant="tabs-bottom"] {
|
|
299
|
+
position: relative;
|
|
300
|
+
}
|
|
301
|
+
</style>
|