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,335 @@
|
|
|
1
|
+
import { ref } from 'vue';
|
|
2
|
+
import DXStatCard from './DXStatCard.vue';
|
|
3
|
+
import {
|
|
4
|
+
UserGroupIcon,
|
|
5
|
+
ChartBarIcon,
|
|
6
|
+
CurrencyDollarIcon,
|
|
7
|
+
ArrowTrendingUpIcon,
|
|
8
|
+
} from '@heroicons/vue/24/outline';
|
|
9
|
+
|
|
10
|
+
const UserGroupIconComponent = UserGroupIcon;
|
|
11
|
+
const ChartBarIconComponent = ChartBarIcon;
|
|
12
|
+
const CurrencyDollarIconComponent = CurrencyDollarIcon;
|
|
13
|
+
const ArrowTrendingUpIconComponent = ArrowTrendingUpIcon;
|
|
14
|
+
|
|
15
|
+
export default {
|
|
16
|
+
title: 'Molecules/DXStatCard',
|
|
17
|
+
component: DXStatCard,
|
|
18
|
+
tags: ['autodocs'],
|
|
19
|
+
parameters: {
|
|
20
|
+
docs: {
|
|
21
|
+
description: {
|
|
22
|
+
component: `
|
|
23
|
+
# DXStatCard
|
|
24
|
+
|
|
25
|
+
Карточка для отображения статистики с иконкой, значением и метаданными.
|
|
26
|
+
|
|
27
|
+
## Назначение
|
|
28
|
+
|
|
29
|
+
DXStatCard предоставляет стандартизированный способ отображения метрик и KPI
|
|
30
|
+
в дашбордах, отчетах и панелях управления. Поддерживает различные форматы значений,
|
|
31
|
+
тренды, сравнения и цветовые схемы.
|
|
32
|
+
|
|
33
|
+
## Архитектура
|
|
34
|
+
|
|
35
|
+
### Использует
|
|
36
|
+
- \`DXCard\` - базовая карточка
|
|
37
|
+
- \`DXIcon\` - для иконок и индикаторов тренда
|
|
38
|
+
- \`useSize\` composable - для размеров
|
|
39
|
+
- \`useSpacing\` composable - для отступов
|
|
40
|
+
- \`useClassComposition\` composable - для стилей
|
|
41
|
+
- \`useVariantButton\` composable - для цветовых схем
|
|
42
|
+
|
|
43
|
+
### Используется в
|
|
44
|
+
- \`DXDashboardGrid\` - для создания дашбордов
|
|
45
|
+
- Отчеты и аналитика
|
|
46
|
+
- Панели управления
|
|
47
|
+
|
|
48
|
+
## Внутренняя логика
|
|
49
|
+
|
|
50
|
+
### Форматирование значений
|
|
51
|
+
- **number**: Обычное число с разделителями тысяч (1,234)
|
|
52
|
+
- **currency**: Валюта с символом ($1,234.56)
|
|
53
|
+
- **percentage**: Процент с символом (24.5%)
|
|
54
|
+
|
|
55
|
+
### Тренды
|
|
56
|
+
Тренд отображается с иконкой стрелки и процентом изменения.
|
|
57
|
+
Цвет зависит от направления: зеленый для роста, красный для падения.
|
|
58
|
+
|
|
59
|
+
### Цветовые схемы
|
|
60
|
+
Поддерживает различные цветовые схемы для визуального разделения типов метрик.
|
|
61
|
+
|
|
62
|
+
## Особенности
|
|
63
|
+
|
|
64
|
+
### Кликабельность
|
|
65
|
+
При \`clickable={true}\` карточка становится интерактивной с hover эффектом.
|
|
66
|
+
|
|
67
|
+
### Адаптивность
|
|
68
|
+
Размеры адаптируются для различных экранов через prop \`size\`.
|
|
69
|
+
`,
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
argTypes: {
|
|
74
|
+
value: {
|
|
75
|
+
control: 'number',
|
|
76
|
+
description: 'Значение для отображения.',
|
|
77
|
+
table: {
|
|
78
|
+
type: { summary: 'number | string' },
|
|
79
|
+
category: 'Content',
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
valueFormat: {
|
|
83
|
+
control: 'select',
|
|
84
|
+
options: ['number', 'currency', 'percentage'],
|
|
85
|
+
description: 'Формат значения: number | currency | percentage.',
|
|
86
|
+
table: {
|
|
87
|
+
type: { summary: 'string' },
|
|
88
|
+
defaultValue: { summary: 'number' },
|
|
89
|
+
category: 'Content',
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
color: {
|
|
93
|
+
control: 'select',
|
|
94
|
+
options: ['primary', 'secondary', 'success', 'warning', 'danger'],
|
|
95
|
+
description: 'Цветовая схема карточки.',
|
|
96
|
+
table: {
|
|
97
|
+
type: { summary: 'string' },
|
|
98
|
+
defaultValue: { summary: 'primary' },
|
|
99
|
+
category: 'Appearance',
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
size: {
|
|
103
|
+
control: 'select',
|
|
104
|
+
options: ['sm', 'md', 'lg'],
|
|
105
|
+
description: 'Размер карточки.',
|
|
106
|
+
table: {
|
|
107
|
+
type: { summary: 'string' },
|
|
108
|
+
defaultValue: { summary: 'md' },
|
|
109
|
+
category: 'Appearance',
|
|
110
|
+
},
|
|
111
|
+
},
|
|
112
|
+
clickable: {
|
|
113
|
+
control: 'boolean',
|
|
114
|
+
description: 'Кликабельная карточка.',
|
|
115
|
+
table: {
|
|
116
|
+
type: { summary: 'boolean' },
|
|
117
|
+
defaultValue: { summary: 'false' },
|
|
118
|
+
category: 'Behavior',
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
export const Default = {
|
|
125
|
+
args: {
|
|
126
|
+
title: 'Всего пользователей',
|
|
127
|
+
value: 1250,
|
|
128
|
+
icon: UserGroupIcon,
|
|
129
|
+
},
|
|
130
|
+
parameters: {
|
|
131
|
+
docs: {
|
|
132
|
+
description: {
|
|
133
|
+
story: 'Базовая карточка статистики с заголовком, значением и иконкой.',
|
|
134
|
+
},
|
|
135
|
+
},
|
|
136
|
+
},
|
|
137
|
+
render: (args) => ({
|
|
138
|
+
components: { DXStatCard },
|
|
139
|
+
setup() {
|
|
140
|
+
return { args };
|
|
141
|
+
},
|
|
142
|
+
template: '<DXStatCard v-bind="args" />',
|
|
143
|
+
}),
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
export const WithTrend = {
|
|
147
|
+
args: {
|
|
148
|
+
title: 'Продажи',
|
|
149
|
+
value: 45230,
|
|
150
|
+
valueFormat: 'currency',
|
|
151
|
+
currency: 'USD',
|
|
152
|
+
trend: { value: 12.5, direction: 'up' },
|
|
153
|
+
comparison: 'vs прошлый месяц',
|
|
154
|
+
icon: ChartBarIcon,
|
|
155
|
+
},
|
|
156
|
+
parameters: {
|
|
157
|
+
docs: {
|
|
158
|
+
description: {
|
|
159
|
+
story: 'Карточка с трендом. Тренд показывает изменение в процентах с визуальной индикацией направления.',
|
|
160
|
+
},
|
|
161
|
+
},
|
|
162
|
+
},
|
|
163
|
+
render: (args) => ({
|
|
164
|
+
components: { DXStatCard },
|
|
165
|
+
setup() {
|
|
166
|
+
return { args };
|
|
167
|
+
},
|
|
168
|
+
template: '<DXStatCard v-bind="args" />',
|
|
169
|
+
}),
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
export const WithPercentage = {
|
|
173
|
+
args: {
|
|
174
|
+
title: 'Конверсия',
|
|
175
|
+
value: 24.5,
|
|
176
|
+
valueFormat: 'percentage',
|
|
177
|
+
trend: { value: 3.2, direction: 'up' },
|
|
178
|
+
icon: ArrowTrendingUpIcon,
|
|
179
|
+
color: 'success',
|
|
180
|
+
},
|
|
181
|
+
parameters: {
|
|
182
|
+
docs: {
|
|
183
|
+
description: {
|
|
184
|
+
story: 'Карточка с процентом. Значение отображается в процентном формате.',
|
|
185
|
+
},
|
|
186
|
+
},
|
|
187
|
+
},
|
|
188
|
+
render: (args) => ({
|
|
189
|
+
components: { DXStatCard },
|
|
190
|
+
setup() {
|
|
191
|
+
return { args };
|
|
192
|
+
},
|
|
193
|
+
template: '<DXStatCard v-bind="args" />',
|
|
194
|
+
}),
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
export const Clickable = {
|
|
198
|
+
args: {
|
|
199
|
+
title: 'Новые заказы',
|
|
200
|
+
value: 89,
|
|
201
|
+
icon: CurrencyDollarIcon,
|
|
202
|
+
color: 'primary',
|
|
203
|
+
clickable: true,
|
|
204
|
+
},
|
|
205
|
+
parameters: {
|
|
206
|
+
docs: {
|
|
207
|
+
description: {
|
|
208
|
+
story: 'Кликабельная карточка. При клике эмитит событие и имеет hover эффект.',
|
|
209
|
+
},
|
|
210
|
+
},
|
|
211
|
+
},
|
|
212
|
+
render: (args) => ({
|
|
213
|
+
components: { DXStatCard },
|
|
214
|
+
setup() {
|
|
215
|
+
const handleClick = () => {
|
|
216
|
+
console.log('Карточка кликнута');
|
|
217
|
+
};
|
|
218
|
+
return { args, handleClick };
|
|
219
|
+
},
|
|
220
|
+
template: '<DXStatCard v-bind="args" @click="handleClick" />',
|
|
221
|
+
}),
|
|
222
|
+
};
|
|
223
|
+
|
|
224
|
+
export const WithDescription = {
|
|
225
|
+
args: {
|
|
226
|
+
title: 'Активные проекты',
|
|
227
|
+
value: 15,
|
|
228
|
+
description: 'Из 20 запланированных',
|
|
229
|
+
icon: UserGroupIcon,
|
|
230
|
+
size: 'lg',
|
|
231
|
+
},
|
|
232
|
+
parameters: {
|
|
233
|
+
docs: {
|
|
234
|
+
description: {
|
|
235
|
+
story: 'Карточка с описанием. Описание отображается под значением.',
|
|
236
|
+
},
|
|
237
|
+
},
|
|
238
|
+
},
|
|
239
|
+
render: (args) => ({
|
|
240
|
+
components: { DXStatCard },
|
|
241
|
+
setup() {
|
|
242
|
+
return { args };
|
|
243
|
+
},
|
|
244
|
+
template: '<DXStatCard v-bind="args" />',
|
|
245
|
+
}),
|
|
246
|
+
};
|
|
247
|
+
|
|
248
|
+
export const AllColors = {
|
|
249
|
+
parameters: {
|
|
250
|
+
docs: {
|
|
251
|
+
description: {
|
|
252
|
+
story: 'Демонстрация всех цветовых схем.',
|
|
253
|
+
},
|
|
254
|
+
},
|
|
255
|
+
},
|
|
256
|
+
render: () => ({
|
|
257
|
+
components: { DXStatCard },
|
|
258
|
+
setup() {
|
|
259
|
+
return {};
|
|
260
|
+
},
|
|
261
|
+
template: `
|
|
262
|
+
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">
|
|
263
|
+
<DXStatCard
|
|
264
|
+
title="Primary"
|
|
265
|
+
:value="1000"
|
|
266
|
+
color="primary"
|
|
267
|
+
:icon="UserGroupIcon"
|
|
268
|
+
/>
|
|
269
|
+
<DXStatCard
|
|
270
|
+
title="Secondary"
|
|
271
|
+
:value="2000"
|
|
272
|
+
color="secondary"
|
|
273
|
+
:icon="UserGroupIcon"
|
|
274
|
+
/>
|
|
275
|
+
<DXStatCard
|
|
276
|
+
title="Success"
|
|
277
|
+
:value="3000"
|
|
278
|
+
color="success"
|
|
279
|
+
:icon="UserGroupIcon"
|
|
280
|
+
/>
|
|
281
|
+
<DXStatCard
|
|
282
|
+
title="Warning"
|
|
283
|
+
:value="4000"
|
|
284
|
+
color="warning"
|
|
285
|
+
:icon="UserGroupIcon"
|
|
286
|
+
/>
|
|
287
|
+
<DXStatCard
|
|
288
|
+
title="Danger"
|
|
289
|
+
:value="5000"
|
|
290
|
+
color="danger"
|
|
291
|
+
:icon="UserGroupIcon"
|
|
292
|
+
/>
|
|
293
|
+
</div>
|
|
294
|
+
`,
|
|
295
|
+
}),
|
|
296
|
+
};
|
|
297
|
+
|
|
298
|
+
export const AllSizes = {
|
|
299
|
+
parameters: {
|
|
300
|
+
docs: {
|
|
301
|
+
description: {
|
|
302
|
+
story: 'Различные размеры карточек.',
|
|
303
|
+
},
|
|
304
|
+
},
|
|
305
|
+
},
|
|
306
|
+
render: () => ({
|
|
307
|
+
components: { DXStatCard },
|
|
308
|
+
setup() {
|
|
309
|
+
return {};
|
|
310
|
+
},
|
|
311
|
+
template: `
|
|
312
|
+
<div class="space-y-4">
|
|
313
|
+
<DXStatCard
|
|
314
|
+
title="Small"
|
|
315
|
+
:value="1000"
|
|
316
|
+
size="sm"
|
|
317
|
+
:icon="UserGroupIcon"
|
|
318
|
+
/>
|
|
319
|
+
<DXStatCard
|
|
320
|
+
title="Medium"
|
|
321
|
+
:value="2000"
|
|
322
|
+
size="md"
|
|
323
|
+
:icon="UserGroupIcon"
|
|
324
|
+
/>
|
|
325
|
+
<DXStatCard
|
|
326
|
+
title="Large"
|
|
327
|
+
:value="3000"
|
|
328
|
+
size="lg"
|
|
329
|
+
:icon="UserGroupIcon"
|
|
330
|
+
/>
|
|
331
|
+
</div>
|
|
332
|
+
`,
|
|
333
|
+
}),
|
|
334
|
+
};
|
|
335
|
+
|
|
@@ -0,0 +1,309 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<DXCard
|
|
3
|
+
:class="cardClasses"
|
|
4
|
+
:padding="padding"
|
|
5
|
+
:variant="cardVariant"
|
|
6
|
+
data-component="DXStatCard"
|
|
7
|
+
:data-size="size"
|
|
8
|
+
:data-color="color"
|
|
9
|
+
:data-clickable="clickable"
|
|
10
|
+
@click="handleClick"
|
|
11
|
+
>
|
|
12
|
+
<div class="flex items-start justify-between">
|
|
13
|
+
<div class="flex-1">
|
|
14
|
+
<!-- Заголовок -->
|
|
15
|
+
<div v-if="title" class="text-sm font-medium text-slate-600 mb-1">
|
|
16
|
+
{{ title }}
|
|
17
|
+
</div>
|
|
18
|
+
|
|
19
|
+
<!-- Значение -->
|
|
20
|
+
<div class="flex items-baseline gap-2">
|
|
21
|
+
<span :class="valueClasses">
|
|
22
|
+
{{ formattedValue }}
|
|
23
|
+
</span>
|
|
24
|
+
<!-- Тренд -->
|
|
25
|
+
<div
|
|
26
|
+
v-if="trend"
|
|
27
|
+
:class="trendClasses"
|
|
28
|
+
class="flex items-center gap-0.5 text-xs font-medium"
|
|
29
|
+
>
|
|
30
|
+
<DXIcon
|
|
31
|
+
:icon="trend.direction === 'up' ? ArrowUpIcon : ArrowDownIcon"
|
|
32
|
+
size="xs"
|
|
33
|
+
/>
|
|
34
|
+
<span>{{ Math.abs(trend.value) }}%</span>
|
|
35
|
+
</div>
|
|
36
|
+
</div>
|
|
37
|
+
|
|
38
|
+
<!-- Описание -->
|
|
39
|
+
<div v-if="description" class="text-xs text-slate-500 mt-1">
|
|
40
|
+
{{ description }}
|
|
41
|
+
</div>
|
|
42
|
+
|
|
43
|
+
<!-- Сравнение -->
|
|
44
|
+
<div v-if="comparison" class="text-xs text-slate-500 mt-1">
|
|
45
|
+
{{ comparison }}
|
|
46
|
+
</div>
|
|
47
|
+
</div>
|
|
48
|
+
|
|
49
|
+
<!-- Иконка -->
|
|
50
|
+
<div v-if="icon" :class="iconWrapperClasses">
|
|
51
|
+
<DXIcon :icon="icon" :size="iconSize" :animation="iconAnimation" />
|
|
52
|
+
</div>
|
|
53
|
+
</div>
|
|
54
|
+
</DXCard>
|
|
55
|
+
</template>
|
|
56
|
+
|
|
57
|
+
<script setup>
|
|
58
|
+
import { computed } from "vue";
|
|
59
|
+
import { useSize } from "@/composables/useSize";
|
|
60
|
+
import { useSpacing } from "@/composables/useSpacing";
|
|
61
|
+
import { useClassComposition } from "@/composables/useClassComposition";
|
|
62
|
+
import { useVariantButton } from "@/composables/useVariant";
|
|
63
|
+
import DXCard from "../../atoms/DXCard/DXCard.vue";
|
|
64
|
+
import DXIcon from "../../atoms/DXIcon/DXIcon.vue";
|
|
65
|
+
import { ArrowUpIcon, ArrowDownIcon } from "@heroicons/vue/24/outline";
|
|
66
|
+
|
|
67
|
+
const props = defineProps({
|
|
68
|
+
/**
|
|
69
|
+
* Заголовок карточки
|
|
70
|
+
*/
|
|
71
|
+
title: { type: String, default: "" },
|
|
72
|
+
/**
|
|
73
|
+
* Значение для отображения
|
|
74
|
+
*/
|
|
75
|
+
value: { type: [Number, String], required: true },
|
|
76
|
+
/**
|
|
77
|
+
* Формат значения: number | currency | percentage
|
|
78
|
+
* @default 'number'
|
|
79
|
+
*/
|
|
80
|
+
valueFormat: {
|
|
81
|
+
type: String,
|
|
82
|
+
default: "number",
|
|
83
|
+
validator: (v) => ["number", "currency", "percentage"].includes(v),
|
|
84
|
+
},
|
|
85
|
+
/**
|
|
86
|
+
* Валюта для currency формата
|
|
87
|
+
* @default 'USD'
|
|
88
|
+
*/
|
|
89
|
+
currency: { type: String, default: "USD" },
|
|
90
|
+
/**
|
|
91
|
+
* Тренд: { value: number, direction: 'up' | 'down' }
|
|
92
|
+
*/
|
|
93
|
+
trend: {
|
|
94
|
+
type: Object,
|
|
95
|
+
default: null,
|
|
96
|
+
validator: (v) => {
|
|
97
|
+
if (!v) return true;
|
|
98
|
+
return (
|
|
99
|
+
typeof v.value === "number" &&
|
|
100
|
+
(v.direction === "up" || v.direction === "down")
|
|
101
|
+
);
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
/**
|
|
105
|
+
* Текст сравнения (например, "vs прошлый месяц")
|
|
106
|
+
*/
|
|
107
|
+
comparison: { type: String, default: "" },
|
|
108
|
+
/**
|
|
109
|
+
* Описание
|
|
110
|
+
*/
|
|
111
|
+
description: { type: String, default: "" },
|
|
112
|
+
/**
|
|
113
|
+
* Иконка (Heroicon компонент)
|
|
114
|
+
*/
|
|
115
|
+
icon: { type: [Object, Function], default: null },
|
|
116
|
+
/**
|
|
117
|
+
* Цветовая схема: primary | secondary | success | warning | danger
|
|
118
|
+
* @default 'primary'
|
|
119
|
+
*/
|
|
120
|
+
color: {
|
|
121
|
+
type: String,
|
|
122
|
+
default: "primary",
|
|
123
|
+
validator: (v) =>
|
|
124
|
+
["primary", "secondary", "success", "warning", "danger"].includes(v),
|
|
125
|
+
},
|
|
126
|
+
/**
|
|
127
|
+
* Размер: sm | md | lg
|
|
128
|
+
* @default 'md'
|
|
129
|
+
*/
|
|
130
|
+
size: { type: String, default: "md", validator: (v) => ["sm", "md", "lg"].includes(v) },
|
|
131
|
+
/**
|
|
132
|
+
* Кликабельная карточка
|
|
133
|
+
* @default false
|
|
134
|
+
*/
|
|
135
|
+
clickable: { type: Boolean, default: false },
|
|
136
|
+
/**
|
|
137
|
+
* Padding карточки: none | xs | sm | md | lg | xl
|
|
138
|
+
* @default 'md'
|
|
139
|
+
*/
|
|
140
|
+
padding: {
|
|
141
|
+
type: String,
|
|
142
|
+
default: "md",
|
|
143
|
+
validator: (v) => ["none", "xs", "sm", "md", "lg", "xl"].includes(v),
|
|
144
|
+
},
|
|
145
|
+
/**
|
|
146
|
+
* Вариант карточки: default | bordered | elevated | flat
|
|
147
|
+
* @default 'default'
|
|
148
|
+
*/
|
|
149
|
+
cardVariant: {
|
|
150
|
+
type: String,
|
|
151
|
+
default: "default",
|
|
152
|
+
validator: (v) => ["default", "bordered", "elevated", "flat"].includes(v),
|
|
153
|
+
},
|
|
154
|
+
/**
|
|
155
|
+
* Анимация иконки: none | wiggle | scale | rotate
|
|
156
|
+
* @default 'none'
|
|
157
|
+
*/
|
|
158
|
+
iconAnimation: {
|
|
159
|
+
type: String,
|
|
160
|
+
default: "none",
|
|
161
|
+
validator: (v) => ["none", "wiggle", "scale", "rotate"].includes(v),
|
|
162
|
+
},
|
|
163
|
+
});
|
|
164
|
+
|
|
165
|
+
const emit = defineEmits(["click"]);
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* Отформатированное значение
|
|
169
|
+
*
|
|
170
|
+
* @description
|
|
171
|
+
* Форматирует значение в зависимости от valueFormat:
|
|
172
|
+
* - number: обычное число с разделителями тысяч
|
|
173
|
+
* - currency: валюта с символом
|
|
174
|
+
* - percentage: процент с символом %
|
|
175
|
+
*
|
|
176
|
+
* @returns {string} Отформатированное значение
|
|
177
|
+
*/
|
|
178
|
+
const formattedValue = computed(() => {
|
|
179
|
+
const numValue = typeof props.value === "string" ? parseFloat(props.value) : props.value;
|
|
180
|
+
|
|
181
|
+
if (props.valueFormat === "currency") {
|
|
182
|
+
return new Intl.NumberFormat("ru-RU", {
|
|
183
|
+
style: "currency",
|
|
184
|
+
currency: props.currency,
|
|
185
|
+
minimumFractionDigits: 0,
|
|
186
|
+
maximumFractionDigits: 2,
|
|
187
|
+
}).format(numValue);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
if (props.valueFormat === "percentage") {
|
|
191
|
+
return `${numValue.toFixed(1)}%`;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
// number format
|
|
195
|
+
return new Intl.NumberFormat("ru-RU").format(numValue);
|
|
196
|
+
});
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* Классы для значения
|
|
200
|
+
*
|
|
201
|
+
* @description
|
|
202
|
+
* Вычисляет классы для отображения значения на основе размера.
|
|
203
|
+
*
|
|
204
|
+
* @returns {Array} Массив классов
|
|
205
|
+
*/
|
|
206
|
+
const valueClasses = computed(() => {
|
|
207
|
+
const sizeMap = {
|
|
208
|
+
sm: "text-2xl font-bold text-slate-900",
|
|
209
|
+
md: "text-3xl font-bold text-slate-900",
|
|
210
|
+
lg: "text-4xl font-bold text-slate-900",
|
|
211
|
+
};
|
|
212
|
+
return sizeMap[props.size] || sizeMap.md;
|
|
213
|
+
});
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* Классы для тренда
|
|
217
|
+
*
|
|
218
|
+
* @description
|
|
219
|
+
* Вычисляет классы для отображения тренда на основе направления.
|
|
220
|
+
*
|
|
221
|
+
* @returns {Array} Массив классов
|
|
222
|
+
*/
|
|
223
|
+
const trendClasses = computed(() => {
|
|
224
|
+
if (!props.trend) return [];
|
|
225
|
+
|
|
226
|
+
const directionClasses = {
|
|
227
|
+
up: "text-green-600",
|
|
228
|
+
down: "text-rose-600",
|
|
229
|
+
};
|
|
230
|
+
|
|
231
|
+
return directionClasses[props.trend.direction] || "";
|
|
232
|
+
});
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* Классы для обертки иконки
|
|
236
|
+
*
|
|
237
|
+
* @description
|
|
238
|
+
* Вычисляет классы для обертки иконки на основе цвета и размера.
|
|
239
|
+
*
|
|
240
|
+
* @returns {Array} Массив классов
|
|
241
|
+
*/
|
|
242
|
+
const iconWrapperClasses = computed(() => {
|
|
243
|
+
const colorMap = {
|
|
244
|
+
primary: "text-blue-600 bg-blue-50",
|
|
245
|
+
secondary: "text-slate-600 bg-slate-50",
|
|
246
|
+
success: "text-green-600 bg-green-50",
|
|
247
|
+
warning: "text-amber-600 bg-amber-50",
|
|
248
|
+
danger: "text-rose-600 bg-rose-50",
|
|
249
|
+
};
|
|
250
|
+
|
|
251
|
+
const sizeMap = {
|
|
252
|
+
sm: "w-10 h-10",
|
|
253
|
+
md: "w-12 h-12",
|
|
254
|
+
lg: "w-14 h-14",
|
|
255
|
+
};
|
|
256
|
+
|
|
257
|
+
return useClassComposition(
|
|
258
|
+
"flex items-center justify-center rounded-lg flex-shrink-0",
|
|
259
|
+
colorMap[props.color] || colorMap.primary,
|
|
260
|
+
sizeMap[props.size] || sizeMap.md
|
|
261
|
+
);
|
|
262
|
+
});
|
|
263
|
+
|
|
264
|
+
/**
|
|
265
|
+
* Размер иконки
|
|
266
|
+
*
|
|
267
|
+
* @description
|
|
268
|
+
* Вычисляет размер иконки на основе размера карточки.
|
|
269
|
+
*
|
|
270
|
+
* @returns {string} Размер иконки
|
|
271
|
+
*/
|
|
272
|
+
const iconSize = computed(() => {
|
|
273
|
+
const sizeMap = {
|
|
274
|
+
sm: "md",
|
|
275
|
+
md: "lg",
|
|
276
|
+
lg: "xl",
|
|
277
|
+
};
|
|
278
|
+
return sizeMap[props.size] || "lg";
|
|
279
|
+
});
|
|
280
|
+
|
|
281
|
+
/**
|
|
282
|
+
* Классы для карточки
|
|
283
|
+
*
|
|
284
|
+
* @description
|
|
285
|
+
* Вычисляет классы для карточки, включая hover эффект для кликабельных карточек.
|
|
286
|
+
*
|
|
287
|
+
* @returns {Array} Массив классов
|
|
288
|
+
*/
|
|
289
|
+
const cardClasses = computed(() =>
|
|
290
|
+
useClassComposition(
|
|
291
|
+
props.clickable && "cursor-pointer transition-all hover:shadow-md hover:-translate-y-0.5"
|
|
292
|
+
)
|
|
293
|
+
);
|
|
294
|
+
|
|
295
|
+
/**
|
|
296
|
+
* Обработчик клика
|
|
297
|
+
*
|
|
298
|
+
* @description
|
|
299
|
+
* Эмитит событие click при клике на карточку (если clickable={true}).
|
|
300
|
+
*
|
|
301
|
+
* @param {MouseEvent} event - Событие клика
|
|
302
|
+
*/
|
|
303
|
+
function handleClick(event) {
|
|
304
|
+
if (props.clickable) {
|
|
305
|
+
emit("click", event);
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
</script>
|
|
309
|
+
|