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,173 @@
|
|
|
1
|
+
import { ref } from 'vue';
|
|
2
|
+
import DXCommentSection from './DXCommentSection.vue';
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: 'Organisms/DXCommentSection',
|
|
6
|
+
component: DXCommentSection,
|
|
7
|
+
tags: ['autodocs'],
|
|
8
|
+
parameters: {
|
|
9
|
+
docs: {
|
|
10
|
+
description: {
|
|
11
|
+
component: `
|
|
12
|
+
# DXCommentSection
|
|
13
|
+
|
|
14
|
+
Секция комментариев с поддержкой вложенности, ответов и модерации.
|
|
15
|
+
|
|
16
|
+
## Назначение
|
|
17
|
+
|
|
18
|
+
DXCommentSection предоставляет полнофункциональную систему комментариев с поддержкой
|
|
19
|
+
вложенности (threading), ответов, редактирования, удаления и реакций.
|
|
20
|
+
|
|
21
|
+
## Архитектура
|
|
22
|
+
|
|
23
|
+
### Использует
|
|
24
|
+
- \`DXTextarea\` - для ввода комментария
|
|
25
|
+
- \`DXButton\` - для действий
|
|
26
|
+
- \`DXAvatar\` - для аватаров
|
|
27
|
+
- \`DXPagination\` - для пагинации
|
|
28
|
+
- \`useClassComposition\` composable - для стилей
|
|
29
|
+
- \`useSpacing\` composable - для отступов
|
|
30
|
+
|
|
31
|
+
### Используется в
|
|
32
|
+
- Статьи и блоги
|
|
33
|
+
- Обсуждения
|
|
34
|
+
- Отзывы с ответами
|
|
35
|
+
- Системы обратной связи
|
|
36
|
+
|
|
37
|
+
## Внутренняя логика
|
|
38
|
+
|
|
39
|
+
### Вложенность
|
|
40
|
+
При \`threading={true}\` комментарии могут иметь вложенные ответы.
|
|
41
|
+
|
|
42
|
+
### Сортировка
|
|
43
|
+
Поддерживает сортировку: newest (новые), oldest (старые), popular (популярные).
|
|
44
|
+
|
|
45
|
+
### Пагинация
|
|
46
|
+
При \`paginated={true}\` комментарии разбиваются на страницы.
|
|
47
|
+
|
|
48
|
+
## Особенности
|
|
49
|
+
|
|
50
|
+
### Редактирование и удаление
|
|
51
|
+
При \`editable={true}\` и \`deletable={true}\` показываются соответствующие кнопки.
|
|
52
|
+
|
|
53
|
+
### Реакции
|
|
54
|
+
При \`showReactions={true}\` показываются лайки.
|
|
55
|
+
`,
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
const defaultComments = [
|
|
62
|
+
{
|
|
63
|
+
id: 1,
|
|
64
|
+
text: 'Отличная статья! Очень полезная информация.',
|
|
65
|
+
author: { name: 'John Doe', avatar: '/avatar1.jpg' },
|
|
66
|
+
date: new Date(),
|
|
67
|
+
likes: 5,
|
|
68
|
+
canEdit: true,
|
|
69
|
+
canDelete: true,
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
id: 2,
|
|
73
|
+
text: 'Спасибо за подробное объяснение.',
|
|
74
|
+
author: { name: 'Jane Smith', avatar: '/avatar2.jpg' },
|
|
75
|
+
date: new Date(Date.now() - 3600000),
|
|
76
|
+
likes: 2,
|
|
77
|
+
replies: [
|
|
78
|
+
{
|
|
79
|
+
id: 3,
|
|
80
|
+
text: 'Пожалуйста!',
|
|
81
|
+
author: { name: 'Author', avatar: '/avatar3.jpg' },
|
|
82
|
+
date: new Date(Date.now() - 1800000),
|
|
83
|
+
likes: 1,
|
|
84
|
+
parentId: 2,
|
|
85
|
+
},
|
|
86
|
+
],
|
|
87
|
+
canEdit: false,
|
|
88
|
+
canDelete: false,
|
|
89
|
+
},
|
|
90
|
+
];
|
|
91
|
+
|
|
92
|
+
export const Default = {
|
|
93
|
+
parameters: {
|
|
94
|
+
docs: {
|
|
95
|
+
description: {
|
|
96
|
+
story: 'Базовая секция комментариев с формой добавления.',
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
render: () => ({
|
|
101
|
+
components: { DXCommentSection },
|
|
102
|
+
setup() {
|
|
103
|
+
const comments = ref(defaultComments);
|
|
104
|
+
const handleAddComment = (data) => {
|
|
105
|
+
console.log('Добавлен комментарий:', data);
|
|
106
|
+
comments.value.push({
|
|
107
|
+
id: comments.value.length + 1,
|
|
108
|
+
text: data.text,
|
|
109
|
+
author: { name: 'Current User', avatar: '/avatar.jpg' },
|
|
110
|
+
date: new Date(),
|
|
111
|
+
likes: 0,
|
|
112
|
+
canEdit: true,
|
|
113
|
+
canDelete: true,
|
|
114
|
+
});
|
|
115
|
+
};
|
|
116
|
+
return { comments, handleAddComment };
|
|
117
|
+
},
|
|
118
|
+
template: `
|
|
119
|
+
<DXCommentSection
|
|
120
|
+
:comments="comments"
|
|
121
|
+
@add-comment="handleAddComment"
|
|
122
|
+
/>
|
|
123
|
+
`,
|
|
124
|
+
}),
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
export const WithThreading = {
|
|
128
|
+
parameters: {
|
|
129
|
+
docs: {
|
|
130
|
+
description: {
|
|
131
|
+
story: 'Секция комментариев с поддержкой вложенности (ответы на комментарии).',
|
|
132
|
+
},
|
|
133
|
+
},
|
|
134
|
+
},
|
|
135
|
+
render: () => ({
|
|
136
|
+
components: { DXCommentSection },
|
|
137
|
+
setup() {
|
|
138
|
+
const comments = ref(defaultComments);
|
|
139
|
+
return { comments };
|
|
140
|
+
},
|
|
141
|
+
template: `
|
|
142
|
+
<DXCommentSection
|
|
143
|
+
:comments="comments"
|
|
144
|
+
:threading="true"
|
|
145
|
+
/>
|
|
146
|
+
`,
|
|
147
|
+
}),
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
export const WithModeration = {
|
|
151
|
+
parameters: {
|
|
152
|
+
docs: {
|
|
153
|
+
description: {
|
|
154
|
+
story: 'Секция комментариев с возможностью редактирования и удаления.',
|
|
155
|
+
},
|
|
156
|
+
},
|
|
157
|
+
},
|
|
158
|
+
render: () => ({
|
|
159
|
+
components: { DXCommentSection },
|
|
160
|
+
setup() {
|
|
161
|
+
const comments = ref(defaultComments);
|
|
162
|
+
return { comments };
|
|
163
|
+
},
|
|
164
|
+
template: `
|
|
165
|
+
<DXCommentSection
|
|
166
|
+
:comments="comments"
|
|
167
|
+
:editable="true"
|
|
168
|
+
:deletable="true"
|
|
169
|
+
/>
|
|
170
|
+
`,
|
|
171
|
+
}),
|
|
172
|
+
};
|
|
173
|
+
|
|
@@ -0,0 +1,487 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
:class="sectionClasses"
|
|
4
|
+
data-component="DXCommentSection"
|
|
5
|
+
:data-threading="threading"
|
|
6
|
+
>
|
|
7
|
+
<!-- Форма добавления комментария -->
|
|
8
|
+
<div v-if="showForm || $slots['comment-form']" :class="formClasses">
|
|
9
|
+
<slot name="comment-form">
|
|
10
|
+
<div class="space-y-3">
|
|
11
|
+
<DXTextarea
|
|
12
|
+
v-model="newComment"
|
|
13
|
+
:placeholder="formPlaceholder"
|
|
14
|
+
:rows="formRows"
|
|
15
|
+
@keydown.ctrl.enter="handleSubmitComment"
|
|
16
|
+
/>
|
|
17
|
+
<div class="flex items-center justify-end gap-2">
|
|
18
|
+
<DXButton variant="ghost" @click="handleCancelComment">
|
|
19
|
+
Отмена
|
|
20
|
+
</DXButton>
|
|
21
|
+
<DXButton variant="primary" @click="handleSubmitComment">
|
|
22
|
+
Отправить
|
|
23
|
+
</DXButton>
|
|
24
|
+
</div>
|
|
25
|
+
</div>
|
|
26
|
+
</slot>
|
|
27
|
+
</div>
|
|
28
|
+
|
|
29
|
+
<!-- Список комментариев -->
|
|
30
|
+
<div :class="commentsClasses">
|
|
31
|
+
<div
|
|
32
|
+
v-for="comment in displayedComments"
|
|
33
|
+
:key="comment.id"
|
|
34
|
+
:class="commentClasses(comment)"
|
|
35
|
+
>
|
|
36
|
+
<slot name="comment" :comment="comment" :reply="handleReply" :edit="handleEdit" :delete="handleDelete">
|
|
37
|
+
<div class="flex gap-3">
|
|
38
|
+
<DXAvatar
|
|
39
|
+
:src="comment.author?.avatar"
|
|
40
|
+
:name="comment.author?.name"
|
|
41
|
+
size="md"
|
|
42
|
+
/>
|
|
43
|
+
<div class="flex-1">
|
|
44
|
+
<div class="flex items-center gap-2 mb-1">
|
|
45
|
+
<span class="font-semibold text-slate-900">
|
|
46
|
+
{{ comment.author?.name || "Аноним" }}
|
|
47
|
+
</span>
|
|
48
|
+
<span class="text-xs text-slate-500">
|
|
49
|
+
{{ formatDate(comment.date) }}
|
|
50
|
+
</span>
|
|
51
|
+
</div>
|
|
52
|
+
<div class="text-sm text-slate-700 mb-2">
|
|
53
|
+
{{ comment.text }}
|
|
54
|
+
</div>
|
|
55
|
+
<div class="flex items-center gap-4">
|
|
56
|
+
<DXButton
|
|
57
|
+
v-if="showReactions"
|
|
58
|
+
size="sm"
|
|
59
|
+
variant="ghost"
|
|
60
|
+
@click="handleLike(comment.id)"
|
|
61
|
+
>
|
|
62
|
+
👍 {{ comment.likes || 0 }}
|
|
63
|
+
</DXButton>
|
|
64
|
+
<DXButton
|
|
65
|
+
v-if="threading"
|
|
66
|
+
size="sm"
|
|
67
|
+
variant="ghost"
|
|
68
|
+
@click="handleReply(comment.id)"
|
|
69
|
+
>
|
|
70
|
+
Ответить
|
|
71
|
+
</DXButton>
|
|
72
|
+
<DXButton
|
|
73
|
+
v-if="editable && comment.canEdit"
|
|
74
|
+
size="sm"
|
|
75
|
+
variant="ghost"
|
|
76
|
+
@click="handleEdit(comment.id)"
|
|
77
|
+
>
|
|
78
|
+
Редактировать
|
|
79
|
+
</DXButton>
|
|
80
|
+
<DXButton
|
|
81
|
+
v-if="deletable && comment.canDelete"
|
|
82
|
+
size="sm"
|
|
83
|
+
variant="ghost"
|
|
84
|
+
@click="handleDelete(comment.id)"
|
|
85
|
+
>
|
|
86
|
+
Удалить
|
|
87
|
+
</DXButton>
|
|
88
|
+
</div>
|
|
89
|
+
</div>
|
|
90
|
+
</div>
|
|
91
|
+
</slot>
|
|
92
|
+
|
|
93
|
+
<!-- Вложенные комментарии -->
|
|
94
|
+
<div
|
|
95
|
+
v-if="threading && comment.replies && comment.replies.length > 0"
|
|
96
|
+
:class="repliesClasses"
|
|
97
|
+
>
|
|
98
|
+
<DXCommentSection
|
|
99
|
+
:comments="comment.replies"
|
|
100
|
+
:threading="threading"
|
|
101
|
+
:editable="editable"
|
|
102
|
+
:deletable="deletable"
|
|
103
|
+
:show-reactions="showReactions"
|
|
104
|
+
@add-comment="handleAddReply"
|
|
105
|
+
@reply="handleReply"
|
|
106
|
+
@edit="handleEdit"
|
|
107
|
+
@delete="handleDelete"
|
|
108
|
+
/>
|
|
109
|
+
</div>
|
|
110
|
+
</div>
|
|
111
|
+
</div>
|
|
112
|
+
|
|
113
|
+
<!-- Пагинация -->
|
|
114
|
+
<div v-if="paginated && totalPages > 1" :class="paginationClasses">
|
|
115
|
+
<DXPagination
|
|
116
|
+
v-model="currentPage"
|
|
117
|
+
:total-pages="totalPages"
|
|
118
|
+
@update:model-value="handlePageChange"
|
|
119
|
+
/>
|
|
120
|
+
</div>
|
|
121
|
+
</div>
|
|
122
|
+
</template>
|
|
123
|
+
|
|
124
|
+
<script setup>
|
|
125
|
+
import { ref, computed } from "vue";
|
|
126
|
+
import { useClassComposition } from "@/composables/useClassComposition";
|
|
127
|
+
import { useSpacing } from "@/composables/useSpacing";
|
|
128
|
+
import DXTextarea from "../../molecules/DXTextarea/DXTextarea.vue";
|
|
129
|
+
import DXButton from "../../atoms/DXButton/DXButton.vue";
|
|
130
|
+
import DXAvatar from "../../atoms/DXAvatar/DXAvatar.vue";
|
|
131
|
+
import DXPagination from "../../molecules/DXPagination/DXPagination.vue";
|
|
132
|
+
|
|
133
|
+
const props = defineProps({
|
|
134
|
+
/**
|
|
135
|
+
* Комментарии
|
|
136
|
+
* Формат: [{ id, text, author: { name, avatar }, date, likes?, replies?, canEdit?, canDelete? }]
|
|
137
|
+
*/
|
|
138
|
+
comments: {
|
|
139
|
+
type: Array,
|
|
140
|
+
required: true,
|
|
141
|
+
default: () => [],
|
|
142
|
+
},
|
|
143
|
+
/**
|
|
144
|
+
* Поддержка вложенности (threading)
|
|
145
|
+
* @default true
|
|
146
|
+
*/
|
|
147
|
+
threading: { type: Boolean, default: true },
|
|
148
|
+
/**
|
|
149
|
+
* Сортировка: newest | oldest | popular
|
|
150
|
+
* @default 'newest'
|
|
151
|
+
*/
|
|
152
|
+
sortBy: {
|
|
153
|
+
type: String,
|
|
154
|
+
default: "newest",
|
|
155
|
+
validator: (v) => ["newest", "oldest", "popular"].includes(v),
|
|
156
|
+
},
|
|
157
|
+
/**
|
|
158
|
+
* Фильтр по автору
|
|
159
|
+
*/
|
|
160
|
+
filterBy: { type: String, default: "" },
|
|
161
|
+
/**
|
|
162
|
+
* Показывать форму добавления
|
|
163
|
+
* @default true
|
|
164
|
+
*/
|
|
165
|
+
showForm: { type: Boolean, default: true },
|
|
166
|
+
/**
|
|
167
|
+
* Placeholder для формы
|
|
168
|
+
*/
|
|
169
|
+
formPlaceholder: {
|
|
170
|
+
type: String,
|
|
171
|
+
default: "Добавить комментарий...",
|
|
172
|
+
},
|
|
173
|
+
/**
|
|
174
|
+
* Количество строк в форме
|
|
175
|
+
* @default 3
|
|
176
|
+
*/
|
|
177
|
+
formRows: { type: Number, default: 3 },
|
|
178
|
+
/**
|
|
179
|
+
* Можно редактировать комментарии
|
|
180
|
+
* @default false
|
|
181
|
+
*/
|
|
182
|
+
editable: { type: Boolean, default: false },
|
|
183
|
+
/**
|
|
184
|
+
* Можно удалять комментарии
|
|
185
|
+
* @default false
|
|
186
|
+
*/
|
|
187
|
+
deletable: { type: Boolean, default: false },
|
|
188
|
+
/**
|
|
189
|
+
* Показывать реакции (лайки)
|
|
190
|
+
* @default true
|
|
191
|
+
*/
|
|
192
|
+
showReactions: { type: Boolean, default: true },
|
|
193
|
+
/**
|
|
194
|
+
* Пагинация
|
|
195
|
+
* @default false
|
|
196
|
+
*/
|
|
197
|
+
paginated: { type: Boolean, default: false },
|
|
198
|
+
/**
|
|
199
|
+
* Количество комментариев на странице
|
|
200
|
+
* @default 10
|
|
201
|
+
*/
|
|
202
|
+
pageSize: { type: Number, default: 10 },
|
|
203
|
+
});
|
|
204
|
+
|
|
205
|
+
const emit = defineEmits([
|
|
206
|
+
"add-comment",
|
|
207
|
+
"reply",
|
|
208
|
+
"edit",
|
|
209
|
+
"delete",
|
|
210
|
+
"like",
|
|
211
|
+
"page-change",
|
|
212
|
+
]);
|
|
213
|
+
|
|
214
|
+
const newComment = ref("");
|
|
215
|
+
const currentPage = ref(1);
|
|
216
|
+
const replyingTo = ref(null);
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* Отсортированные комментарии
|
|
220
|
+
*
|
|
221
|
+
* @description
|
|
222
|
+
* Сортирует комментарии в зависимости от sortBy.
|
|
223
|
+
*
|
|
224
|
+
* @returns {Array} Отсортированный массив комментариев
|
|
225
|
+
*/
|
|
226
|
+
const sortedComments = computed(() => {
|
|
227
|
+
const comments = [...props.comments];
|
|
228
|
+
switch (props.sortBy) {
|
|
229
|
+
case "oldest":
|
|
230
|
+
return comments.sort(
|
|
231
|
+
(a, b) => new Date(a.date) - new Date(b.date)
|
|
232
|
+
);
|
|
233
|
+
case "popular":
|
|
234
|
+
return comments.sort((a, b) => (b.likes || 0) - (a.likes || 0));
|
|
235
|
+
case "newest":
|
|
236
|
+
default:
|
|
237
|
+
return comments.sort(
|
|
238
|
+
(a, b) => new Date(b.date) - new Date(a.date)
|
|
239
|
+
);
|
|
240
|
+
}
|
|
241
|
+
});
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* Отфильтрованные комментарии
|
|
245
|
+
*
|
|
246
|
+
* @description
|
|
247
|
+
* Фильтрует комментарии по автору если указан filterBy.
|
|
248
|
+
*
|
|
249
|
+
* @returns {Array} Отфильтрованный массив комментариев
|
|
250
|
+
*/
|
|
251
|
+
const filteredComments = computed(() => {
|
|
252
|
+
if (!props.filterBy) return sortedComments.value;
|
|
253
|
+
return sortedComments.value.filter(
|
|
254
|
+
(comment) =>
|
|
255
|
+
comment.author?.name
|
|
256
|
+
?.toLowerCase()
|
|
257
|
+
.includes(props.filterBy.toLowerCase())
|
|
258
|
+
);
|
|
259
|
+
});
|
|
260
|
+
|
|
261
|
+
/**
|
|
262
|
+
* Отображаемые комментарии
|
|
263
|
+
*
|
|
264
|
+
* @description
|
|
265
|
+
* Возвращает комментарии для текущей страницы если включена пагинация.
|
|
266
|
+
*
|
|
267
|
+
* @returns {Array} Массив комментариев для отображения
|
|
268
|
+
*/
|
|
269
|
+
const displayedComments = computed(() => {
|
|
270
|
+
if (!props.paginated) return filteredComments.value;
|
|
271
|
+
const start = (currentPage.value - 1) * props.pageSize;
|
|
272
|
+
const end = start + props.pageSize;
|
|
273
|
+
return filteredComments.value.slice(start, end);
|
|
274
|
+
});
|
|
275
|
+
|
|
276
|
+
/**
|
|
277
|
+
* Всего страниц
|
|
278
|
+
*
|
|
279
|
+
* @description
|
|
280
|
+
* Вычисляет общее количество страниц для пагинации.
|
|
281
|
+
*
|
|
282
|
+
* @returns {number} Количество страниц
|
|
283
|
+
*/
|
|
284
|
+
const totalPages = computed(() => {
|
|
285
|
+
if (!props.paginated) return 1;
|
|
286
|
+
return Math.ceil(filteredComments.value.length / props.pageSize);
|
|
287
|
+
});
|
|
288
|
+
|
|
289
|
+
/**
|
|
290
|
+
* Классы для секции
|
|
291
|
+
*
|
|
292
|
+
* @description
|
|
293
|
+
* Базовые классы для секции комментариев.
|
|
294
|
+
*
|
|
295
|
+
* @returns {Array} Массив классов
|
|
296
|
+
*/
|
|
297
|
+
const sectionClasses = computed(() =>
|
|
298
|
+
useClassComposition("w-full space-y-6")
|
|
299
|
+
);
|
|
300
|
+
|
|
301
|
+
/**
|
|
302
|
+
* Классы для формы
|
|
303
|
+
*
|
|
304
|
+
* @description
|
|
305
|
+
* Классы для формы добавления комментария.
|
|
306
|
+
*
|
|
307
|
+
* @returns {Array} Массив классов
|
|
308
|
+
*/
|
|
309
|
+
const formClasses = computed(() =>
|
|
310
|
+
useClassComposition("mb-6", useSpacing("md", "padding"))
|
|
311
|
+
);
|
|
312
|
+
|
|
313
|
+
/**
|
|
314
|
+
* Классы для списка комментариев
|
|
315
|
+
*
|
|
316
|
+
* @description
|
|
317
|
+
* Классы для списка комментариев.
|
|
318
|
+
*
|
|
319
|
+
* @returns {Array} Массив классов
|
|
320
|
+
*/
|
|
321
|
+
const commentsClasses = computed(() =>
|
|
322
|
+
useClassComposition("space-y-4")
|
|
323
|
+
);
|
|
324
|
+
|
|
325
|
+
/**
|
|
326
|
+
* Классы для комментария
|
|
327
|
+
*
|
|
328
|
+
* @description
|
|
329
|
+
* Классы для отдельного комментария.
|
|
330
|
+
*
|
|
331
|
+
* @param {Object} comment - Объект комментария
|
|
332
|
+
* @returns {Array} Массив классов
|
|
333
|
+
*/
|
|
334
|
+
function commentClasses(comment) {
|
|
335
|
+
return useClassComposition(
|
|
336
|
+
"pb-4",
|
|
337
|
+
comment.parentId ? "ml-8 border-l-2 border-slate-200 pl-4" : ""
|
|
338
|
+
);
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
/**
|
|
342
|
+
* Классы для вложенных комментариев
|
|
343
|
+
*
|
|
344
|
+
* @description
|
|
345
|
+
* Классы для контейнера вложенных комментариев.
|
|
346
|
+
*
|
|
347
|
+
* @returns {Array} Массив классов
|
|
348
|
+
*/
|
|
349
|
+
const repliesClasses = computed(() =>
|
|
350
|
+
useClassComposition("mt-4 ml-8 space-y-4")
|
|
351
|
+
);
|
|
352
|
+
|
|
353
|
+
/**
|
|
354
|
+
* Классы для пагинации
|
|
355
|
+
*
|
|
356
|
+
* @description
|
|
357
|
+
* Классы для секции пагинации.
|
|
358
|
+
*
|
|
359
|
+
* @returns {Array} Массив классов
|
|
360
|
+
*/
|
|
361
|
+
const paginationClasses = computed(() =>
|
|
362
|
+
useClassComposition("mt-6 flex justify-center")
|
|
363
|
+
);
|
|
364
|
+
|
|
365
|
+
/**
|
|
366
|
+
* Форматирование даты
|
|
367
|
+
*
|
|
368
|
+
* @description
|
|
369
|
+
* Форматирует дату для отображения.
|
|
370
|
+
*
|
|
371
|
+
* @param {Date|string} date - Дата
|
|
372
|
+
* @returns {string} Отформатированная дата
|
|
373
|
+
*/
|
|
374
|
+
function formatDate(date) {
|
|
375
|
+
if (!date) return "";
|
|
376
|
+
const d = new Date(date);
|
|
377
|
+
return d.toLocaleDateString("ru-RU", {
|
|
378
|
+
year: "numeric",
|
|
379
|
+
month: "short",
|
|
380
|
+
day: "numeric",
|
|
381
|
+
hour: "2-digit",
|
|
382
|
+
minute: "2-digit",
|
|
383
|
+
});
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
/**
|
|
387
|
+
* Обработчик отправки комментария
|
|
388
|
+
*
|
|
389
|
+
* @description
|
|
390
|
+
* Эмитит событие добавления комментария.
|
|
391
|
+
*/
|
|
392
|
+
function handleSubmitComment() {
|
|
393
|
+
if (!newComment.value.trim()) return;
|
|
394
|
+
emit("add-comment", {
|
|
395
|
+
text: newComment.value,
|
|
396
|
+
parentId: replyingTo.value,
|
|
397
|
+
});
|
|
398
|
+
newComment.value = "";
|
|
399
|
+
replyingTo.value = null;
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
/**
|
|
403
|
+
* Обработчик отмены комментария
|
|
404
|
+
*
|
|
405
|
+
* @description
|
|
406
|
+
* Очищает форму комментария.
|
|
407
|
+
*/
|
|
408
|
+
function handleCancelComment() {
|
|
409
|
+
newComment.value = "";
|
|
410
|
+
replyingTo.value = null;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
/**
|
|
414
|
+
* Обработчик ответа
|
|
415
|
+
*
|
|
416
|
+
* @description
|
|
417
|
+
* Начинает ответ на комментарий.
|
|
418
|
+
*
|
|
419
|
+
* @param {number|string} commentId - ID комментария
|
|
420
|
+
*/
|
|
421
|
+
function handleReply(commentId) {
|
|
422
|
+
replyingTo.value = commentId;
|
|
423
|
+
emit("reply", commentId);
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
/**
|
|
427
|
+
* Обработчик редактирования
|
|
428
|
+
*
|
|
429
|
+
* @description
|
|
430
|
+
* Эмитит событие редактирования комментария.
|
|
431
|
+
*
|
|
432
|
+
* @param {number|string} commentId - ID комментария
|
|
433
|
+
*/
|
|
434
|
+
function handleEdit(commentId) {
|
|
435
|
+
emit("edit", commentId);
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
/**
|
|
439
|
+
* Обработчик удаления
|
|
440
|
+
*
|
|
441
|
+
* @description
|
|
442
|
+
* Эмитит событие удаления комментария.
|
|
443
|
+
*
|
|
444
|
+
* @param {number|string} commentId - ID комментария
|
|
445
|
+
*/
|
|
446
|
+
function handleDelete(commentId) {
|
|
447
|
+
emit("delete", commentId);
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
/**
|
|
451
|
+
* Обработчик лайка
|
|
452
|
+
*
|
|
453
|
+
* @description
|
|
454
|
+
* Эмитит событие лайка комментария.
|
|
455
|
+
*
|
|
456
|
+
* @param {number|string} commentId - ID комментария
|
|
457
|
+
*/
|
|
458
|
+
function handleLike(commentId) {
|
|
459
|
+
emit("like", commentId);
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
/**
|
|
463
|
+
* Обработчик добавления ответа
|
|
464
|
+
*
|
|
465
|
+
* @description
|
|
466
|
+
* Обрабатывает добавление ответа на комментарий.
|
|
467
|
+
*
|
|
468
|
+
* @param {Object} data - Данные ответа
|
|
469
|
+
*/
|
|
470
|
+
function handleAddReply(data) {
|
|
471
|
+
emit("add-comment", data);
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
/**
|
|
475
|
+
* Обработчик изменения страницы
|
|
476
|
+
*
|
|
477
|
+
* @description
|
|
478
|
+
* Обрабатывает изменение страницы пагинации.
|
|
479
|
+
*
|
|
480
|
+
* @param {number} page - Номер страницы
|
|
481
|
+
*/
|
|
482
|
+
function handlePageChange(page) {
|
|
483
|
+
currentPage.value = page;
|
|
484
|
+
emit("page-change", page);
|
|
485
|
+
}
|
|
486
|
+
</script>
|
|
487
|
+
|