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,149 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="flexClasses" data-component="DXFlex">
|
|
3
|
+
<slot />
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script setup>
|
|
8
|
+
import { computed } from "vue";
|
|
9
|
+
import { useSize } from "@/composables/useSize";
|
|
10
|
+
import { useClassComposition } from "@/composables/useClassComposition";
|
|
11
|
+
|
|
12
|
+
const props = defineProps({
|
|
13
|
+
/** Направление: row | row-reverse | col | col-reverse */
|
|
14
|
+
direction: { type: String, default: "row" },
|
|
15
|
+
/** Выравнивание по главной оси: start | center | end | between | around | evenly */
|
|
16
|
+
justify: { type: String, default: "start" },
|
|
17
|
+
/** Выравнивание по поперечной оси: start | center | end | stretch | baseline */
|
|
18
|
+
align: { type: String, default: "center" },
|
|
19
|
+
/** Перенос: nowrap | wrap | wrap-reverse */
|
|
20
|
+
wrap: { type: String, default: "nowrap" },
|
|
21
|
+
/** Отступ между элементами: none | xs | sm | md | lg | xl */
|
|
22
|
+
gap: { type: String, default: "md" },
|
|
23
|
+
/** Inline flex */
|
|
24
|
+
inline: { type: Boolean, default: false },
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
const BASE_CLASSES = "";
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Базовый класс flex (inline-flex или flex)
|
|
31
|
+
*
|
|
32
|
+
* @description
|
|
33
|
+
* Определяет, будет ли flex контейнер inline или block элементом.
|
|
34
|
+
*
|
|
35
|
+
* @returns {string} Tailwind CSS класс для flex контейнера
|
|
36
|
+
*/
|
|
37
|
+
const flexBaseClass = computed(() => {
|
|
38
|
+
return props.inline ? "inline-flex" : "flex";
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Классы направления flex
|
|
43
|
+
*
|
|
44
|
+
* @description
|
|
45
|
+
* Определяет направление главной оси flex контейнера.
|
|
46
|
+
*
|
|
47
|
+
* @returns {string} Tailwind CSS класс для направления
|
|
48
|
+
*/
|
|
49
|
+
const directionClass = computed(() => {
|
|
50
|
+
const directionClasses = {
|
|
51
|
+
row: "flex-row",
|
|
52
|
+
"row-reverse": "flex-row-reverse",
|
|
53
|
+
col: "flex-col",
|
|
54
|
+
"col-reverse": "flex-col-reverse",
|
|
55
|
+
};
|
|
56
|
+
return directionClasses[props.direction] || directionClasses.row;
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Классы выравнивания по главной оси
|
|
61
|
+
*
|
|
62
|
+
* @description
|
|
63
|
+
* Определяет выравнивание элементов по главной оси (justify-content).
|
|
64
|
+
*
|
|
65
|
+
* @returns {string} Tailwind CSS класс для justify-content
|
|
66
|
+
*/
|
|
67
|
+
const justifyClass = computed(() => {
|
|
68
|
+
const justifyClasses = {
|
|
69
|
+
start: "justify-start",
|
|
70
|
+
center: "justify-center",
|
|
71
|
+
end: "justify-end",
|
|
72
|
+
between: "justify-between",
|
|
73
|
+
around: "justify-around",
|
|
74
|
+
evenly: "justify-evenly",
|
|
75
|
+
};
|
|
76
|
+
return justifyClasses[props.justify] || justifyClasses.start;
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Классы выравнивания по поперечной оси
|
|
81
|
+
*
|
|
82
|
+
* @description
|
|
83
|
+
* Определяет выравнивание элементов по поперечной оси (align-items).
|
|
84
|
+
*
|
|
85
|
+
* @returns {string} Tailwind CSS класс для align-items
|
|
86
|
+
*/
|
|
87
|
+
const alignClass = computed(() => {
|
|
88
|
+
const alignClasses = {
|
|
89
|
+
start: "items-start",
|
|
90
|
+
center: "items-center",
|
|
91
|
+
end: "items-end",
|
|
92
|
+
stretch: "items-stretch",
|
|
93
|
+
baseline: "items-baseline",
|
|
94
|
+
};
|
|
95
|
+
return alignClasses[props.align] || alignClasses.center;
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Классы переноса элементов
|
|
100
|
+
*
|
|
101
|
+
* @description
|
|
102
|
+
* Определяет, будут ли элементы переноситься на новую строку (flex-wrap).
|
|
103
|
+
*
|
|
104
|
+
* @returns {string} Tailwind CSS класс для flex-wrap
|
|
105
|
+
*/
|
|
106
|
+
const wrapClass = computed(() => {
|
|
107
|
+
const wrapClasses = {
|
|
108
|
+
nowrap: "flex-nowrap",
|
|
109
|
+
wrap: "flex-wrap",
|
|
110
|
+
"wrap-reverse": "flex-wrap-reverse",
|
|
111
|
+
};
|
|
112
|
+
return wrapClasses[props.wrap] || wrapClasses.nowrap;
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Классы отступа между элементами
|
|
117
|
+
*
|
|
118
|
+
* @description
|
|
119
|
+
* Использует useSize composable для вычисления gap между элементами.
|
|
120
|
+
* Gap в flex контейнере работает как spacing между элементами.
|
|
121
|
+
*
|
|
122
|
+
* @returns {string} Tailwind CSS класс для gap
|
|
123
|
+
*/
|
|
124
|
+
const gapClass = computed(() => {
|
|
125
|
+
return useSize(props.gap, 'spacing') || 'gap-4';
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Все классы для flex компонента
|
|
130
|
+
*
|
|
131
|
+
* @description
|
|
132
|
+
* Объединяет все классы flex контейнера (базовый класс, направление,
|
|
133
|
+
* выравнивание, перенос, отступы) с использованием useClassComposition.
|
|
134
|
+
*
|
|
135
|
+
* @returns {Array} Массив классов для применения к элементу
|
|
136
|
+
*/
|
|
137
|
+
const flexClasses = computed(() =>
|
|
138
|
+
useClassComposition(
|
|
139
|
+
BASE_CLASSES,
|
|
140
|
+
flexBaseClass.value,
|
|
141
|
+
directionClass.value,
|
|
142
|
+
justifyClass.value,
|
|
143
|
+
alignClass.value,
|
|
144
|
+
wrapClass.value,
|
|
145
|
+
gapClass.value
|
|
146
|
+
)
|
|
147
|
+
);
|
|
148
|
+
</script>
|
|
149
|
+
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
import DXGrid from './DXGrid.vue';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: 'Layout/DXGrid',
|
|
5
|
+
component: DXGrid,
|
|
6
|
+
tags: ['autodocs'],
|
|
7
|
+
parameters: {
|
|
8
|
+
docs: {
|
|
9
|
+
description: {
|
|
10
|
+
component: `
|
|
11
|
+
# DXGrid
|
|
12
|
+
|
|
13
|
+
CSS Grid контейнер с адаптивными колонками и гибкой системой отступов.
|
|
14
|
+
|
|
15
|
+
## Назначение
|
|
16
|
+
|
|
17
|
+
DXGrid - layout компонент для создания grid макетов с использованием CSS Grid.
|
|
18
|
+
Предоставляет простой API для управления количеством колонок, адаптивностью и отступами между элементами.
|
|
19
|
+
|
|
20
|
+
## Архитектура
|
|
21
|
+
|
|
22
|
+
### Использует
|
|
23
|
+
- \`useSize\` composable - для унификации общего gap между элементами
|
|
24
|
+
- \`useSpacing\` composable - для унификации раздельных gapX и gapY
|
|
25
|
+
- \`useClassComposition\` composable - для объединения классов
|
|
26
|
+
|
|
27
|
+
### Используется в
|
|
28
|
+
- Галереи изображений
|
|
29
|
+
- Карточки товаров и продуктов
|
|
30
|
+
- Сетки контента
|
|
31
|
+
- Адаптивные макеты страниц
|
|
32
|
+
- Любые места, требующие grid структуры
|
|
33
|
+
|
|
34
|
+
## Внутренняя логика
|
|
35
|
+
|
|
36
|
+
### Система колонок
|
|
37
|
+
Поддерживает фиксированное количество колонок от 1 до 12:
|
|
38
|
+
- \`cols={1}\` → \`grid-cols-1\`
|
|
39
|
+
- \`cols={12}\` → \`grid-cols-12\`
|
|
40
|
+
- \`cols="auto"\` → автоматический размер с минимальной шириной 250px
|
|
41
|
+
|
|
42
|
+
### Адаптивные колонки
|
|
43
|
+
Поддерживает адаптивные колонки для различных breakpoints:
|
|
44
|
+
- \`colsSm\` - количество колонок на sm экранах (≥640px)
|
|
45
|
+
- \`colsMd\` - количество колонок на md экранах (≥768px)
|
|
46
|
+
- \`colsLg\` - количество колонок на lg экранах (≥1024px)
|
|
47
|
+
|
|
48
|
+
### Система gap
|
|
49
|
+
Поддерживает три варианта отступов:
|
|
50
|
+
- \`gap\` - общий отступ для всех направлений (использует \`useSize\` с типом \`spacing\`)
|
|
51
|
+
- \`gapX\` - горизонтальный отступ (между колонками, использует \`useSpacing\`)
|
|
52
|
+
- \`gapY\` - вертикальный отступ (между рядами, использует \`useSpacing\`)
|
|
53
|
+
|
|
54
|
+
Если указаны \`gapX\` или \`gapY\`, они имеют приоритет над общим \`gap\`.
|
|
55
|
+
Для общего gap используется \`useSize\` для единообразия с другими layout компонентами.
|
|
56
|
+
|
|
57
|
+
### Auto-fit режим
|
|
58
|
+
При \`cols="auto"\` используется CSS Grid \`auto-fit\` с минимальной шириной элемента 250px.
|
|
59
|
+
Элементы автоматически подстраиваются под доступное пространство.
|
|
60
|
+
|
|
61
|
+
## Особенности
|
|
62
|
+
|
|
63
|
+
### Фиксированные колонки
|
|
64
|
+
\`\`\`vue
|
|
65
|
+
<DXGrid cols={3} gap="md">
|
|
66
|
+
<div>Item 1</div>
|
|
67
|
+
<div>Item 2</div>
|
|
68
|
+
<div>Item 3</div>
|
|
69
|
+
</DXGrid>
|
|
70
|
+
\`\`\`
|
|
71
|
+
|
|
72
|
+
### Адаптивные колонки
|
|
73
|
+
\`\`\`vue
|
|
74
|
+
<DXGrid cols={1} colsSm={2} colsMd={3} colsLg={4} gap="lg">
|
|
75
|
+
<!-- Элементы -->
|
|
76
|
+
</DXGrid>
|
|
77
|
+
\`\`\`
|
|
78
|
+
|
|
79
|
+
### Auto-fit
|
|
80
|
+
\`\`\`vue
|
|
81
|
+
<DXGrid cols="auto" gap="md">
|
|
82
|
+
<!-- Элементы автоматически подстраиваются -->
|
|
83
|
+
</DXGrid>
|
|
84
|
+
\`\`\`
|
|
85
|
+
|
|
86
|
+
### Раздельные отступы
|
|
87
|
+
\`\`\`vue
|
|
88
|
+
<DXGrid cols={3} gapX="lg" gapY="md">
|
|
89
|
+
<!-- Больше отступ по горизонтали, меньше по вертикали -->
|
|
90
|
+
</DXGrid>
|
|
91
|
+
\`\`\`
|
|
92
|
+
|
|
93
|
+
## Ограничения
|
|
94
|
+
|
|
95
|
+
- Максимальное количество колонок: 12 (стандарт Tailwind)
|
|
96
|
+
- Auto-fit использует фиксированную минимальную ширину 250px
|
|
97
|
+
- Для более сложных grid макетов используйте CSS классы через \`class\` prop
|
|
98
|
+
- Gap использует предопределенные значения из \`useSpacing\` (none, xs, sm, md, lg, xl)
|
|
99
|
+
`,
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
argTypes: {
|
|
104
|
+
cols: {
|
|
105
|
+
control: 'select',
|
|
106
|
+
options: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 'auto'],
|
|
107
|
+
description: 'Количество колонок в grid. Поддерживает значения от 1 до 12 или "auto" для автоматического размера с минимальной шириной 250px.',
|
|
108
|
+
table: {
|
|
109
|
+
type: { summary: 'number | string' },
|
|
110
|
+
defaultValue: { summary: '12' },
|
|
111
|
+
category: 'Layout',
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
colsSm: {
|
|
115
|
+
control: 'select',
|
|
116
|
+
options: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],
|
|
117
|
+
description: 'Количество колонок на sm экранах (≥640px). Используется для создания адаптивных grid макетов.',
|
|
118
|
+
table: {
|
|
119
|
+
type: { summary: 'number | string' },
|
|
120
|
+
defaultValue: { summary: '""' },
|
|
121
|
+
category: 'Layout',
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
colsMd: {
|
|
125
|
+
control: 'select',
|
|
126
|
+
options: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],
|
|
127
|
+
description: 'Количество колонок на md экранах (≥768px). Используется для создания адаптивных grid макетов.',
|
|
128
|
+
table: {
|
|
129
|
+
type: { summary: 'number | string' },
|
|
130
|
+
defaultValue: { summary: '""' },
|
|
131
|
+
category: 'Layout',
|
|
132
|
+
},
|
|
133
|
+
},
|
|
134
|
+
colsLg: {
|
|
135
|
+
control: 'select',
|
|
136
|
+
options: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],
|
|
137
|
+
description: 'Количество колонок на lg экранах (≥1024px). Используется для создания адаптивных grid макетов.',
|
|
138
|
+
table: {
|
|
139
|
+
type: { summary: 'number | string' },
|
|
140
|
+
defaultValue: { summary: '""' },
|
|
141
|
+
category: 'Layout',
|
|
142
|
+
},
|
|
143
|
+
},
|
|
144
|
+
gap: {
|
|
145
|
+
control: 'select',
|
|
146
|
+
options: ['none', 'xs', 'sm', 'md', 'lg', 'xl'],
|
|
147
|
+
description: 'Общий отступ между элементами grid (и по горизонтали, и по вертикали). Используется, если не указаны gapX или gapY.',
|
|
148
|
+
table: {
|
|
149
|
+
type: { summary: 'string' },
|
|
150
|
+
defaultValue: { summary: '"md"' },
|
|
151
|
+
category: 'Spacing',
|
|
152
|
+
},
|
|
153
|
+
},
|
|
154
|
+
gapX: {
|
|
155
|
+
control: 'select',
|
|
156
|
+
options: ['none', 'xs', 'sm', 'md', 'lg', 'xl'],
|
|
157
|
+
description: 'Горизонтальный отступ между колонками. Имеет приоритет над общим gap для горизонтального направления.',
|
|
158
|
+
table: {
|
|
159
|
+
type: { summary: 'string' },
|
|
160
|
+
defaultValue: { summary: '""' },
|
|
161
|
+
category: 'Spacing',
|
|
162
|
+
},
|
|
163
|
+
},
|
|
164
|
+
gapY: {
|
|
165
|
+
control: 'select',
|
|
166
|
+
options: ['none', 'xs', 'sm', 'md', 'lg', 'xl'],
|
|
167
|
+
description: 'Вертикальный отступ между рядами. Имеет приоритет над общим gap для вертикального направления.',
|
|
168
|
+
table: {
|
|
169
|
+
type: { summary: 'string' },
|
|
170
|
+
defaultValue: { summary: '""' },
|
|
171
|
+
category: 'Spacing',
|
|
172
|
+
},
|
|
173
|
+
},
|
|
174
|
+
},
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
const gridItem = '<div class="bg-slate-100 rounded-lg p-4 text-center">Item</div>';
|
|
178
|
+
|
|
179
|
+
export const Default = {
|
|
180
|
+
args: { cols: 3, gap: 'md' },
|
|
181
|
+
parameters: {
|
|
182
|
+
docs: {
|
|
183
|
+
description: {
|
|
184
|
+
story: 'Базовый grid с 3 колонками и средним отступом. Это стандартная конфигурация для создания сетки элементов. Элементы равномерно распределяются по 3 колонкам.',
|
|
185
|
+
},
|
|
186
|
+
},
|
|
187
|
+
},
|
|
188
|
+
render: (args) => ({
|
|
189
|
+
components: { DXGrid },
|
|
190
|
+
setup() { return { args }; },
|
|
191
|
+
template: `
|
|
192
|
+
<DXGrid v-bind="args">
|
|
193
|
+
${Array(6).fill(gridItem).join('')}
|
|
194
|
+
</DXGrid>
|
|
195
|
+
`,
|
|
196
|
+
}),
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
export const Responsive = {
|
|
200
|
+
args: { cols: 1, colsSm: 2, colsMd: 3, colsLg: 4 },
|
|
201
|
+
parameters: {
|
|
202
|
+
docs: {
|
|
203
|
+
description: {
|
|
204
|
+
story: 'Адаптивный grid с разным количеством колонок на разных экранах. На мобильных (по умолчанию) - 1 колонка, на sm (≥640px) - 2 колонки, на md (≥768px) - 3 колонки, на lg (≥1024px) - 4 колонки. Это типичный паттерн для адаптивных макетов.',
|
|
205
|
+
},
|
|
206
|
+
},
|
|
207
|
+
},
|
|
208
|
+
render: (args) => ({
|
|
209
|
+
components: { DXGrid },
|
|
210
|
+
setup() { return { args }; },
|
|
211
|
+
template: `
|
|
212
|
+
<DXGrid v-bind="args">
|
|
213
|
+
${Array(8).fill(gridItem).join('')}
|
|
214
|
+
</DXGrid>
|
|
215
|
+
`,
|
|
216
|
+
}),
|
|
217
|
+
};
|
|
218
|
+
|
|
219
|
+
export const AutoFit = {
|
|
220
|
+
args: { cols: 'auto', gap: 'md' },
|
|
221
|
+
parameters: {
|
|
222
|
+
docs: {
|
|
223
|
+
description: {
|
|
224
|
+
story: 'Grid с автоматическим количеством колонок (auto-fit). Элементы автоматически подстраиваются под доступное пространство с минимальной шириной 250px. Полезен для галерей и карточек, где количество колонок должно зависеть от ширины экрана.',
|
|
225
|
+
},
|
|
226
|
+
},
|
|
227
|
+
},
|
|
228
|
+
render: (args) => ({
|
|
229
|
+
components: { DXGrid },
|
|
230
|
+
setup() { return { args }; },
|
|
231
|
+
template: `
|
|
232
|
+
<DXGrid v-bind="args">
|
|
233
|
+
${Array(5).fill(gridItem).join('')}
|
|
234
|
+
</DXGrid>
|
|
235
|
+
`,
|
|
236
|
+
}),
|
|
237
|
+
};
|
|
238
|
+
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="gridClasses" :style="gridStyle" data-component="DXGrid">
|
|
3
|
+
<slot />
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script setup>
|
|
8
|
+
import { computed } from "vue";
|
|
9
|
+
import { useSize } from "@/composables/useSize";
|
|
10
|
+
import { useSpacing } from "@/composables/useSpacing";
|
|
11
|
+
import { useClassComposition } from "@/composables/useClassComposition";
|
|
12
|
+
|
|
13
|
+
const props = defineProps({
|
|
14
|
+
/** Количество колонок: 1-12 или auto */
|
|
15
|
+
cols: { type: [Number, String], default: 12 },
|
|
16
|
+
/** Количество колонок на sm */
|
|
17
|
+
colsSm: { type: [Number, String], default: "" },
|
|
18
|
+
/** Количество колонок на md */
|
|
19
|
+
colsMd: { type: [Number, String], default: "" },
|
|
20
|
+
/** Количество колонок на lg */
|
|
21
|
+
colsLg: { type: [Number, String], default: "" },
|
|
22
|
+
/** Отступ между элементами: none | xs | sm | md | lg | xl */
|
|
23
|
+
gap: { type: String, default: "md" },
|
|
24
|
+
/** Горизонтальный отступ */
|
|
25
|
+
gapX: { type: String, default: "" },
|
|
26
|
+
/** Вертикальный отступ */
|
|
27
|
+
gapY: { type: String, default: "" },
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
const BASE_CLASSES = "grid";
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Классы количества колонок
|
|
34
|
+
*
|
|
35
|
+
* @description
|
|
36
|
+
* Определяет количество колонок в grid контейнере.
|
|
37
|
+
* Поддерживает значения от 1 до 12 или "auto" для автоматического размера.
|
|
38
|
+
*
|
|
39
|
+
* @returns {string} Tailwind CSS класс для grid-cols
|
|
40
|
+
*/
|
|
41
|
+
const colsClass = computed(() => {
|
|
42
|
+
const colsClasses = {
|
|
43
|
+
1: "grid-cols-1",
|
|
44
|
+
2: "grid-cols-2",
|
|
45
|
+
3: "grid-cols-3",
|
|
46
|
+
4: "grid-cols-4",
|
|
47
|
+
5: "grid-cols-5",
|
|
48
|
+
6: "grid-cols-6",
|
|
49
|
+
7: "grid-cols-7",
|
|
50
|
+
8: "grid-cols-8",
|
|
51
|
+
9: "grid-cols-9",
|
|
52
|
+
10: "grid-cols-10",
|
|
53
|
+
11: "grid-cols-11",
|
|
54
|
+
12: "grid-cols-12",
|
|
55
|
+
auto: "grid-cols-[repeat(auto-fit,minmax(250px,1fr))]",
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
return colsClasses[props.cols] || `grid-cols-${props.cols}`;
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Классы адаптивных колонок
|
|
63
|
+
*
|
|
64
|
+
* @description
|
|
65
|
+
* Определяет количество колонок для различных брейкпоинтов (sm, md, lg).
|
|
66
|
+
* Используется для создания адаптивных grid макетов.
|
|
67
|
+
*
|
|
68
|
+
* @returns {Object} Объект с классами для условного применения
|
|
69
|
+
*/
|
|
70
|
+
const responsiveColsClasses = computed(() => {
|
|
71
|
+
const classes = {};
|
|
72
|
+
|
|
73
|
+
if (props.colsSm) {
|
|
74
|
+
classes[`sm:grid-cols-${props.colsSm}`] = true;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
if (props.colsMd) {
|
|
78
|
+
classes[`md:grid-cols-${props.colsMd}`] = true;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
if (props.colsLg) {
|
|
82
|
+
classes[`lg:grid-cols-${props.colsLg}`] = true;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
return Object.keys(classes).length > 0 ? classes : null;
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Классы отступов между элементами
|
|
90
|
+
*
|
|
91
|
+
* @description
|
|
92
|
+
* Использует useSize для общего gap и useSpacing для раздельных gapX/gapY.
|
|
93
|
+
* Поддерживает общий gap, а также раздельные gapX и gapY.
|
|
94
|
+
*
|
|
95
|
+
* @returns {string|Object} Классы gap или объект для условных классов
|
|
96
|
+
*/
|
|
97
|
+
const gapClasses = computed(() => {
|
|
98
|
+
// Если указаны gapX или gapY, используем их вместо общего gap
|
|
99
|
+
if (props.gapX || props.gapY) {
|
|
100
|
+
const classes = {};
|
|
101
|
+
|
|
102
|
+
if (props.gapX) {
|
|
103
|
+
// Извлекаем значение из useSpacing и формируем gap-x класс
|
|
104
|
+
const spacingClass = useSpacing(props.gapX, 'padding');
|
|
105
|
+
const match = spacingClass ? spacingClass.match(/-(\d+)$/) : null;
|
|
106
|
+
if (match) {
|
|
107
|
+
classes[`gap-x-${match[1]}`] = true;
|
|
108
|
+
} else if (props.gapX === "none") {
|
|
109
|
+
classes["gap-x-0"] = true;
|
|
110
|
+
} else {
|
|
111
|
+
classes[`gap-x-${props.gapX}`] = true;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
if (props.gapY) {
|
|
116
|
+
// Извлекаем значение из useSpacing и формируем gap-y класс
|
|
117
|
+
const spacingClass = useSpacing(props.gapY, 'padding');
|
|
118
|
+
const match = spacingClass ? spacingClass.match(/-(\d+)$/) : null;
|
|
119
|
+
if (match) {
|
|
120
|
+
classes[`gap-y-${match[1]}`] = true;
|
|
121
|
+
} else if (props.gapY === "none") {
|
|
122
|
+
classes["gap-y-0"] = true;
|
|
123
|
+
} else {
|
|
124
|
+
classes[`gap-y-${props.gapY}`] = true;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
return Object.keys(classes).length > 0 ? classes : null;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
// Используем useSize для общего gap
|
|
132
|
+
return useSize(props.gap, 'spacing') || 'gap-4';
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Все классы для grid компонента
|
|
137
|
+
*
|
|
138
|
+
* @description
|
|
139
|
+
* Объединяет все классы grid контейнера (базовый класс, колонки,
|
|
140
|
+
* адаптивные колонки, отступы) с использованием useClassComposition.
|
|
141
|
+
*
|
|
142
|
+
* @returns {Array} Массив классов для применения к элементу
|
|
143
|
+
*/
|
|
144
|
+
const gridClasses = computed(() =>
|
|
145
|
+
useClassComposition(
|
|
146
|
+
BASE_CLASSES,
|
|
147
|
+
colsClass.value,
|
|
148
|
+
responsiveColsClasses.value,
|
|
149
|
+
gapClasses.value
|
|
150
|
+
)
|
|
151
|
+
);
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Инлайн стили для grid
|
|
155
|
+
*
|
|
156
|
+
* @description
|
|
157
|
+
* В настоящее время не используется, но оставлен для будущих расширений,
|
|
158
|
+
* например, для кастомных grid шаблонов.
|
|
159
|
+
*
|
|
160
|
+
* @returns {Object} Объект со стилями или пустой объект
|
|
161
|
+
*/
|
|
162
|
+
const gridStyle = computed(() => {
|
|
163
|
+
if (props.cols === "auto") return {};
|
|
164
|
+
return {};
|
|
165
|
+
});
|
|
166
|
+
</script>
|
|
167
|
+
|