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,460 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
:class="layoutClasses"
|
|
4
|
+
v-bind="dataAttrs"
|
|
5
|
+
>
|
|
6
|
+
<!-- Header -->
|
|
7
|
+
<header v-if="$slots.header" :class="headerClasses">
|
|
8
|
+
<slot name="header" />
|
|
9
|
+
</header>
|
|
10
|
+
|
|
11
|
+
<!-- Main Layout Container -->
|
|
12
|
+
<div :class="mainContainerClasses">
|
|
13
|
+
<!-- Sidebar -->
|
|
14
|
+
<aside
|
|
15
|
+
v-if="$slots.sidebar && variant !== 'minimal'"
|
|
16
|
+
:class="sidebarClasses"
|
|
17
|
+
:style="sidebarStyles"
|
|
18
|
+
>
|
|
19
|
+
<slot name="sidebar" />
|
|
20
|
+
</aside>
|
|
21
|
+
|
|
22
|
+
<!-- Backdrop для overlay режима -->
|
|
23
|
+
<DXBackdrop
|
|
24
|
+
v-if="showBackdrop"
|
|
25
|
+
:show="showBackdrop"
|
|
26
|
+
:blur="backdropBlur"
|
|
27
|
+
:z-index="'20'"
|
|
28
|
+
:dismissible="true"
|
|
29
|
+
@close="closeSidebar"
|
|
30
|
+
/>
|
|
31
|
+
|
|
32
|
+
<!-- Content Area - для split варианта -->
|
|
33
|
+
<template v-if="variant === 'split'">
|
|
34
|
+
<main :class="splitContentClasses" :style="splitContentStyles">
|
|
35
|
+
<slot name="content-left">
|
|
36
|
+
<div :class="defaultContentClasses">
|
|
37
|
+
<p class="text-slate-500">Левая панель не указана</p>
|
|
38
|
+
</div>
|
|
39
|
+
</slot>
|
|
40
|
+
</main>
|
|
41
|
+
<div class="w-px bg-slate-200 flex-shrink-0" v-if="$slots['content-left'] && $slots['content-right']"></div>
|
|
42
|
+
<main :class="splitContentClasses" :style="splitContentStyles">
|
|
43
|
+
<slot name="content-right">
|
|
44
|
+
<div :class="defaultContentClasses">
|
|
45
|
+
<p class="text-slate-500">Правая панель не указана</p>
|
|
46
|
+
</div>
|
|
47
|
+
</slot>
|
|
48
|
+
</main>
|
|
49
|
+
</template>
|
|
50
|
+
|
|
51
|
+
<!-- Content Area - для остальных вариантов -->
|
|
52
|
+
<main v-else :class="contentClasses" :style="contentStyles">
|
|
53
|
+
<slot name="content">
|
|
54
|
+
<div :class="defaultContentClasses">
|
|
55
|
+
<p class="text-slate-500">Контент не указан</p>
|
|
56
|
+
</div>
|
|
57
|
+
</slot>
|
|
58
|
+
</main>
|
|
59
|
+
</div>
|
|
60
|
+
|
|
61
|
+
<!-- Footer -->
|
|
62
|
+
<footer v-if="$slots.footer && variant !== 'minimal'" :class="footerClasses">
|
|
63
|
+
<slot name="footer" />
|
|
64
|
+
</footer>
|
|
65
|
+
</div>
|
|
66
|
+
</template>
|
|
67
|
+
|
|
68
|
+
<script setup>
|
|
69
|
+
import { computed, watch, ref, onMounted } from "vue";
|
|
70
|
+
import { useClassComposition } from "@/composables/useClassComposition";
|
|
71
|
+
import { useSpacing } from "@/composables/useSpacing";
|
|
72
|
+
import { useCustomDataAttributes } from "@/composables/useDataAttributes";
|
|
73
|
+
import DXBackdrop from "../../atoms/DXBackdrop/DXBackdrop.vue";
|
|
74
|
+
|
|
75
|
+
const props = defineProps({
|
|
76
|
+
/**
|
|
77
|
+
* Вариант layout для разных задач приложения.
|
|
78
|
+
* - `dashboard`: Для дашбордов с множеством виджетов (полнофункциональный header и sidebar)
|
|
79
|
+
* - `content`: Для блогов, статей, документации (минималистичный header, широкий контент)
|
|
80
|
+
* - `minimal`: Для простых приложений (только header и content, без sidebar и footer)
|
|
81
|
+
* - `split`: Для приложений с двумя панелями (редакторы, сравнение)
|
|
82
|
+
* - `tabbed`: Для приложений с вкладками (header с табами, переключаемый контент)
|
|
83
|
+
* @type {'dashboard'|'content'|'minimal'|'split'|'tabbed'}
|
|
84
|
+
* @default 'dashboard'
|
|
85
|
+
* @category Layout
|
|
86
|
+
*/
|
|
87
|
+
variant: {
|
|
88
|
+
type: String,
|
|
89
|
+
default: "dashboard",
|
|
90
|
+
validator: (v) => ["dashboard", "content", "minimal", "split", "tabbed"].includes(v),
|
|
91
|
+
},
|
|
92
|
+
/**
|
|
93
|
+
* Режим отображения сайдбара.
|
|
94
|
+
* - `overlay`: Сайдбар накладывается поверх контента с backdrop
|
|
95
|
+
* - `push`: Сайдбар сдвигает контент вправо
|
|
96
|
+
* - `static`: Сайдбар в обычном потоке документа
|
|
97
|
+
* @type {'overlay'|'push'|'static'}
|
|
98
|
+
* @default 'static'
|
|
99
|
+
* @category Sidebar
|
|
100
|
+
*/
|
|
101
|
+
sidebarMode: {
|
|
102
|
+
type: String,
|
|
103
|
+
default: "static",
|
|
104
|
+
validator: (v) => ["overlay", "push", "static"].includes(v),
|
|
105
|
+
},
|
|
106
|
+
/**
|
|
107
|
+
* Свернут ли сайдбар. В свернутом состоянии отображаются только иконки.
|
|
108
|
+
* @type {boolean}
|
|
109
|
+
* @default false
|
|
110
|
+
* @category Sidebar
|
|
111
|
+
*/
|
|
112
|
+
sidebarCollapsed: { type: Boolean, default: false },
|
|
113
|
+
/**
|
|
114
|
+
* Ширина сайдбара в пикселях, когда он развернут.
|
|
115
|
+
* @type {number}
|
|
116
|
+
* @default 256
|
|
117
|
+
* @category Sidebar
|
|
118
|
+
*/
|
|
119
|
+
sidebarWidth: { type: Number, default: 256 },
|
|
120
|
+
/**
|
|
121
|
+
* Ширина сайдбара в пикселях, когда он свернут.
|
|
122
|
+
* @type {number}
|
|
123
|
+
* @default 64
|
|
124
|
+
* @category Sidebar
|
|
125
|
+
*/
|
|
126
|
+
sidebarCollapsedWidth: { type: Number, default: 64 },
|
|
127
|
+
/**
|
|
128
|
+
* Показывать сайдбар на мобильных устройствах.
|
|
129
|
+
* По умолчанию сайдбар скрыт на мобильных (кроме overlay режима).
|
|
130
|
+
* @type {boolean}
|
|
131
|
+
* @default false
|
|
132
|
+
* @category Sidebar
|
|
133
|
+
*/
|
|
134
|
+
showSidebarOnMobile: { type: Boolean, default: false },
|
|
135
|
+
/**
|
|
136
|
+
* Уровень размытия backdrop для overlay режима.
|
|
137
|
+
* Используется только когда sidebarMode === "overlay".
|
|
138
|
+
* @type {'none'|'sm'|'md'|'lg'|'xl'}
|
|
139
|
+
* @default 'sm'
|
|
140
|
+
* @category Sidebar
|
|
141
|
+
*/
|
|
142
|
+
backdropBlur: { type: String, default: "sm", validator: (v) => ["none", "sm", "md", "lg", "xl"].includes(v) },
|
|
143
|
+
/**
|
|
144
|
+
* Отступы header секции. Использует систему spacing из useSpacing composable.
|
|
145
|
+
* @type {'none'|'xs'|'sm'|'md'|'lg'|'xl'}
|
|
146
|
+
* @default ''
|
|
147
|
+
* @category Spacing
|
|
148
|
+
*/
|
|
149
|
+
headerPadding: { type: String, default: "" },
|
|
150
|
+
/**
|
|
151
|
+
* Отступы контентной области. Использует систему spacing из useSpacing composable.
|
|
152
|
+
* @type {'none'|'xs'|'sm'|'md'|'lg'|'xl'}
|
|
153
|
+
* @default ''
|
|
154
|
+
* @category Spacing
|
|
155
|
+
*/
|
|
156
|
+
contentPadding: { type: String, default: "" },
|
|
157
|
+
/**
|
|
158
|
+
* Отступы sidebar секции. Использует систему spacing из useSpacing composable.
|
|
159
|
+
* @type {'none'|'xs'|'sm'|'md'|'lg'|'xl'}
|
|
160
|
+
* @default ''
|
|
161
|
+
* @category Spacing
|
|
162
|
+
*/
|
|
163
|
+
sidebarPadding: { type: String, default: "" },
|
|
164
|
+
/**
|
|
165
|
+
* Отступы footer секции. Использует систему spacing из useSpacing composable.
|
|
166
|
+
* @type {'none'|'xs'|'sm'|'md'|'lg'|'xl'}
|
|
167
|
+
* @default ''
|
|
168
|
+
* @category Spacing
|
|
169
|
+
*/
|
|
170
|
+
footerPadding: { type: String, default: "" },
|
|
171
|
+
});
|
|
172
|
+
|
|
173
|
+
const emit = defineEmits(["sidebar-toggle", "sidebar-collapse"]);
|
|
174
|
+
|
|
175
|
+
// Флаг для отключения backdrop в Storybook документации
|
|
176
|
+
const isStorybookDocs = ref(false);
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* Data-атрибуты для компонента
|
|
180
|
+
*
|
|
181
|
+
* @description
|
|
182
|
+
* Генерирует data-атрибуты для отладки и тестирования используя useCustomDataAttributes.
|
|
183
|
+
*
|
|
184
|
+
* @returns {Object} Объект с data-атрибутами
|
|
185
|
+
*/
|
|
186
|
+
const dataAttrs = computed(() =>
|
|
187
|
+
useCustomDataAttributes({
|
|
188
|
+
component: "DXAppLayout",
|
|
189
|
+
variant: props.variant,
|
|
190
|
+
sidebarMode: props.sidebarMode,
|
|
191
|
+
sidebarCollapsed: props.sidebarCollapsed,
|
|
192
|
+
})
|
|
193
|
+
);
|
|
194
|
+
|
|
195
|
+
onMounted(() => {
|
|
196
|
+
// Проверяем, находимся ли мы в Storybook документации
|
|
197
|
+
if (typeof window !== 'undefined') {
|
|
198
|
+
isStorybookDocs.value = !!(
|
|
199
|
+
document.querySelector('.docs-story') ||
|
|
200
|
+
document.querySelector('[data-storybook-docs]') ||
|
|
201
|
+
document.querySelector('.sbdocs') ||
|
|
202
|
+
window.location.pathname.includes('/docs/')
|
|
203
|
+
);
|
|
204
|
+
}
|
|
205
|
+
});
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* Показывать ли backdrop
|
|
209
|
+
*
|
|
210
|
+
* @description
|
|
211
|
+
* Backdrop показывается только в overlay режиме и когда сайдбар открыт на мобильных.
|
|
212
|
+
* В Storybook документации backdrop отключается, чтобы не перекрывать документацию.
|
|
213
|
+
*
|
|
214
|
+
* @returns {boolean} true если нужно показать backdrop
|
|
215
|
+
*/
|
|
216
|
+
const showBackdrop = computed(() => {
|
|
217
|
+
// Отключаем backdrop в Storybook документации
|
|
218
|
+
if (isStorybookDocs.value) {
|
|
219
|
+
return false;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
return props.sidebarMode === "overlay" && !props.sidebarCollapsed;
|
|
223
|
+
});
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* Классы для основного контейнера layout
|
|
227
|
+
*
|
|
228
|
+
* @description
|
|
229
|
+
* Вычисляет классы для корневого контейнера DXAppLayout с учетом варианта.
|
|
230
|
+
*
|
|
231
|
+
* @returns {Array} Массив классов
|
|
232
|
+
*/
|
|
233
|
+
const layoutClasses = computed(() =>
|
|
234
|
+
useClassComposition(
|
|
235
|
+
"flex flex-col h-screen w-full bg-slate-50",
|
|
236
|
+
{
|
|
237
|
+
// Для content варианта - более светлый фон для читаемости
|
|
238
|
+
"bg-white": props.variant === "content",
|
|
239
|
+
// Для minimal варианта - минималистичный фон
|
|
240
|
+
"bg-slate-50": props.variant === "minimal",
|
|
241
|
+
}
|
|
242
|
+
)
|
|
243
|
+
);
|
|
244
|
+
|
|
245
|
+
/**
|
|
246
|
+
* Классы для header
|
|
247
|
+
*
|
|
248
|
+
* @description
|
|
249
|
+
* Вычисляет классы для header секции с учетом варианта layout и отступов.
|
|
250
|
+
*
|
|
251
|
+
* @returns {Array} Массив классов
|
|
252
|
+
*/
|
|
253
|
+
const headerClasses = computed(() => {
|
|
254
|
+
const paddingClass = props.headerPadding ? useSpacing(props.headerPadding, 'padding') : null;
|
|
255
|
+
return useClassComposition(
|
|
256
|
+
"flex-shrink-0 z-30",
|
|
257
|
+
paddingClass
|
|
258
|
+
);
|
|
259
|
+
});
|
|
260
|
+
|
|
261
|
+
/**
|
|
262
|
+
* Классы для sidebar
|
|
263
|
+
*
|
|
264
|
+
* @description
|
|
265
|
+
* Вычисляет классы для sidebar в зависимости от режима, состояния и варианта layout.
|
|
266
|
+
*
|
|
267
|
+
* @returns {Array} Массив классов
|
|
268
|
+
*/
|
|
269
|
+
const sidebarClasses = computed(() => {
|
|
270
|
+
const paddingClass = props.sidebarPadding ? useSpacing(props.sidebarPadding, 'padding') : null;
|
|
271
|
+
|
|
272
|
+
return useClassComposition(
|
|
273
|
+
"flex-shrink-0 bg-white border-r border-slate-200 transition-all duration-300 z-20",
|
|
274
|
+
paddingClass,
|
|
275
|
+
{
|
|
276
|
+
// Overlay режим: фиксированная позиция
|
|
277
|
+
"fixed inset-y-0 left-0": props.sidebarMode === "overlay",
|
|
278
|
+
// Push режим: обычный поток, но с transition
|
|
279
|
+
"relative": props.sidebarMode === "push",
|
|
280
|
+
// Static режим: обычный поток
|
|
281
|
+
"relative": props.sidebarMode === "static",
|
|
282
|
+
// Скрытие на мобильных (если не showSidebarOnMobile)
|
|
283
|
+
"hidden md:flex": !props.showSidebarOnMobile && props.sidebarMode !== "overlay",
|
|
284
|
+
// Показ на мобильных только в overlay режиме
|
|
285
|
+
"md:flex": props.showSidebarOnMobile || props.sidebarMode === "overlay",
|
|
286
|
+
// Для content и minimal вариантов sidebar скрыт по умолчанию
|
|
287
|
+
"hidden": (props.variant === "content" || props.variant === "minimal") && props.sidebarMode !== "overlay",
|
|
288
|
+
// Для content варианта sidebar всегда в overlay режиме
|
|
289
|
+
"md:hidden": props.variant === "content" && props.sidebarMode === "overlay",
|
|
290
|
+
}
|
|
291
|
+
);
|
|
292
|
+
});
|
|
293
|
+
|
|
294
|
+
/**
|
|
295
|
+
* Стили для sidebar
|
|
296
|
+
*
|
|
297
|
+
* @description
|
|
298
|
+
* Вычисляет ширину sidebar в зависимости от состояния (свернут/развернут).
|
|
299
|
+
*
|
|
300
|
+
* @returns {Object} Объект со стилями
|
|
301
|
+
*/
|
|
302
|
+
const sidebarStyles = computed(() => {
|
|
303
|
+
const width = props.sidebarCollapsed
|
|
304
|
+
? props.sidebarCollapsedWidth
|
|
305
|
+
: props.sidebarWidth;
|
|
306
|
+
|
|
307
|
+
return {
|
|
308
|
+
width: `${width}px`,
|
|
309
|
+
minWidth: `${width}px`,
|
|
310
|
+
maxWidth: `${width}px`,
|
|
311
|
+
};
|
|
312
|
+
});
|
|
313
|
+
|
|
314
|
+
/**
|
|
315
|
+
* Классы для основного контейнера (main container)
|
|
316
|
+
*
|
|
317
|
+
* @description
|
|
318
|
+
* Вычисляет классы для контейнера, содержащего sidebar и content.
|
|
319
|
+
*
|
|
320
|
+
* @returns {Array} Массив классов
|
|
321
|
+
*/
|
|
322
|
+
const mainContainerClasses = computed(() =>
|
|
323
|
+
useClassComposition(
|
|
324
|
+
"flex flex-1 overflow-hidden",
|
|
325
|
+
{
|
|
326
|
+
// Для split варианта - горизонтальное разделение
|
|
327
|
+
"flex-row": props.variant === "split",
|
|
328
|
+
}
|
|
329
|
+
)
|
|
330
|
+
);
|
|
331
|
+
|
|
332
|
+
/**
|
|
333
|
+
* Классы для контентной области
|
|
334
|
+
*
|
|
335
|
+
* @description
|
|
336
|
+
* Вычисляет классы для main контентной области с учетом варианта layout и отступов.
|
|
337
|
+
* В push режиме добавляется margin-left для компенсации sidebar.
|
|
338
|
+
*
|
|
339
|
+
* @returns {Array} Массив классов
|
|
340
|
+
*/
|
|
341
|
+
const contentClasses = computed(() => {
|
|
342
|
+
const paddingClass = props.contentPadding ? useSpacing(props.contentPadding, 'padding') : null;
|
|
343
|
+
|
|
344
|
+
return useClassComposition(
|
|
345
|
+
"flex-1 overflow-y-auto",
|
|
346
|
+
paddingClass,
|
|
347
|
+
{
|
|
348
|
+
// В push режиме добавляем margin для компенсации sidebar
|
|
349
|
+
"transition-all duration-300": props.sidebarMode === "push",
|
|
350
|
+
// Для content варианта - максимальная ширина для читаемости
|
|
351
|
+
"max-w-full": props.variant === "content",
|
|
352
|
+
}
|
|
353
|
+
);
|
|
354
|
+
});
|
|
355
|
+
|
|
356
|
+
/**
|
|
357
|
+
* Классы для split контентных областей
|
|
358
|
+
*
|
|
359
|
+
* @description
|
|
360
|
+
* Вычисляет классы для левой и правой панелей в split варианте.
|
|
361
|
+
*
|
|
362
|
+
* @returns {Array} Массив классов
|
|
363
|
+
*/
|
|
364
|
+
const splitContentClasses = computed(() => {
|
|
365
|
+
const paddingClass = props.contentPadding ? useSpacing(props.contentPadding, 'padding') : null;
|
|
366
|
+
|
|
367
|
+
return useClassComposition(
|
|
368
|
+
"flex-1 overflow-y-auto",
|
|
369
|
+
paddingClass
|
|
370
|
+
);
|
|
371
|
+
});
|
|
372
|
+
|
|
373
|
+
/**
|
|
374
|
+
* Стили для split контентных областей
|
|
375
|
+
*
|
|
376
|
+
* @description
|
|
377
|
+
* Вычисляет стили для split панелей (равная ширина по умолчанию).
|
|
378
|
+
*
|
|
379
|
+
* @returns {Object} Объект со стилями
|
|
380
|
+
*/
|
|
381
|
+
const splitContentStyles = computed(() => {
|
|
382
|
+
return {
|
|
383
|
+
minWidth: 0, // Позволяет панелям сжиматься
|
|
384
|
+
};
|
|
385
|
+
});
|
|
386
|
+
|
|
387
|
+
/**
|
|
388
|
+
* Стили для контентной области
|
|
389
|
+
*
|
|
390
|
+
* @description
|
|
391
|
+
* Вычисляет margin-left для контентной области в push режиме.
|
|
392
|
+
*
|
|
393
|
+
* @returns {Object} Объект со стилями
|
|
394
|
+
*/
|
|
395
|
+
const contentStyles = computed(() => {
|
|
396
|
+
if (props.sidebarMode === "push" && !props.sidebarCollapsed) {
|
|
397
|
+
return {
|
|
398
|
+
marginLeft: `${props.sidebarWidth}px`,
|
|
399
|
+
};
|
|
400
|
+
}
|
|
401
|
+
if (props.sidebarMode === "push" && props.sidebarCollapsed) {
|
|
402
|
+
return {
|
|
403
|
+
marginLeft: `${props.sidebarCollapsedWidth}px`,
|
|
404
|
+
};
|
|
405
|
+
}
|
|
406
|
+
return {};
|
|
407
|
+
});
|
|
408
|
+
|
|
409
|
+
/**
|
|
410
|
+
* Классы для footer
|
|
411
|
+
*
|
|
412
|
+
* @description
|
|
413
|
+
* Вычисляет классы для footer секции с учетом отступов.
|
|
414
|
+
*
|
|
415
|
+
* @returns {Array} Массив классов
|
|
416
|
+
*/
|
|
417
|
+
const footerClasses = computed(() => {
|
|
418
|
+
const paddingClass = props.footerPadding ? useSpacing(props.footerPadding, 'padding') : null;
|
|
419
|
+
|
|
420
|
+
return useClassComposition(
|
|
421
|
+
"flex-shrink-0",
|
|
422
|
+
paddingClass
|
|
423
|
+
);
|
|
424
|
+
});
|
|
425
|
+
|
|
426
|
+
/**
|
|
427
|
+
* Классы для дефолтного контента (когда content slot не указан)
|
|
428
|
+
*
|
|
429
|
+
* @description
|
|
430
|
+
* Вычисляет классы для дефолтного контента с использованием useSpacing.
|
|
431
|
+
*
|
|
432
|
+
* @returns {Array} Массив классов
|
|
433
|
+
*/
|
|
434
|
+
const defaultContentClasses = computed(() => {
|
|
435
|
+
return useClassComposition(
|
|
436
|
+
useSpacing(props.contentPadding || "md", "padding")
|
|
437
|
+
);
|
|
438
|
+
});
|
|
439
|
+
|
|
440
|
+
/**
|
|
441
|
+
* Закрытие sidebar
|
|
442
|
+
*
|
|
443
|
+
* @description
|
|
444
|
+
* Закрывает sidebar (для overlay режима).
|
|
445
|
+
*/
|
|
446
|
+
function closeSidebar() {
|
|
447
|
+
if (props.sidebarMode === "overlay") {
|
|
448
|
+
emit("sidebar-toggle", false);
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
// Отслеживание изменений sidebarCollapsed
|
|
453
|
+
watch(
|
|
454
|
+
() => props.sidebarCollapsed,
|
|
455
|
+
(collapsed) => {
|
|
456
|
+
emit("sidebar-collapse", collapsed);
|
|
457
|
+
}
|
|
458
|
+
);
|
|
459
|
+
</script>
|
|
460
|
+
|
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
import { ref } from 'vue';
|
|
2
|
+
import DXAuthenticationForm from './DXAuthenticationForm.vue';
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: 'Organisms/DXAuthenticationForm',
|
|
6
|
+
component: DXAuthenticationForm,
|
|
7
|
+
tags: ['autodocs'],
|
|
8
|
+
parameters: {
|
|
9
|
+
docs: {
|
|
10
|
+
description: {
|
|
11
|
+
component: `
|
|
12
|
+
# DXAuthenticationForm
|
|
13
|
+
|
|
14
|
+
Готовая форма аутентификации (логин/регистрация) с валидацией и обработкой ошибок.
|
|
15
|
+
|
|
16
|
+
## Назначение
|
|
17
|
+
|
|
18
|
+
DXAuthenticationForm предоставляет готовую форму аутентификации с поддержкой
|
|
19
|
+
различных режимов (логин, регистрация, восстановление пароля, 2FA) и валидацией.
|
|
20
|
+
|
|
21
|
+
## Архитектура
|
|
22
|
+
|
|
23
|
+
### Использует
|
|
24
|
+
- \`DXInput\` - для полей ввода
|
|
25
|
+
- \`DXPasswordInput\` - для полей пароля
|
|
26
|
+
- \`DXFormControl\` - для валидации
|
|
27
|
+
- \`DXButton\` - для отправки
|
|
28
|
+
- \`DXCheckbox\` - для чекбоксов
|
|
29
|
+
- \`DXLink\` - для ссылок
|
|
30
|
+
- \`DXAlert\` - для ошибок
|
|
31
|
+
- \`useClassComposition\` composable - для стилей
|
|
32
|
+
- \`useSpacing\` composable - для отступов
|
|
33
|
+
|
|
34
|
+
### Используется в
|
|
35
|
+
- Страницы входа в приложение
|
|
36
|
+
- Регистрация новых пользователей
|
|
37
|
+
- Восстановление пароля
|
|
38
|
+
- Двухфакторная аутентификация
|
|
39
|
+
|
|
40
|
+
## Внутренняя логика
|
|
41
|
+
|
|
42
|
+
### Режимы
|
|
43
|
+
- **login**: Форма входа
|
|
44
|
+
- **register**: Форма регистрации
|
|
45
|
+
- **forgot-password**: Восстановление пароля
|
|
46
|
+
- **2fa**: Двухфакторная аутентификация
|
|
47
|
+
|
|
48
|
+
### Валидация
|
|
49
|
+
Поддерживает валидацию через prop \`errors\` и автоматическую проверку заполненности полей.
|
|
50
|
+
|
|
51
|
+
## Особенности
|
|
52
|
+
|
|
53
|
+
### Переключение режимов
|
|
54
|
+
Можно переключаться между режимами через события или программно.
|
|
55
|
+
|
|
56
|
+
### Кастомизация
|
|
57
|
+
Все элементы формы можно кастомизировать через slots.
|
|
58
|
+
`,
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export const Login = {
|
|
65
|
+
parameters: {
|
|
66
|
+
docs: {
|
|
67
|
+
description: {
|
|
68
|
+
story: 'Форма входа с email и паролем.',
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
render: () => ({
|
|
73
|
+
components: { DXAuthenticationForm },
|
|
74
|
+
setup() {
|
|
75
|
+
const mode = ref('login');
|
|
76
|
+
const loading = ref(false);
|
|
77
|
+
const error = ref('');
|
|
78
|
+
|
|
79
|
+
const handleSubmit = (data) => {
|
|
80
|
+
console.log('Вход:', data);
|
|
81
|
+
loading.value = true;
|
|
82
|
+
setTimeout(() => {
|
|
83
|
+
loading.value = false;
|
|
84
|
+
}, 2000);
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
const handleModeChange = (newMode) => {
|
|
88
|
+
mode.value = newMode;
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
return { mode, loading, error, handleSubmit, handleModeChange };
|
|
92
|
+
},
|
|
93
|
+
template: `
|
|
94
|
+
<div class="max-w-md mx-auto p-8">
|
|
95
|
+
<DXAuthenticationForm
|
|
96
|
+
:mode="mode"
|
|
97
|
+
:loading="loading"
|
|
98
|
+
:error="error"
|
|
99
|
+
@submit="handleSubmit"
|
|
100
|
+
@mode-change="handleModeChange"
|
|
101
|
+
/>
|
|
102
|
+
</div>
|
|
103
|
+
`,
|
|
104
|
+
}),
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
export const Register = {
|
|
108
|
+
parameters: {
|
|
109
|
+
docs: {
|
|
110
|
+
description: {
|
|
111
|
+
story: 'Форма регистрации с валидацией пароля.',
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
render: () => ({
|
|
116
|
+
components: { DXAuthenticationForm },
|
|
117
|
+
setup() {
|
|
118
|
+
const mode = ref('register');
|
|
119
|
+
const loading = ref(false);
|
|
120
|
+
|
|
121
|
+
const handleSubmit = (data) => {
|
|
122
|
+
console.log('Регистрация:', data);
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
return { mode, loading, handleSubmit };
|
|
126
|
+
},
|
|
127
|
+
template: `
|
|
128
|
+
<div class="max-w-md mx-auto p-8">
|
|
129
|
+
<DXAuthenticationForm
|
|
130
|
+
:mode="mode"
|
|
131
|
+
:loading="loading"
|
|
132
|
+
@submit="handleSubmit"
|
|
133
|
+
/>
|
|
134
|
+
</div>
|
|
135
|
+
`,
|
|
136
|
+
}),
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
export const ForgotPassword = {
|
|
140
|
+
parameters: {
|
|
141
|
+
docs: {
|
|
142
|
+
description: {
|
|
143
|
+
story: 'Форма восстановления пароля.',
|
|
144
|
+
},
|
|
145
|
+
},
|
|
146
|
+
},
|
|
147
|
+
render: () => ({
|
|
148
|
+
components: { DXAuthenticationForm },
|
|
149
|
+
setup() {
|
|
150
|
+
const mode = ref('forgot-password');
|
|
151
|
+
const loading = ref(false);
|
|
152
|
+
|
|
153
|
+
const handleSubmit = (data) => {
|
|
154
|
+
console.log('Восстановление пароля:', data);
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
return { mode, loading, handleSubmit };
|
|
158
|
+
},
|
|
159
|
+
template: `
|
|
160
|
+
<div class="max-w-md mx-auto p-8">
|
|
161
|
+
<DXAuthenticationForm
|
|
162
|
+
:mode="mode"
|
|
163
|
+
:loading="loading"
|
|
164
|
+
@submit="handleSubmit"
|
|
165
|
+
/>
|
|
166
|
+
</div>
|
|
167
|
+
`,
|
|
168
|
+
}),
|
|
169
|
+
};
|
|
170
|
+
|
|
171
|
+
export const TwoFactor = {
|
|
172
|
+
parameters: {
|
|
173
|
+
docs: {
|
|
174
|
+
description: {
|
|
175
|
+
story: 'Форма двухфакторной аутентификации.',
|
|
176
|
+
},
|
|
177
|
+
},
|
|
178
|
+
},
|
|
179
|
+
render: () => ({
|
|
180
|
+
components: { DXAuthenticationForm },
|
|
181
|
+
setup() {
|
|
182
|
+
const mode = ref('2fa');
|
|
183
|
+
const loading = ref(false);
|
|
184
|
+
|
|
185
|
+
const handleSubmit = (data) => {
|
|
186
|
+
console.log('2FA:', data);
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
return { mode, loading, handleSubmit };
|
|
190
|
+
},
|
|
191
|
+
template: `
|
|
192
|
+
<div class="max-w-md mx-auto p-8">
|
|
193
|
+
<DXAuthenticationForm
|
|
194
|
+
:mode="mode"
|
|
195
|
+
:loading="loading"
|
|
196
|
+
@submit="handleSubmit"
|
|
197
|
+
/>
|
|
198
|
+
</div>
|
|
199
|
+
`,
|
|
200
|
+
}),
|
|
201
|
+
};
|
|
202
|
+
|
|
203
|
+
export const WithErrors = {
|
|
204
|
+
parameters: {
|
|
205
|
+
docs: {
|
|
206
|
+
description: {
|
|
207
|
+
story: 'Форма с ошибками валидации.',
|
|
208
|
+
},
|
|
209
|
+
},
|
|
210
|
+
},
|
|
211
|
+
render: () => ({
|
|
212
|
+
components: { DXAuthenticationForm },
|
|
213
|
+
setup() {
|
|
214
|
+
const mode = ref('login');
|
|
215
|
+
const errors = ref({
|
|
216
|
+
email: 'Неверный email',
|
|
217
|
+
password: 'Неверный пароль',
|
|
218
|
+
});
|
|
219
|
+
|
|
220
|
+
return { mode, errors };
|
|
221
|
+
},
|
|
222
|
+
template: `
|
|
223
|
+
<div class="max-w-md mx-auto p-8">
|
|
224
|
+
<DXAuthenticationForm
|
|
225
|
+
:mode="mode"
|
|
226
|
+
:errors="errors"
|
|
227
|
+
/>
|
|
228
|
+
</div>
|
|
229
|
+
`,
|
|
230
|
+
}),
|
|
231
|
+
};
|
|
232
|
+
|