dxd-style-code 0.1.7 → 0.1.9
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 +14 -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/index.js +20 -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,238 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
class="relative inline-block align-top"
|
|
4
|
+
ref="root"
|
|
5
|
+
data-component="DXDropdown"
|
|
6
|
+
:data-position="position"
|
|
7
|
+
:data-width="width"
|
|
8
|
+
:data-variant="variant"
|
|
9
|
+
:data-disabled="disabled"
|
|
10
|
+
>
|
|
11
|
+
<!-- Hybrid approach: styled button with slot content + chevron -->
|
|
12
|
+
<button
|
|
13
|
+
type="button"
|
|
14
|
+
:class="triggerClasses"
|
|
15
|
+
:disabled="disabled"
|
|
16
|
+
@click="toggle"
|
|
17
|
+
@keydown.down.prevent="handleKeyDown"
|
|
18
|
+
@keydown.up.prevent="handleKeyUp"
|
|
19
|
+
@keydown.escape="close"
|
|
20
|
+
aria-haspopup="true"
|
|
21
|
+
:aria-expanded="open"
|
|
22
|
+
>
|
|
23
|
+
<!-- Slot для содержимого -->
|
|
24
|
+
<slot name="trigger">Меню</slot>
|
|
25
|
+
|
|
26
|
+
<!-- Chevron справа (если showChevron === true) -->
|
|
27
|
+
<DXIcon
|
|
28
|
+
v-if="showChevron"
|
|
29
|
+
:icon="ChevronDownIcon"
|
|
30
|
+
size="sm"
|
|
31
|
+
animation="none"
|
|
32
|
+
class="text-slate-400 transition-transform duration-200 flex-shrink-0"
|
|
33
|
+
:class="{ 'rotate-180': open }"
|
|
34
|
+
/>
|
|
35
|
+
</button>
|
|
36
|
+
|
|
37
|
+
<Transition name="dropdown-fade">
|
|
38
|
+
<div
|
|
39
|
+
v-if="open"
|
|
40
|
+
:class="menuClasses"
|
|
41
|
+
:style="menuStyles"
|
|
42
|
+
@keydown.down.prevent="focusNext"
|
|
43
|
+
@keydown.up.prevent="focusPrevious"
|
|
44
|
+
@keydown.escape="close"
|
|
45
|
+
>
|
|
46
|
+
<slot />
|
|
47
|
+
</div>
|
|
48
|
+
</Transition>
|
|
49
|
+
</div>
|
|
50
|
+
</template>
|
|
51
|
+
|
|
52
|
+
<script setup>
|
|
53
|
+
import { ref, computed, provide, onMounted, onBeforeUnmount, nextTick } from "vue";
|
|
54
|
+
import { ChevronDownIcon } from "@heroicons/vue/24/outline";
|
|
55
|
+
import DXIcon from "../../atoms/DXIcon/DXIcon.vue";
|
|
56
|
+
|
|
57
|
+
const props = defineProps({
|
|
58
|
+
/** Позиционирование: left | right | center */
|
|
59
|
+
position: {
|
|
60
|
+
type: String,
|
|
61
|
+
default: 'right',
|
|
62
|
+
validator: (value) => ['left', 'right', 'center'].includes(value)
|
|
63
|
+
},
|
|
64
|
+
/** Ширина меню: sm | md | lg | xl | auto */
|
|
65
|
+
width: {
|
|
66
|
+
type: String,
|
|
67
|
+
default: 'md',
|
|
68
|
+
validator: (value) => ['sm', 'md', 'lg', 'xl', 'auto'].includes(value)
|
|
69
|
+
},
|
|
70
|
+
/** Вариант оформления: default | minimal */
|
|
71
|
+
variant: {
|
|
72
|
+
type: String,
|
|
73
|
+
default: 'default',
|
|
74
|
+
validator: (value) => ['default', 'minimal'].includes(value)
|
|
75
|
+
},
|
|
76
|
+
/** Отступ от trigger (px) */
|
|
77
|
+
offset: {
|
|
78
|
+
type: Number,
|
|
79
|
+
default: 8
|
|
80
|
+
},
|
|
81
|
+
/** Отключить dropdown */
|
|
82
|
+
disabled: {
|
|
83
|
+
type: Boolean,
|
|
84
|
+
default: false
|
|
85
|
+
},
|
|
86
|
+
/** Показать стрелочку (chevron) */
|
|
87
|
+
showChevron: {
|
|
88
|
+
type: Boolean,
|
|
89
|
+
default: true
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
const open = ref(false);
|
|
94
|
+
const root = ref(null);
|
|
95
|
+
const currentFocusIndex = ref(-1);
|
|
96
|
+
|
|
97
|
+
const toggle = () => {
|
|
98
|
+
if (props.disabled) return;
|
|
99
|
+
open.value = !open.value;
|
|
100
|
+
|
|
101
|
+
if (open.value) {
|
|
102
|
+
nextTick(() => {
|
|
103
|
+
focusFirst();
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
const close = () => {
|
|
109
|
+
open.value = false;
|
|
110
|
+
currentFocusIndex.value = -1;
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
const onClickOutside = (e) => {
|
|
114
|
+
if (root.value && !root.value.contains(e.target)) {
|
|
115
|
+
close();
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
// Provide context для DXDropdownItem
|
|
120
|
+
const dropdownContext = {
|
|
121
|
+
close,
|
|
122
|
+
isOpen: computed(() => open.value)
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
provide('dropdown', dropdownContext);
|
|
126
|
+
|
|
127
|
+
// Keyboard navigation
|
|
128
|
+
const getFocusableItems = () => {
|
|
129
|
+
if (!root.value) return [];
|
|
130
|
+
const menu = root.value.querySelector('[data-component="DXDropdown"] > div:last-child');
|
|
131
|
+
if (!menu) return [];
|
|
132
|
+
return Array.from(menu.querySelectorAll('button[data-component="DXDropdownItem"]:not([disabled])'));
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
const focusFirst = () => {
|
|
136
|
+
const items = getFocusableItems();
|
|
137
|
+
if (items.length > 0) {
|
|
138
|
+
items[0].focus();
|
|
139
|
+
currentFocusIndex.value = 0;
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
const focusNext = () => {
|
|
144
|
+
const items = getFocusableItems();
|
|
145
|
+
if (items.length === 0) return;
|
|
146
|
+
|
|
147
|
+
currentFocusIndex.value = (currentFocusIndex.value + 1) % items.length;
|
|
148
|
+
items[currentFocusIndex.value].focus();
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
const focusPrevious = () => {
|
|
152
|
+
const items = getFocusableItems();
|
|
153
|
+
if (items.length === 0) return;
|
|
154
|
+
|
|
155
|
+
currentFocusIndex.value = currentFocusIndex.value <= 0
|
|
156
|
+
? items.length - 1
|
|
157
|
+
: currentFocusIndex.value - 1;
|
|
158
|
+
items[currentFocusIndex.value].focus();
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
const handleKeyDown = () => {
|
|
162
|
+
if (!open.value) {
|
|
163
|
+
toggle();
|
|
164
|
+
} else {
|
|
165
|
+
focusNext();
|
|
166
|
+
}
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
const handleKeyUp = () => {
|
|
170
|
+
if (open.value) {
|
|
171
|
+
focusPrevious();
|
|
172
|
+
}
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
// Classes
|
|
176
|
+
const triggerClasses = computed(() => [
|
|
177
|
+
"inline-flex items-center px-3 py-2 rounded-xl border border-slate-200 text-sm font-semibold text-slate-700 hover:border-slate-300 transition-colors focus:outline-none focus:ring-2 focus:ring-slate-900/10",
|
|
178
|
+
props.showChevron && "gap-2", // gap только если есть chevron
|
|
179
|
+
props.disabled && "opacity-60 cursor-not-allowed hover:border-slate-200",
|
|
180
|
+
]);
|
|
181
|
+
|
|
182
|
+
const POSITION_CLASSES = {
|
|
183
|
+
left: 'left-0',
|
|
184
|
+
right: 'right-0',
|
|
185
|
+
center: 'left-1/2 -translate-x-1/2',
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
const WIDTH_CLASSES = {
|
|
189
|
+
sm: 'w-48',
|
|
190
|
+
md: 'w-56',
|
|
191
|
+
lg: 'w-72',
|
|
192
|
+
xl: 'w-96',
|
|
193
|
+
auto: 'w-auto min-w-[12rem]',
|
|
194
|
+
};
|
|
195
|
+
|
|
196
|
+
const menuClasses = computed(() => [
|
|
197
|
+
"absolute z-20 bg-white border border-slate-200 rounded-2xl shadow-lg py-2",
|
|
198
|
+
POSITION_CLASSES[props.position],
|
|
199
|
+
WIDTH_CLASSES[props.width],
|
|
200
|
+
props.variant === 'minimal' && 'shadow-md border-slate-100',
|
|
201
|
+
]);
|
|
202
|
+
|
|
203
|
+
const menuStyles = computed(() => ({
|
|
204
|
+
marginTop: `${props.offset}px`,
|
|
205
|
+
}));
|
|
206
|
+
|
|
207
|
+
onMounted(() => {
|
|
208
|
+
document.addEventListener("click", onClickOutside);
|
|
209
|
+
});
|
|
210
|
+
|
|
211
|
+
onBeforeUnmount(() => {
|
|
212
|
+
document.removeEventListener("click", onClickOutside);
|
|
213
|
+
});
|
|
214
|
+
</script>
|
|
215
|
+
|
|
216
|
+
<style scoped>
|
|
217
|
+
/* Dropdown fade animation */
|
|
218
|
+
.dropdown-fade-enter-active,
|
|
219
|
+
.dropdown-fade-leave-active {
|
|
220
|
+
transition: opacity 150ms ease, transform 150ms ease;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
.dropdown-fade-enter-from {
|
|
224
|
+
opacity: 0;
|
|
225
|
+
transform: translateY(-8px);
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
.dropdown-fade-leave-to {
|
|
229
|
+
opacity: 0;
|
|
230
|
+
transform: translateY(-4px);
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
.dropdown-fade-enter-to,
|
|
234
|
+
.dropdown-fade-leave-from {
|
|
235
|
+
opacity: 1;
|
|
236
|
+
transform: translateY(0);
|
|
237
|
+
}
|
|
238
|
+
</style>
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import DXEmptyState from './DXEmptyState.vue';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: 'Organisms/DXEmptyState',
|
|
5
|
+
component: DXEmptyState,
|
|
6
|
+
tags: ['autodocs'],
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export const Default = {
|
|
10
|
+
args: {
|
|
11
|
+
title: 'No items found',
|
|
12
|
+
description: 'Get started by creating your first item.',
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export const NoResults = {
|
|
17
|
+
args: {
|
|
18
|
+
title: 'No results',
|
|
19
|
+
description: 'Try adjusting your search or filter to find what you\'re looking for.',
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export const WithAction = {
|
|
24
|
+
render: () => ({
|
|
25
|
+
components: { DXEmptyState },
|
|
26
|
+
template: `
|
|
27
|
+
<DXEmptyState title="No projects yet" description="Create your first project to get started.">
|
|
28
|
+
<template #action>
|
|
29
|
+
<button class="px-4 py-2 bg-slate-900 text-white rounded-xl text-sm font-semibold">
|
|
30
|
+
Create Project
|
|
31
|
+
</button>
|
|
32
|
+
</template>
|
|
33
|
+
</DXEmptyState>
|
|
34
|
+
`,
|
|
35
|
+
}),
|
|
36
|
+
};
|
|
37
|
+
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
class="bg-white border border-slate-100 rounded-3xl shadow-sm p-8 text-center space-y-3"
|
|
4
|
+
data-component="DXEmptyState"
|
|
5
|
+
>
|
|
6
|
+
<component
|
|
7
|
+
:is="icon"
|
|
8
|
+
class="w-10 h-10 text-slate-500 mx-auto"
|
|
9
|
+
:class="animated && 'animate-bounce-slow'"
|
|
10
|
+
/>
|
|
11
|
+
<p class="text-base font-semibold text-slate-900">{{ title }}</p>
|
|
12
|
+
<p v-if="description" class="text-sm text-slate-600">{{ description }}</p>
|
|
13
|
+
<slot name="action" />
|
|
14
|
+
</div>
|
|
15
|
+
</template>
|
|
16
|
+
|
|
17
|
+
<script setup>
|
|
18
|
+
defineProps({
|
|
19
|
+
/** Иконка (компонент) */
|
|
20
|
+
icon: { type: [Object, Function], required: true },
|
|
21
|
+
/** Заголовок */
|
|
22
|
+
title: { type: String, required: true },
|
|
23
|
+
/** Описание */
|
|
24
|
+
description: { type: String, default: "" },
|
|
25
|
+
/** Анимация иконки */
|
|
26
|
+
animated: { type: Boolean, default: false },
|
|
27
|
+
});
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
<style scoped>
|
|
31
|
+
@keyframes bounce-slow {
|
|
32
|
+
0%, 100% { transform: translate(0, 0) rotate(0deg); }
|
|
33
|
+
25% { transform: translate(-2px, -1px) rotate(-3deg); }
|
|
34
|
+
50% { transform: translate(2px, 1px) rotate(3deg); }
|
|
35
|
+
75% { transform: translate(-1px, 1.5px) rotate(-2deg); }
|
|
36
|
+
}
|
|
37
|
+
.animate-bounce-slow {
|
|
38
|
+
animation: bounce-slow 3.2s infinite ease-in-out;
|
|
39
|
+
}
|
|
40
|
+
</style>
|
|
41
|
+
|
|
@@ -0,0 +1,378 @@
|
|
|
1
|
+
import { ref } from 'vue';
|
|
2
|
+
import DXFormWizard from './DXFormWizard.vue';
|
|
3
|
+
import DXFormControl from '../../molecules/DXFormControl/DXFormControl.vue';
|
|
4
|
+
import DXInput from '../../molecules/DXInput/DXInput.vue';
|
|
5
|
+
import DXSelect from '../../molecules/DXSelect/DXSelect.vue';
|
|
6
|
+
import DXTextarea from '../../molecules/DXTextarea/DXTextarea.vue';
|
|
7
|
+
import DXButton from '../../atoms/DXButton/DXButton.vue';
|
|
8
|
+
|
|
9
|
+
const defaultSteps = [
|
|
10
|
+
{ id: 1, title: 'Личная информация', description: 'Основные данные' },
|
|
11
|
+
{ id: 2, title: 'Работа', description: 'Профессиональная информация' },
|
|
12
|
+
{ id: 3, title: 'Дополнительно', description: 'Дополнительные сведения' },
|
|
13
|
+
];
|
|
14
|
+
|
|
15
|
+
export default {
|
|
16
|
+
title: 'Organisms/DXFormWizard',
|
|
17
|
+
component: DXFormWizard,
|
|
18
|
+
tags: ['autodocs'],
|
|
19
|
+
parameters: {
|
|
20
|
+
docs: {
|
|
21
|
+
description: {
|
|
22
|
+
component: `
|
|
23
|
+
# DXFormWizard
|
|
24
|
+
|
|
25
|
+
Многошаговая форма с индикатором прогресса и валидацией на каждом шаге.
|
|
26
|
+
|
|
27
|
+
## Назначение
|
|
28
|
+
|
|
29
|
+
DXFormWizard предоставляет структуру для создания многошаговых форм с навигацией,
|
|
30
|
+
валидацией и индикатором прогресса. Используется для регистрации, настройки профиля,
|
|
31
|
+
оформления заказов и других многоэтапных процессов.
|
|
32
|
+
|
|
33
|
+
## Архитектура
|
|
34
|
+
|
|
35
|
+
### Использует
|
|
36
|
+
- \`DXProgress\` - для индикатора прогресса
|
|
37
|
+
- \`DXButton\` - для навигации
|
|
38
|
+
- \`DXFormControl\` - для полей формы
|
|
39
|
+
- \`useClassComposition\` composable - для стилей
|
|
40
|
+
|
|
41
|
+
### Используется в
|
|
42
|
+
- Регистрация пользователей
|
|
43
|
+
- Настройка профиля
|
|
44
|
+
- Оформление заказа
|
|
45
|
+
- Мастер настройки приложения
|
|
46
|
+
|
|
47
|
+
## Внутренняя логика
|
|
48
|
+
|
|
49
|
+
### Навигация
|
|
50
|
+
- **tabs**: Навигация в виде вкладок
|
|
51
|
+
- **steps**: Навигация в виде шагов с соединительными линиями
|
|
52
|
+
- **dots**: Навигация в виде точек (будущая реализация)
|
|
53
|
+
- **none**: Без визуальной навигации
|
|
54
|
+
|
|
55
|
+
### Валидация
|
|
56
|
+
Можно указать функцию валидации для каждого шага через prop \`validation\`.
|
|
57
|
+
Валидация проверяется перед переходом на следующий шаг.
|
|
58
|
+
|
|
59
|
+
### Пропуск шагов
|
|
60
|
+
При \`allowSkip={true}\` можно переходить на любые шаги.
|
|
61
|
+
При \`allowSkip={false}\` можно переходить только на следующие шаги.
|
|
62
|
+
|
|
63
|
+
## Особенности
|
|
64
|
+
|
|
65
|
+
### Slots
|
|
66
|
+
- \`step-{n}\` - контент для каждого шага (step-1, step-2, ...)
|
|
67
|
+
- \`navigation\` - кастомная навигация
|
|
68
|
+
|
|
69
|
+
### Анимации
|
|
70
|
+
Переходы между шагами анимируются через Vue Transition.
|
|
71
|
+
`,
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
argTypes: {
|
|
76
|
+
currentStep: {
|
|
77
|
+
control: 'number',
|
|
78
|
+
min: 0,
|
|
79
|
+
max: 2,
|
|
80
|
+
description: 'Текущий шаг (0-based, v-model).',
|
|
81
|
+
table: {
|
|
82
|
+
type: { summary: 'number' },
|
|
83
|
+
defaultValue: { summary: '0' },
|
|
84
|
+
category: 'Behavior',
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
navigationStyle: {
|
|
88
|
+
control: 'select',
|
|
89
|
+
options: ['tabs', 'steps', 'dots', 'none'],
|
|
90
|
+
description: 'Стиль навигации: tabs | steps | dots | none.',
|
|
91
|
+
table: {
|
|
92
|
+
type: { summary: 'string' },
|
|
93
|
+
defaultValue: { summary: 'steps' },
|
|
94
|
+
category: 'Appearance',
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
showProgress: {
|
|
98
|
+
control: 'boolean',
|
|
99
|
+
description: 'Показывать индикатор прогресса.',
|
|
100
|
+
table: {
|
|
101
|
+
type: { summary: 'boolean' },
|
|
102
|
+
defaultValue: { summary: 'true' },
|
|
103
|
+
category: 'Appearance',
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
allowSkip: {
|
|
107
|
+
control: 'boolean',
|
|
108
|
+
description: 'Разрешить пропуск шагов.',
|
|
109
|
+
table: {
|
|
110
|
+
type: { summary: 'boolean' },
|
|
111
|
+
defaultValue: { summary: 'false' },
|
|
112
|
+
category: 'Behavior',
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
export const Default = {
|
|
119
|
+
args: {
|
|
120
|
+
currentStep: 0,
|
|
121
|
+
steps: defaultSteps,
|
|
122
|
+
navigationStyle: 'steps',
|
|
123
|
+
},
|
|
124
|
+
parameters: {
|
|
125
|
+
docs: {
|
|
126
|
+
description: {
|
|
127
|
+
story: 'Базовая многошаговая форма с навигацией в стиле steps.',
|
|
128
|
+
},
|
|
129
|
+
},
|
|
130
|
+
},
|
|
131
|
+
render: (args) => ({
|
|
132
|
+
components: { DXFormWizard, DXFormControl, DXInput, DXSelect, DXTextarea },
|
|
133
|
+
setup() {
|
|
134
|
+
const currentStep = ref(args.currentStep);
|
|
135
|
+
const formData = ref({
|
|
136
|
+
name: '',
|
|
137
|
+
email: '',
|
|
138
|
+
company: '',
|
|
139
|
+
position: '',
|
|
140
|
+
bio: '',
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
const positions = ref([
|
|
144
|
+
{ value: 'developer', label: 'Разработчик' },
|
|
145
|
+
{ value: 'designer', label: 'Дизайнер' },
|
|
146
|
+
{ value: 'manager', label: 'Менеджер' },
|
|
147
|
+
]);
|
|
148
|
+
|
|
149
|
+
return { args, currentStep, formData, positions };
|
|
150
|
+
},
|
|
151
|
+
template: `
|
|
152
|
+
<DXFormWizard
|
|
153
|
+
v-model:current-step="currentStep"
|
|
154
|
+
v-bind="args"
|
|
155
|
+
:form-data="formData"
|
|
156
|
+
>
|
|
157
|
+
<template #step-1>
|
|
158
|
+
<div class="space-y-4">
|
|
159
|
+
<DXFormControl label="Имя" required>
|
|
160
|
+
<DXInput v-model="formData.name" placeholder="Введите имя" />
|
|
161
|
+
</DXFormControl>
|
|
162
|
+
<DXFormControl label="Email" required>
|
|
163
|
+
<DXInput v-model="formData.email" type="email" placeholder="Введите email" />
|
|
164
|
+
</DXFormControl>
|
|
165
|
+
</div>
|
|
166
|
+
</template>
|
|
167
|
+
|
|
168
|
+
<template #step-2>
|
|
169
|
+
<div class="space-y-4">
|
|
170
|
+
<DXFormControl label="Компания">
|
|
171
|
+
<DXInput v-model="formData.company" placeholder="Введите название компании" />
|
|
172
|
+
</DXFormControl>
|
|
173
|
+
<DXFormControl label="Должность">
|
|
174
|
+
<DXSelect v-model="formData.position" :options="positions" placeholder="Выберите должность" />
|
|
175
|
+
</DXFormControl>
|
|
176
|
+
</div>
|
|
177
|
+
</template>
|
|
178
|
+
|
|
179
|
+
<template #step-3>
|
|
180
|
+
<div class="space-y-4">
|
|
181
|
+
<DXFormControl label="О себе">
|
|
182
|
+
<DXTextarea v-model="formData.bio" rows="5" placeholder="Расскажите о себе" />
|
|
183
|
+
</DXFormControl>
|
|
184
|
+
</div>
|
|
185
|
+
</template>
|
|
186
|
+
</DXFormWizard>
|
|
187
|
+
`,
|
|
188
|
+
}),
|
|
189
|
+
};
|
|
190
|
+
|
|
191
|
+
export const WithValidation = {
|
|
192
|
+
parameters: {
|
|
193
|
+
docs: {
|
|
194
|
+
description: {
|
|
195
|
+
story: 'Форма с валидацией на каждом шаге. Переход на следующий шаг возможен только при валидных данных.',
|
|
196
|
+
},
|
|
197
|
+
},
|
|
198
|
+
},
|
|
199
|
+
render: () => ({
|
|
200
|
+
components: { DXFormWizard, DXFormControl, DXInput },
|
|
201
|
+
setup() {
|
|
202
|
+
const currentStep = ref(0);
|
|
203
|
+
const formData = ref({
|
|
204
|
+
name: '',
|
|
205
|
+
email: '',
|
|
206
|
+
});
|
|
207
|
+
|
|
208
|
+
const steps = ref(defaultSteps);
|
|
209
|
+
|
|
210
|
+
const validation = (stepIndex, data) => {
|
|
211
|
+
if (stepIndex === 0) {
|
|
212
|
+
return data.name && data.email;
|
|
213
|
+
}
|
|
214
|
+
return true;
|
|
215
|
+
};
|
|
216
|
+
|
|
217
|
+
const handleSubmit = (data) => {
|
|
218
|
+
console.log('Форма отправлена:', data);
|
|
219
|
+
};
|
|
220
|
+
|
|
221
|
+
return { currentStep, formData, steps, validation, handleSubmit };
|
|
222
|
+
},
|
|
223
|
+
template: `
|
|
224
|
+
<DXFormWizard
|
|
225
|
+
v-model:current-step="currentStep"
|
|
226
|
+
:steps="steps"
|
|
227
|
+
:form-data="formData"
|
|
228
|
+
:validation="validation"
|
|
229
|
+
@submit="handleSubmit"
|
|
230
|
+
>
|
|
231
|
+
<template #step-1>
|
|
232
|
+
<div class="space-y-4">
|
|
233
|
+
<DXFormControl label="Имя" required>
|
|
234
|
+
<DXInput v-model="formData.name" placeholder="Введите имя" />
|
|
235
|
+
</DXFormControl>
|
|
236
|
+
<DXFormControl label="Email" required>
|
|
237
|
+
<DXInput v-model="formData.email" type="email" placeholder="Введите email" />
|
|
238
|
+
</DXFormControl>
|
|
239
|
+
<p class="text-sm text-slate-500">Заполните все поля для продолжения</p>
|
|
240
|
+
</div>
|
|
241
|
+
</template>
|
|
242
|
+
|
|
243
|
+
<template #step-2>
|
|
244
|
+
<div class="space-y-4">
|
|
245
|
+
<p class="text-slate-600">Шаг 2: Работа</p>
|
|
246
|
+
</div>
|
|
247
|
+
</template>
|
|
248
|
+
|
|
249
|
+
<template #step-3>
|
|
250
|
+
<div class="space-y-4">
|
|
251
|
+
<p class="text-slate-600">Шаг 3: Дополнительно</p>
|
|
252
|
+
</div>
|
|
253
|
+
</template>
|
|
254
|
+
</DXFormWizard>
|
|
255
|
+
`,
|
|
256
|
+
}),
|
|
257
|
+
};
|
|
258
|
+
|
|
259
|
+
export const TabsNavigation = {
|
|
260
|
+
args: {
|
|
261
|
+
currentStep: 0,
|
|
262
|
+
steps: defaultSteps,
|
|
263
|
+
navigationStyle: 'tabs',
|
|
264
|
+
},
|
|
265
|
+
parameters: {
|
|
266
|
+
docs: {
|
|
267
|
+
description: {
|
|
268
|
+
story: 'Навигация в стиле tabs. Шаги отображаются как вкладки.',
|
|
269
|
+
},
|
|
270
|
+
},
|
|
271
|
+
},
|
|
272
|
+
render: (args) => ({
|
|
273
|
+
components: { DXFormWizard, DXFormControl, DXInput },
|
|
274
|
+
setup() {
|
|
275
|
+
const currentStep = ref(args.currentStep);
|
|
276
|
+
const formData = ref({ name: '', email: '' });
|
|
277
|
+
return { args, currentStep, formData };
|
|
278
|
+
},
|
|
279
|
+
template: `
|
|
280
|
+
<DXFormWizard
|
|
281
|
+
v-model:current-step="currentStep"
|
|
282
|
+
v-bind="args"
|
|
283
|
+
:form-data="formData"
|
|
284
|
+
>
|
|
285
|
+
<template #step-1>
|
|
286
|
+
<DXFormControl label="Имя">
|
|
287
|
+
<DXInput v-model="formData.name" />
|
|
288
|
+
</DXFormControl>
|
|
289
|
+
</template>
|
|
290
|
+
<template #step-2>
|
|
291
|
+
<DXFormControl label="Email">
|
|
292
|
+
<DXInput v-model="formData.email" />
|
|
293
|
+
</DXFormControl>
|
|
294
|
+
</template>
|
|
295
|
+
<template #step-3>
|
|
296
|
+
<p>Шаг 3</p>
|
|
297
|
+
</template>
|
|
298
|
+
</DXFormWizard>
|
|
299
|
+
`,
|
|
300
|
+
}),
|
|
301
|
+
};
|
|
302
|
+
|
|
303
|
+
export const AllowSkip = {
|
|
304
|
+
args: {
|
|
305
|
+
currentStep: 0,
|
|
306
|
+
steps: defaultSteps,
|
|
307
|
+
allowSkip: true,
|
|
308
|
+
},
|
|
309
|
+
parameters: {
|
|
310
|
+
docs: {
|
|
311
|
+
description: {
|
|
312
|
+
story: 'Форма с разрешенным пропуском шагов. Можно переходить на любые шаги.',
|
|
313
|
+
},
|
|
314
|
+
},
|
|
315
|
+
},
|
|
316
|
+
render: (args) => ({
|
|
317
|
+
components: { DXFormWizard },
|
|
318
|
+
setup() {
|
|
319
|
+
const currentStep = ref(args.currentStep);
|
|
320
|
+
return { args, currentStep };
|
|
321
|
+
},
|
|
322
|
+
template: `
|
|
323
|
+
<DXFormWizard
|
|
324
|
+
v-model:current-step="currentStep"
|
|
325
|
+
v-bind="args"
|
|
326
|
+
>
|
|
327
|
+
<template #step-1>
|
|
328
|
+
<p>Шаг 1</p>
|
|
329
|
+
</template>
|
|
330
|
+
<template #step-2>
|
|
331
|
+
<p>Шаг 2</p>
|
|
332
|
+
</template>
|
|
333
|
+
<template #step-3>
|
|
334
|
+
<p>Шаг 3</p>
|
|
335
|
+
</template>
|
|
336
|
+
</DXFormWizard>
|
|
337
|
+
`,
|
|
338
|
+
}),
|
|
339
|
+
};
|
|
340
|
+
|
|
341
|
+
export const CustomNavigation = {
|
|
342
|
+
parameters: {
|
|
343
|
+
docs: {
|
|
344
|
+
description: {
|
|
345
|
+
story: 'Форма с кастомной навигацией через slot navigation.',
|
|
346
|
+
},
|
|
347
|
+
},
|
|
348
|
+
},
|
|
349
|
+
render: () => ({
|
|
350
|
+
components: { DXFormWizard, DXButton },
|
|
351
|
+
setup() {
|
|
352
|
+
const currentStep = ref(0);
|
|
353
|
+
return { currentStep, defaultSteps };
|
|
354
|
+
},
|
|
355
|
+
template: `
|
|
356
|
+
<DXFormWizard
|
|
357
|
+
v-model:current-step="currentStep"
|
|
358
|
+
:steps="defaultSteps"
|
|
359
|
+
>
|
|
360
|
+
<template #step-1>
|
|
361
|
+
<p>Контент шага 1</p>
|
|
362
|
+
</template>
|
|
363
|
+
<template #step-2>
|
|
364
|
+
<p>Контент шага 2</p>
|
|
365
|
+
</template>
|
|
366
|
+
<template #navigation="{ canGoNext, canGoPrev, goNext, goPrev }">
|
|
367
|
+
<div class="flex justify-between">
|
|
368
|
+
<DXButton v-if="canGoPrev" @click="goPrev">Назад</DXButton>
|
|
369
|
+
<div v-else></div>
|
|
370
|
+
<DXButton v-if="canGoNext" variant="primary" @click="goNext">Далее</DXButton>
|
|
371
|
+
<DXButton v-else variant="primary">Завершить</DXButton>
|
|
372
|
+
</div>
|
|
373
|
+
</template>
|
|
374
|
+
</DXFormWizard>
|
|
375
|
+
`,
|
|
376
|
+
}),
|
|
377
|
+
};
|
|
378
|
+
|