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.
Files changed (334) hide show
  1. package/dist/dxd-style-code.js +11974 -3725
  2. package/dist/dxd-style-code.umd.cjs +10 -1
  3. package/dist/style.css +1 -1
  4. package/package.json +13 -6
  5. package/src/components/atoms/DXAvatar/DXAvatar.stories.js +319 -0
  6. package/src/components/atoms/DXAvatar/DXAvatar.vue +167 -0
  7. package/src/components/atoms/DXAvatar/index.js +2 -0
  8. package/src/components/atoms/DXBackdrop/DXBackdrop.stories.js +341 -0
  9. package/src/components/atoms/DXBackdrop/DXBackdrop.vue +102 -0
  10. package/src/components/atoms/DXBackdrop/index.js +2 -0
  11. package/src/components/atoms/DXBadge/DXBadge.stories.js +239 -0
  12. package/src/components/atoms/DXBadge/DXBadge.vue +45 -0
  13. package/src/components/atoms/DXBadge/index.js +2 -0
  14. package/src/components/atoms/DXButton/DXButton.stories.js +178 -0
  15. package/src/components/atoms/DXButton/DXButton.vue +84 -0
  16. package/src/components/atoms/DXButton/index.js +2 -0
  17. package/src/components/atoms/DXCard/DXCard.stories.js +133 -0
  18. package/src/components/atoms/DXCard/DXCard.vue +46 -0
  19. package/src/components/atoms/DXCard/index.js +2 -0
  20. package/src/components/atoms/DXCheckbox/DXCheckbox.stories.js +294 -0
  21. package/src/components/atoms/DXCheckbox/DXCheckbox.vue +191 -0
  22. package/src/components/atoms/DXCheckbox/index.js +2 -0
  23. package/src/components/atoms/DXDivider/DXDivider.stories.js +135 -0
  24. package/src/components/atoms/DXDivider/DXDivider.vue +74 -0
  25. package/src/components/atoms/DXDivider/index.js +2 -0
  26. package/src/components/atoms/DXDropdownItem/DXDropdownItem.vue +116 -0
  27. package/src/components/atoms/DXDropdownItem/index.js +2 -0
  28. package/src/components/atoms/DXFormLabel/DXFormLabel.stories.js +194 -0
  29. package/src/components/atoms/DXFormLabel/DXFormLabel.vue +94 -0
  30. package/src/components/atoms/DXFormLabel/index.js +2 -0
  31. package/src/components/atoms/DXIcon/DXIcon.stories.js +156 -0
  32. package/src/components/atoms/DXIcon/DXIcon.vue +102 -0
  33. package/src/components/atoms/DXIcon/index.js +3 -0
  34. package/src/components/atoms/DXIconWrapper/DXIconWrapper.stories.js +237 -0
  35. package/src/components/atoms/DXIconWrapper/DXIconWrapper.vue +79 -0
  36. package/src/components/atoms/DXIconWrapper/index.js +2 -0
  37. package/src/components/atoms/DXInputAddon/DXInputAddon.stories.js +230 -0
  38. package/src/components/atoms/DXInputAddon/DXInputAddon.vue +64 -0
  39. package/src/components/atoms/DXInputAddon/index.js +2 -0
  40. package/src/components/atoms/DXLink/DXLink.stories.js +475 -0
  41. package/src/components/atoms/DXLink/DXLink.vue +229 -0
  42. package/src/components/atoms/DXLink/index.js +2 -0
  43. package/src/components/atoms/DXLoader/DXLoader.stories.js +280 -0
  44. package/src/components/atoms/DXLoader/DXLoader.vue +78 -0
  45. package/src/components/atoms/DXLoader/index.js +2 -0
  46. package/src/components/atoms/DXProgress/DXProgress.stories.js +312 -0
  47. package/src/components/atoms/DXProgress/DXProgress.vue +85 -0
  48. package/src/components/atoms/DXProgress/index.js +2 -0
  49. package/src/components/atoms/DXQuote/DXQuote.stories.js +255 -0
  50. package/src/components/atoms/DXQuote/DXQuote.vue +97 -0
  51. package/src/components/atoms/DXQuote/index.js +2 -0
  52. package/src/components/atoms/DXRadio/DXRadio.stories.js +277 -0
  53. package/src/components/atoms/DXRadio/DXRadio.vue +144 -0
  54. package/src/components/atoms/DXRadio/index.js +2 -0
  55. package/src/components/atoms/DXSkeleton/DXSkeleton.stories.js +50 -0
  56. package/src/components/atoms/DXSkeleton/DXSkeleton.vue +19 -0
  57. package/src/components/atoms/DXSkeleton/index.js +2 -0
  58. package/src/components/atoms/DXSlider/DXSlider.stories.js +522 -0
  59. package/src/components/atoms/DXSlider/DXSlider.vue +338 -0
  60. package/src/components/atoms/DXSlider/index.js +2 -0
  61. package/src/components/atoms/DXTags/DXTags.stories.js +206 -0
  62. package/src/components/atoms/DXTags/DXTags.vue +111 -0
  63. package/src/components/atoms/DXTags/index.js +2 -0
  64. package/src/components/atoms/DXToast/DXToast.stories.js +40 -0
  65. package/src/components/atoms/DXToast/DXToast.vue +32 -0
  66. package/src/components/atoms/DXToast/index.js +2 -0
  67. package/src/components/atoms/DXToggle/DXToggle.stories.js +143 -0
  68. package/src/components/atoms/DXToggle/DXToggle.vue +142 -0
  69. package/src/components/atoms/DXToggle/index.js +2 -0
  70. package/src/components/atoms/DXToggleButton/DXToggleButton.stories.js +513 -0
  71. package/src/components/atoms/DXToggleButton/DXToggleButton.vue +140 -0
  72. package/src/components/atoms/DXToggleButton/index.js +2 -0
  73. package/src/components/atoms/DXTooltip/DXTooltip.stories.js +243 -0
  74. package/src/components/atoms/DXTooltip/DXTooltip.vue +151 -0
  75. package/src/components/atoms/DXTooltip/index.js +2 -0
  76. package/src/components/atoms/index.js +24 -0
  77. package/src/components/layout/DXBox/DXBox.stories.js +238 -0
  78. package/src/components/layout/DXBox/DXBox.vue +198 -0
  79. package/src/components/layout/DXBox/index.js +2 -0
  80. package/src/components/layout/DXContainer/DXContainer.stories.js +147 -0
  81. package/src/components/layout/DXContainer/DXContainer.vue +83 -0
  82. package/src/components/layout/DXContainer/index.js +2 -0
  83. package/src/components/layout/DXFlex/DXFlex.stories.js +210 -0
  84. package/src/components/layout/DXFlex/DXFlex.vue +149 -0
  85. package/src/components/layout/DXFlex/index.js +2 -0
  86. package/src/components/layout/DXGrid/DXGrid.stories.js +238 -0
  87. package/src/components/layout/DXGrid/DXGrid.vue +167 -0
  88. package/src/components/layout/DXGrid/index.js +2 -0
  89. package/src/components/layout/DXSpacer/DXSpacer.stories.js +187 -0
  90. package/src/components/layout/DXSpacer/DXSpacer.vue +102 -0
  91. package/src/components/layout/DXSpacer/index.js +2 -0
  92. package/src/components/layout/DXStack/DXStack.stories.js +199 -0
  93. package/src/components/layout/DXStack/DXStack.vue +140 -0
  94. package/src/components/layout/DXStack/index.js +2 -0
  95. package/src/components/layout/index.js +8 -0
  96. package/src/components/molecules/DXActionButtons/DXActionButtons.stories.js +288 -0
  97. package/src/components/molecules/DXActionButtons/DXActionButtons.vue +106 -0
  98. package/src/components/molecules/DXActionButtons/index.js +2 -0
  99. package/src/components/molecules/DXAlert/DXAlert.stories.js +70 -0
  100. package/src/components/molecules/DXAlert/DXAlert.vue +116 -0
  101. package/src/components/molecules/DXAlert/index.js +2 -0
  102. package/src/components/molecules/DXBaseTable/DXBaseTable.stories.js +433 -0
  103. package/src/components/molecules/DXBaseTable/DXBaseTable.vue +459 -0
  104. package/src/components/molecules/DXBaseTable/index.js +4 -0
  105. package/src/components/molecules/DXBreadcrumb/DXBreadcrumb.stories.js +227 -0
  106. package/src/components/molecules/DXBreadcrumb/DXBreadcrumb.vue +96 -0
  107. package/src/components/molecules/DXBreadcrumb/index.js +2 -0
  108. package/src/components/molecules/DXButtonGroup/DXButtonGroup.stories.js +26 -0
  109. package/src/components/molecules/DXButtonGroup/DXButtonGroup.vue +78 -0
  110. package/src/components/molecules/DXButtonGroup/index.js +2 -0
  111. package/src/components/molecules/DXCloseButton/DXCloseButton.stories.js +53 -0
  112. package/src/components/molecules/DXCloseButton/DXCloseButton.vue +62 -0
  113. package/src/components/molecules/DXCloseButton/index.js +3 -0
  114. package/src/components/molecules/DXComboBox/DXComboBox.stories.js +62 -0
  115. package/src/components/molecules/DXComboBox/DXComboBox.vue +167 -0
  116. package/src/components/molecules/DXComboBox/index.js +2 -0
  117. package/src/components/molecules/DXCopyField/DXCopyField.stories.js +231 -0
  118. package/src/components/molecules/DXCopyField/DXCopyField.vue +75 -0
  119. package/src/components/molecules/DXCopyField/index.js +2 -0
  120. package/src/components/molecules/DXDataFilter/DXDataFilter.stories.js +275 -0
  121. package/src/components/molecules/DXDataFilter/DXDataFilter.vue +385 -0
  122. package/src/components/molecules/DXDataFilter/index.js +2 -0
  123. package/src/components/molecules/DXDatePicker/DXDatePicker.stories.js +42 -0
  124. package/src/components/molecules/DXDatePicker/DXDatePicker.vue +121 -0
  125. package/src/components/molecules/DXDatePicker/index.js +2 -0
  126. package/src/components/molecules/DXDropdownDivider/DXDropdownDivider.vue +30 -0
  127. package/src/components/molecules/DXDropdownDivider/index.js +2 -0
  128. package/src/components/molecules/DXFileUpload/DXFileUpload.stories.js +53 -0
  129. package/src/components/molecules/DXFileUpload/DXFileUpload.vue +199 -0
  130. package/src/components/molecules/DXFileUpload/index.js +2 -0
  131. package/src/components/molecules/DXFilterGroup/DXFilterGroup.stories.js +43 -0
  132. package/src/components/molecules/DXFilterGroup/DXFilterGroup.vue +43 -0
  133. package/src/components/molecules/DXFilterGroup/index.js +2 -0
  134. package/src/components/molecules/DXFormControl/DXFormControl.stories.js +69 -0
  135. package/src/components/molecules/DXFormControl/DXFormControl.vue +72 -0
  136. package/src/components/molecules/DXFormControl/index.js +2 -0
  137. package/src/components/molecules/DXInput/DXInput.stories.js +291 -0
  138. package/src/components/molecules/DXInput/DXInput.vue +156 -0
  139. package/src/components/molecules/DXInput/index.js +3 -0
  140. package/src/components/molecules/DXInputGroup/DXInputGroup.stories.js +228 -0
  141. package/src/components/molecules/DXInputGroup/DXInputGroup.vue +64 -0
  142. package/src/components/molecules/DXInputGroup/index.js +2 -0
  143. package/src/components/molecules/DXInputMask/DXInputMask.stories.js +53 -0
  144. package/src/components/molecules/DXInputMask/DXInputMask.vue +89 -0
  145. package/src/components/molecules/DXInputMask/index.js +2 -0
  146. package/src/components/molecules/DXMenu/DXMenu.stories.js +379 -0
  147. package/src/components/molecules/DXMenu/DXMenu.vue +331 -0
  148. package/src/components/molecules/DXMenu/README.md +479 -0
  149. package/src/components/molecules/DXMenu/index.js +2 -0
  150. package/src/components/molecules/DXPagination/DXPagination.stories.js +62 -0
  151. package/src/components/molecules/DXPagination/DXPagination.vue +123 -0
  152. package/src/components/molecules/DXPagination/index.js +2 -0
  153. package/src/components/molecules/DXPasswordInput/DXPasswordInput.stories.js +42 -0
  154. package/src/components/molecules/DXPasswordInput/DXPasswordInput.vue +74 -0
  155. package/src/components/molecules/DXPasswordInput/index.js +2 -0
  156. package/src/components/molecules/DXRadioCard/DXRadioCard.stories.js +60 -0
  157. package/src/components/molecules/DXRadioCard/DXRadioCard.vue +71 -0
  158. package/src/components/molecules/DXRadioCard/index.js +2 -0
  159. package/src/components/molecules/DXRadioGroup/DXRadioGroup.stories.js +297 -0
  160. package/src/components/molecules/DXRadioGroup/DXRadioGroup.vue +73 -0
  161. package/src/components/molecules/DXRadioGroup/index.js +2 -0
  162. package/src/components/molecules/DXRating/DXRating.stories.js +322 -0
  163. package/src/components/molecules/DXRating/DXRating.vue +402 -0
  164. package/src/components/molecules/DXRating/index.js +2 -0
  165. package/src/components/molecules/DXSearchBar/DXSearchBar.stories.js +357 -0
  166. package/src/components/molecules/DXSearchBar/DXSearchBar.vue +525 -0
  167. package/src/components/molecules/DXSearchBar/index.js +2 -0
  168. package/src/components/molecules/DXSearchSelect/DXSearchSelect.stories.js +50 -0
  169. package/src/components/molecules/DXSearchSelect/DXSearchSelect.vue +207 -0
  170. package/src/components/molecules/DXSearchSelect/index.js +2 -0
  171. package/src/components/molecules/DXSegmentedControl/DXSegmentedControl.stories.js +326 -0
  172. package/src/components/molecules/DXSegmentedControl/DXSegmentedControl.vue +116 -0
  173. package/src/components/molecules/DXSegmentedControl/index.js +2 -0
  174. package/src/components/molecules/DXSelect/DXSelect.stories.js +259 -0
  175. package/src/components/molecules/DXSelect/DXSelect.vue +149 -0
  176. package/src/components/molecules/DXSelect/index.js +3 -0
  177. package/src/components/molecules/DXStatCard/DXStatCard.stories.js +335 -0
  178. package/src/components/molecules/DXStatCard/DXStatCard.vue +309 -0
  179. package/src/components/molecules/DXStatCard/index.js +2 -0
  180. package/src/components/molecules/DXTableFiltersPanel/DXTableFiltersPanel.vue +72 -0
  181. package/src/components/molecules/DXTableFiltersPanel/index.js +7 -0
  182. package/src/components/molecules/DXTablePagination/DXTablePagination.stories.js +236 -0
  183. package/src/components/molecules/DXTablePagination/DXTablePagination.vue +93 -0
  184. package/src/components/molecules/DXTablePagination/index.js +2 -0
  185. package/src/components/molecules/DXTableToolbar/DXTableToolbar.stories.js +271 -0
  186. package/src/components/molecules/DXTableToolbar/DXTableToolbar.vue +102 -0
  187. package/src/components/molecules/DXTableToolbar/index.js +2 -0
  188. package/src/components/molecules/DXTextarea/DXTextarea.stories.js +239 -0
  189. package/src/components/molecules/DXTextarea/DXTextarea.vue +158 -0
  190. package/src/components/molecules/DXTextarea/index.js +3 -0
  191. package/src/components/molecules/DXTimePicker/DXTimePicker.stories.js +282 -0
  192. package/src/components/molecules/DXTimePicker/DXTimePicker.vue +640 -0
  193. package/src/components/molecules/DXTimePicker/index.js +2 -0
  194. package/src/components/molecules/DXValidationIcon/DXValidationIcon.stories.js +60 -0
  195. package/src/components/molecules/DXValidationIcon/DXValidationIcon.vue +53 -0
  196. package/src/components/molecules/DXValidationIcon/index.js +3 -0
  197. package/src/components/molecules/index.js +34 -0
  198. package/src/components/organisms/DXAccordion/DXAccordion.stories.js +33 -0
  199. package/src/components/organisms/DXAccordion/DXAccordion.vue +104 -0
  200. package/src/components/organisms/DXAccordion/index.js +2 -0
  201. package/src/components/organisms/DXAppLayout/DXAppLayout.stories.js +689 -0
  202. package/src/components/organisms/DXAppLayout/DXAppLayout.vue +460 -0
  203. package/src/components/organisms/DXAppLayout/index.js +2 -0
  204. package/src/components/organisms/DXAuthenticationForm/DXAuthenticationForm.stories.js +232 -0
  205. package/src/components/organisms/DXAuthenticationForm/DXAuthenticationForm.vue +458 -0
  206. package/src/components/organisms/DXAuthenticationForm/index.js +2 -0
  207. package/src/components/organisms/DXChartContainer/DXChartContainer.stories.js +286 -0
  208. package/src/components/organisms/DXChartContainer/DXChartContainer.vue +273 -0
  209. package/src/components/organisms/DXChartContainer/index.js +2 -0
  210. package/src/components/organisms/DXChatInterface/DXChatInterface.stories.js +164 -0
  211. package/src/components/organisms/DXChatInterface/DXChatInterface.vue +583 -0
  212. package/src/components/organisms/DXChatInterface/index.js +2 -0
  213. package/src/components/organisms/DXCommentSection/DXCommentSection.stories.js +173 -0
  214. package/src/components/organisms/DXCommentSection/DXCommentSection.vue +487 -0
  215. package/src/components/organisms/DXCommentSection/index.js +2 -0
  216. package/src/components/organisms/DXDashboardGrid/DXDashboardGrid.stories.js +331 -0
  217. package/src/components/organisms/DXDashboardGrid/DXDashboardGrid.vue +309 -0
  218. package/src/components/organisms/DXDashboardGrid/index.js +2 -0
  219. package/src/components/organisms/DXDashboardWidget/DXDashboardWidget.stories.js +271 -0
  220. package/src/components/organisms/DXDashboardWidget/DXDashboardWidget.vue +260 -0
  221. package/src/components/organisms/DXDashboardWidget/index.js +2 -0
  222. package/src/components/organisms/DXDataTable/DXDataTable.stories.js +247 -0
  223. package/src/components/organisms/DXDataTable/DXDataTable.vue +496 -0
  224. package/src/components/organisms/DXDataTable/index.js +2 -0
  225. package/src/components/organisms/DXDropdown/DXDropdown.stories.js +795 -0
  226. package/src/components/organisms/DXDropdown/DXDropdown.vue +238 -0
  227. package/src/components/organisms/DXDropdown/index.js +2 -0
  228. package/src/components/organisms/DXEmptyState/DXEmptyState.stories.js +37 -0
  229. package/src/components/organisms/DXEmptyState/DXEmptyState.vue +41 -0
  230. package/src/components/organisms/DXEmptyState/index.js +2 -0
  231. package/src/components/organisms/DXFormWizard/DXFormWizard.stories.js +378 -0
  232. package/src/components/organisms/DXFormWizard/DXFormWizard.vue +578 -0
  233. package/src/components/organisms/DXFormWizard/index.js +2 -0
  234. package/src/components/organisms/DXHeaderBar/DXHeaderBar.stories.js +448 -0
  235. package/src/components/organisms/DXHeaderBar/DXHeaderBar.vue +190 -0
  236. package/src/components/organisms/DXHeaderBar/index.js +2 -0
  237. package/src/components/organisms/DXMediaGallery/DXMediaGallery.stories.js +347 -0
  238. package/src/components/organisms/DXMediaGallery/DXMediaGallery.vue +422 -0
  239. package/src/components/organisms/DXMediaGallery/index.js +2 -0
  240. package/src/components/organisms/DXModal/DXModal.stories.js +138 -0
  241. package/src/components/organisms/DXModal/DXModal.vue +213 -0
  242. package/src/components/organisms/DXModal/index.js +2 -0
  243. package/src/components/organisms/DXNotificationCenter/DXNotificationCenter.stories.js +183 -0
  244. package/src/components/organisms/DXNotificationCenter/DXNotificationCenter.vue +566 -0
  245. package/src/components/organisms/DXNotificationCenter/index.js +2 -0
  246. package/src/components/organisms/DXReportGenerator/DXReportGenerator.stories.js +199 -0
  247. package/src/components/organisms/DXReportGenerator/DXReportGenerator.vue +344 -0
  248. package/src/components/organisms/DXReportGenerator/index.js +2 -0
  249. package/src/components/organisms/DXSettingsPanel/DXSettingsPanel.stories.js +245 -0
  250. package/src/components/organisms/DXSettingsPanel/DXSettingsPanel.vue +454 -0
  251. package/src/components/organisms/DXSettingsPanel/index.js +2 -0
  252. package/src/components/organisms/DXSidebar/DXSidebar.stories.js +316 -0
  253. package/src/components/organisms/DXSidebar/DXSidebar.vue +212 -0
  254. package/src/components/organisms/DXSidebar/index.js +2 -0
  255. package/src/components/organisms/DXSidebarMenu/DATA_STRUCTURE.md +299 -0
  256. package/src/components/organisms/DXSidebarMenu/DXSidebarMenu.stories.js +729 -0
  257. package/src/components/organisms/DXSidebarMenu/DXSidebarMenu.vue +257 -0
  258. package/src/components/organisms/DXSidebarMenu/DXSidebarMenuItem.vue +249 -0
  259. package/src/components/organisms/DXSidebarMenu/README.md +333 -0
  260. package/src/components/organisms/DXSidebarMenu/index.js +3 -0
  261. package/src/components/organisms/DXTable/DXTable.stories.js +550 -0
  262. package/src/components/organisms/DXTable/DXTable.vue +324 -0
  263. package/src/components/organisms/DXTable/index.js +2 -0
  264. package/src/components/organisms/DXTabs/DXTabs.stories.js +407 -0
  265. package/src/components/organisms/DXTabs/DXTabs.vue +301 -0
  266. package/src/components/organisms/DXTabs/index.js +2 -0
  267. package/src/components/organisms/DXUserProfileCard/DXUserProfileCard.stories.js +194 -0
  268. package/src/components/organisms/DXUserProfileCard/DXUserProfileCard.vue +403 -0
  269. package/src/components/organisms/DXUserProfileCard/index.js +2 -0
  270. package/src/components/organisms/DXWizard/DXWizard.stories.js +212 -0
  271. package/src/components/organisms/DXWizard/DXWizard.vue +615 -0
  272. package/src/components/organisms/DXWizard/index.js +2 -0
  273. package/src/components/organisms/index.js +25 -0
  274. package/src/components/typography/DXBlockquote/DXBlockquote.stories.js +33 -0
  275. package/src/components/typography/DXBlockquote/DXBlockquote.vue +44 -0
  276. package/src/components/typography/DXBlockquote/index.js +2 -0
  277. package/src/components/typography/DXCode/DXCode.stories.js +29 -0
  278. package/src/components/typography/DXCode/DXCode.vue +46 -0
  279. package/src/components/typography/DXCode/index.js +2 -0
  280. package/src/components/typography/DXHeading/DXHeading.stories.js +54 -0
  281. package/src/components/typography/DXHeading/DXHeading.vue +68 -0
  282. package/src/components/typography/DXHeading/index.js +2 -0
  283. package/src/components/typography/DXLabel/DXLabel.stories.js +40 -0
  284. package/src/components/typography/DXLabel/DXLabel.vue +49 -0
  285. package/src/components/typography/DXLabel/index.js +2 -0
  286. package/src/components/typography/DXList/DXList.stories.js +50 -0
  287. package/src/components/typography/DXList/DXList.vue +55 -0
  288. package/src/components/typography/DXList/index.js +2 -0
  289. package/src/components/typography/DXText/DXText.stories.js +47 -0
  290. package/src/components/typography/DXText/DXText.vue +67 -0
  291. package/src/components/typography/DXText/index.js +2 -0
  292. package/src/components/typography/index.js +8 -0
  293. package/src/components/utilities/DXAnimatePresence/DXAnimatePresence.stories.js +335 -0
  294. package/src/components/utilities/DXAnimatePresence/DXAnimatePresence.vue +207 -0
  295. package/src/components/utilities/DXAnimatePresence/index.js +2 -0
  296. package/src/components/utilities/DXBreakpointProvider/DXBreakpointProvider.stories.js +321 -0
  297. package/src/components/utilities/DXBreakpointProvider/DXBreakpointProvider.vue +158 -0
  298. package/src/components/utilities/DXBreakpointProvider/index.js +2 -0
  299. package/src/components/utilities/DXObserver/DXObserver.stories.js +324 -0
  300. package/src/components/utilities/DXObserver/DXObserver.vue +182 -0
  301. package/src/components/utilities/DXObserver/index.js +2 -0
  302. package/src/components/utilities/DXPortal/DXPortal.stories.js +267 -0
  303. package/src/components/utilities/DXPortal/DXPortal.vue +69 -0
  304. package/src/components/utilities/DXPortal/index.js +2 -0
  305. package/src/components/utilities/DXStaggeredAnimation/DXStaggeredAnimation.stories.js +339 -0
  306. package/src/components/utilities/DXStaggeredAnimation/DXStaggeredAnimation.vue +155 -0
  307. package/src/components/utilities/DXStaggeredAnimation/index.js +2 -0
  308. package/src/components/utilities/DXThemeProvider/DXThemeProvider.stories.js +327 -0
  309. package/src/components/utilities/DXThemeProvider/DXThemeProvider.vue +227 -0
  310. package/src/components/utilities/DXThemeProvider/index.js +2 -0
  311. package/src/components/utilities/DXTransitionGroup/DXTransitionGroup.stories.js +368 -0
  312. package/src/components/utilities/DXTransitionGroup/DXTransitionGroup.vue +212 -0
  313. package/src/components/utilities/DXTransitionGroup/index.js +2 -0
  314. package/src/components/utilities/index.js +9 -0
  315. package/src/composables/useAnimation.js +264 -0
  316. package/src/composables/useClassComposition.js +35 -0
  317. package/src/composables/useDataAttributes.js +83 -0
  318. package/src/composables/useMenu.js +88 -0
  319. package/src/composables/useSize.js +135 -0
  320. package/src/composables/useSpacing.js +37 -0
  321. package/src/composables/useTableColumns.js +88 -0
  322. package/src/composables/useTableData.js +82 -0
  323. package/src/composables/useTableFilter.js +158 -0
  324. package/src/composables/useTablePagination.js +89 -0
  325. package/src/composables/useTableSelection.js +77 -0
  326. package/src/composables/useTableSort.js +75 -0
  327. package/src/composables/useTabsScroll.js +88 -0
  328. package/src/composables/useVariant.js +700 -0
  329. package/src/index.js +86 -0
  330. package/src/styles/animations.css +171 -0
  331. package/src/styles/index.css +99 -0
  332. package/src/styles/tokens.js +123 -0
  333. package/src/utils/propTypes.js +77 -0
  334. package/src/utils/toggleButtonPresets.js +115 -0
@@ -0,0 +1,207 @@
1
+ <template>
2
+ <div class="relative" ref="root" data-component="DXSearchSelect">
3
+ <label v-if="label" class="block text-sm text-slate-600 mb-1 font-medium">{{ label }}</label>
4
+
5
+ <!-- Multiple: Tags Display -->
6
+ <div v-if="multiple && selectedOptions.length > 0" class="flex flex-wrap gap-2 mb-2">
7
+ <span
8
+ v-for="option in selectedOptions"
9
+ :key="option.value"
10
+ class="inline-flex items-center gap-1 px-2 py-1 text-xs font-medium bg-slate-100 text-slate-700 rounded-lg"
11
+ >
12
+ <component v-if="option.icon" :is="option.icon" class="w-3 h-3" />
13
+ {{ option.label }}
14
+ <button type="button" class="hover:text-slate-900" @click.stop="removeOption(option.value)">
15
+ <svg class="w-3 h-3" fill="none" stroke="currentColor" viewBox="0 0 24 24">
16
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" />
17
+ </svg>
18
+ </button>
19
+ </span>
20
+ </div>
21
+
22
+ <!-- Trigger Button -->
23
+ <button
24
+ type="button"
25
+ class="w-full flex items-center justify-between h-10 px-4 py-2.5 text-sm rounded-xl border border-slate-200 bg-white transition-colors"
26
+ :class="[
27
+ !open && 'hover:border-slate-300',
28
+ open && 'ring-2 ring-slate-900/10 border-slate-300',
29
+ ]"
30
+ @click="toggle"
31
+ >
32
+ <span class="truncate flex items-center gap-2">
33
+ <component v-if="!multiple && selectedOption?.icon" :is="selectedOption.icon" class="w-4 h-4 text-slate-500" />
34
+ {{ displayLabel }}
35
+ </span>
36
+ <svg class="w-4 h-4 text-slate-400 transition-transform" :class="{ 'rotate-180': open }" fill="none" stroke="currentColor" viewBox="0 0 24 24">
37
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7" />
38
+ </svg>
39
+ </button>
40
+
41
+ <!-- Dropdown Menu -->
42
+ <div v-if="open" class="absolute z-20 mt-2 w-full bg-white border border-slate-200 rounded-xl shadow-lg p-3 space-y-2">
43
+ <!-- Search Input -->
44
+ <div class="relative">
45
+ <input
46
+ ref="searchInput"
47
+ v-model="search"
48
+ class="w-full px-3 py-2 text-sm border border-slate-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-slate-900/10"
49
+ :placeholder="searchPlaceholder"
50
+ @keydown.stop
51
+ @keydown.escape="open = false"
52
+ />
53
+ <svg class="absolute right-3 top-2.5 w-4 h-4 text-slate-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
54
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" />
55
+ </svg>
56
+ </div>
57
+
58
+ <!-- Options List -->
59
+ <div class="max-h-48 overflow-y-auto space-y-1">
60
+ <button
61
+ v-for="opt in filtered"
62
+ :key="opt.value"
63
+ type="button"
64
+ class="w-full text-left px-3 py-2 rounded-lg hover:bg-slate-50 text-sm flex items-center justify-between gap-2"
65
+ :class="{ 'bg-slate-100': isSelected(opt.value) }"
66
+ @click="select(opt.value)"
67
+ >
68
+ <span class="flex items-center gap-2 flex-1 truncate">
69
+ <component v-if="opt.icon" :is="opt.icon" class="w-4 h-4 text-slate-500" />
70
+ {{ opt.label }}
71
+ </span>
72
+ <svg v-if="isSelected(opt.value)" class="w-4 h-4 text-slate-900 flex-shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24">
73
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" />
74
+ </svg>
75
+ </button>
76
+
77
+ <!-- Create New Option -->
78
+ <button
79
+ v-if="creatable && search && !filtered.length"
80
+ type="button"
81
+ class="w-full text-left px-3 py-2 rounded-lg hover:bg-slate-50 text-sm flex items-center gap-2 text-slate-600"
82
+ @click="createOption"
83
+ >
84
+ <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
85
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4v16m8-8H4" />
86
+ </svg>
87
+ Создать "{{ search }}"
88
+ </button>
89
+
90
+ <p v-else-if="!filtered.length" class="text-xs text-slate-500 px-3 py-2">Не найдено</p>
91
+ </div>
92
+ </div>
93
+ </div>
94
+ </template>
95
+
96
+ <script setup>
97
+ import { ref, computed, onMounted, onBeforeUnmount, nextTick, watch } from "vue";
98
+
99
+ const props = defineProps({
100
+ /** Значение (v-model) - строка или массив для multiple */
101
+ modelValue: [String, Number, Array],
102
+ /** Опции: [{ value, label, icon? }] */
103
+ options: { type: Array, default: () => [] },
104
+ /** Лейбл */
105
+ label: { type: String, default: "" },
106
+ /** Placeholder */
107
+ placeholder: { type: String, default: "Выбрать" },
108
+ /** Placeholder поиска */
109
+ searchPlaceholder: { type: String, default: "Поиск..." },
110
+ /** Множественный выбор */
111
+ multiple: { type: Boolean, default: false },
112
+ /** Возможность создавать новые опции */
113
+ creatable: { type: Boolean, default: false },
114
+ });
115
+
116
+ const emit = defineEmits(["update:modelValue", "create"]);
117
+
118
+ const open = ref(false);
119
+ const search = ref("");
120
+ const root = ref(null);
121
+ const searchInput = ref(null);
122
+
123
+ const selectedOption = computed(() => {
124
+ if (props.multiple) return null;
125
+ return props.options.find((o) => String(o.value) === String(props.modelValue));
126
+ });
127
+
128
+ const selectedOptions = computed(() => {
129
+ if (!props.multiple) return [];
130
+ const values = Array.isArray(props.modelValue) ? props.modelValue : [];
131
+ return props.options.filter((o) => values.includes(o.value));
132
+ });
133
+
134
+ const displayLabel = computed(() => {
135
+ if (props.multiple) {
136
+ const count = selectedOptions.value.length;
137
+ return count > 0 ? `Выбрано: ${count}` : props.placeholder;
138
+ }
139
+ return selectedOption.value ? selectedOption.value.label : props.placeholder;
140
+ });
141
+
142
+ const filtered = computed(() => {
143
+ const term = search.value.toLowerCase().trim();
144
+ if (!term) return props.options;
145
+ return props.options.filter((o) => o.label.toLowerCase().includes(term));
146
+ });
147
+
148
+ const isSelected = (value) => {
149
+ if (props.multiple) {
150
+ const values = Array.isArray(props.modelValue) ? props.modelValue : [];
151
+ return values.includes(value);
152
+ }
153
+ return props.modelValue === value;
154
+ };
155
+
156
+ const toggle = () => {
157
+ open.value = !open.value;
158
+ if (open.value) {
159
+ nextTick(() => searchInput.value?.focus());
160
+ }
161
+ };
162
+
163
+ const select = (val) => {
164
+ if (props.multiple) {
165
+ const values = Array.isArray(props.modelValue) ? props.modelValue : [];
166
+ const index = values.indexOf(val);
167
+ if (index > -1) {
168
+ const newValues = [...values];
169
+ newValues.splice(index, 1);
170
+ emit("update:modelValue", newValues);
171
+ } else {
172
+ emit("update:modelValue", [...values, val]);
173
+ }
174
+ } else {
175
+ emit("update:modelValue", val);
176
+ open.value = false;
177
+ }
178
+ search.value = "";
179
+ };
180
+
181
+ const removeOption = (val) => {
182
+ if (props.multiple) {
183
+ const values = Array.isArray(props.modelValue) ? props.modelValue : [];
184
+ emit("update:modelValue", values.filter((v) => v !== val));
185
+ }
186
+ };
187
+
188
+ const createOption = () => {
189
+ if (props.creatable && search.value) {
190
+ emit("create", search.value);
191
+ search.value = "";
192
+ }
193
+ };
194
+
195
+ const onClickOutside = (e) => {
196
+ if (root.value && !root.value.contains(e.target)) {
197
+ open.value = false;
198
+ search.value = "";
199
+ }
200
+ };
201
+
202
+ watch(open, (newVal) => { if (!newVal) search.value = ""; });
203
+
204
+ onMounted(() => document.addEventListener("click", onClickOutside));
205
+ onBeforeUnmount(() => document.removeEventListener("click", onClickOutside));
206
+ </script>
207
+
@@ -0,0 +1,2 @@
1
+ export { default } from './DXSearchSelect.vue';
2
+
@@ -0,0 +1,326 @@
1
+ import DXSegmentedControl from './DXSegmentedControl.vue';
2
+ import { ref } from 'vue';
3
+ import {
4
+ Squares2X2Icon,
5
+ ListBulletIcon,
6
+ TableCellsIcon,
7
+ HomeIcon,
8
+ UserIcon,
9
+ Cog6ToothIcon,
10
+ BellIcon,
11
+ EnvelopeIcon,
12
+ ChatBubbleLeftIcon,
13
+ SunIcon,
14
+ MoonIcon,
15
+ ComputerDesktopIcon,
16
+ ChartBarIcon,
17
+ DocumentTextIcon,
18
+ PhotoIcon,
19
+ VideoCameraIcon,
20
+ MusicalNoteIcon,
21
+ } from '@heroicons/vue/24/outline';
22
+
23
+ export default {
24
+ title: 'Molecules/DXSegmentedControl',
25
+ component: DXSegmentedControl,
26
+ tags: ['autodocs'],
27
+ argTypes: {
28
+ iconAnimation: {
29
+ control: 'select',
30
+ options: ['none', 'wiggle', 'scale', 'rotate'],
31
+ },
32
+ },
33
+ };
34
+
35
+ export const Default = {
36
+ render: () => ({
37
+ components: { DXSegmentedControl },
38
+ setup() {
39
+ const selected = ref('all');
40
+ const options = [
41
+ { value: 'all', label: 'All' },
42
+ { value: 'active', label: 'Active' },
43
+ { value: 'inactive', label: 'Inactive' },
44
+ ];
45
+ return { selected, options };
46
+ },
47
+ template: '<DXSegmentedControl v-model="selected" :options="options" />',
48
+ }),
49
+ };
50
+
51
+ export const WithCounts = {
52
+ render: () => ({
53
+ components: { DXSegmentedControl },
54
+ setup() {
55
+ const selected = ref('all');
56
+ const options = [
57
+ { value: 'all', label: 'All', count: 42 },
58
+ { value: 'active', label: 'Active', count: 28 },
59
+ { value: 'archived', label: 'Archived', count: 14 },
60
+ ];
61
+ return { selected, options };
62
+ },
63
+ template: '<DXSegmentedControl v-model="selected" :options="options" />',
64
+ }),
65
+ };
66
+
67
+ export const WithIcons = {
68
+ render: () => ({
69
+ components: { DXSegmentedControl },
70
+ setup() {
71
+ const view = ref('grid');
72
+ const options = [
73
+ { value: 'grid', icon: Squares2X2Icon, label: 'Grid' },
74
+ { value: 'list', icon: ListBulletIcon, label: 'List' },
75
+ { value: 'table', icon: TableCellsIcon, label: 'Table' },
76
+ ];
77
+ return { view, options };
78
+ },
79
+ template: '<DXSegmentedControl v-model="view" :options="options" />',
80
+ }),
81
+ };
82
+
83
+ export const IconsOnly = {
84
+ render: () => ({
85
+ components: { DXSegmentedControl },
86
+ setup() {
87
+ const view = ref('grid');
88
+ const options = [
89
+ { value: 'grid', icon: Squares2X2Icon },
90
+ { value: 'list', icon: ListBulletIcon },
91
+ { value: 'table', icon: TableCellsIcon },
92
+ ];
93
+ return { view, options };
94
+ },
95
+ template: '<DXSegmentedControl v-model="view" :options="options" />',
96
+ }),
97
+ };
98
+
99
+ export const Navigation = {
100
+ render: () => ({
101
+ components: { DXSegmentedControl },
102
+ setup() {
103
+ const page = ref('home');
104
+ const options = [
105
+ { value: 'home', icon: HomeIcon, label: 'Home' },
106
+ { value: 'profile', icon: UserIcon, label: 'Profile' },
107
+ { value: 'settings', icon: Cog6ToothIcon, label: 'Settings' },
108
+ ];
109
+ return { page, options };
110
+ },
111
+ template: '<DXSegmentedControl v-model="page" :options="options" />',
112
+ }),
113
+ };
114
+
115
+ export const NotificationTypes = {
116
+ render: () => ({
117
+ components: { DXSegmentedControl },
118
+ setup() {
119
+ const type = ref('all');
120
+ const options = [
121
+ { value: 'all', icon: BellIcon, label: 'All', count: 42 },
122
+ { value: 'email', icon: EnvelopeIcon, label: 'Email', count: 12 },
123
+ { value: 'chat', icon: ChatBubbleLeftIcon, label: 'Chat', count: 30 },
124
+ ];
125
+ return { type, options };
126
+ },
127
+ template: '<DXSegmentedControl v-model="type" :options="options" />',
128
+ }),
129
+ };
130
+
131
+ export const ThemeSelector = {
132
+ render: () => ({
133
+ components: { DXSegmentedControl },
134
+ setup() {
135
+ const theme = ref('light');
136
+ const options = [
137
+ { value: 'light', icon: SunIcon, label: 'Light' },
138
+ { value: 'dark', icon: MoonIcon, label: 'Dark' },
139
+ { value: 'auto', icon: ComputerDesktopIcon, label: 'Auto' },
140
+ ];
141
+ return { theme, options };
142
+ },
143
+ template: '<DXSegmentedControl v-model="theme" :options="options" />',
144
+ }),
145
+ };
146
+
147
+ export const MediaTypes = {
148
+ render: () => ({
149
+ components: { DXSegmentedControl },
150
+ setup() {
151
+ const media = ref('all');
152
+ const options = [
153
+ { value: 'all', icon: DocumentTextIcon, count: 156 },
154
+ { value: 'photos', icon: PhotoIcon, count: 89 },
155
+ { value: 'videos', icon: VideoCameraIcon, count: 45 },
156
+ { value: 'audio', icon: MusicalNoteIcon, count: 22 },
157
+ ];
158
+ return { media, options };
159
+ },
160
+ template: '<DXSegmentedControl v-model="media" :options="options" icon-animation="scale" />',
161
+ }),
162
+ };
163
+
164
+ export const AnimatedIcons = {
165
+ render: () => ({
166
+ components: { DXSegmentedControl },
167
+ setup() {
168
+ const wiggle = ref('grid');
169
+ const scale = ref('grid');
170
+ const rotate = ref('grid');
171
+ const options = [
172
+ { value: 'grid', icon: Squares2X2Icon },
173
+ { value: 'list', icon: ListBulletIcon },
174
+ { value: 'table', icon: TableCellsIcon },
175
+ ];
176
+ return { wiggle, scale, rotate, options };
177
+ },
178
+ template: `
179
+ <div class="space-y-6">
180
+ <div>
181
+ <p class="text-xs text-slate-500 mb-2">Wiggle Animation</p>
182
+ <DXSegmentedControl v-model="wiggle" :options="options" icon-animation="wiggle" />
183
+ </div>
184
+
185
+ <div>
186
+ <p class="text-xs text-slate-500 mb-2">Scale Animation</p>
187
+ <DXSegmentedControl v-model="scale" :options="options" icon-animation="scale" />
188
+ </div>
189
+
190
+ <div>
191
+ <p class="text-xs text-slate-500 mb-2">Rotate Animation</p>
192
+ <DXSegmentedControl v-model="rotate" :options="options" icon-animation="rotate" />
193
+ </div>
194
+ </div>
195
+ `,
196
+ }),
197
+ };
198
+
199
+ export const AnimateAll = {
200
+ render: () => ({
201
+ components: { DXSegmentedControl },
202
+ setup() {
203
+ const view = ref('grid');
204
+ const options = [
205
+ { value: 'grid', icon: Squares2X2Icon, label: 'Grid' },
206
+ { value: 'list', icon: ListBulletIcon, label: 'List' },
207
+ { value: 'table', icon: TableCellsIcon, label: 'Table' },
208
+ ];
209
+ return { view, options };
210
+ },
211
+ template: '<DXSegmentedControl v-model="view" :options="options" icon-animation="wiggle" :animate-active-only="false" />',
212
+ }),
213
+ };
214
+
215
+ export const Disabled = {
216
+ render: () => ({
217
+ components: { DXSegmentedControl },
218
+ setup() {
219
+ const selected = ref('option1');
220
+ const options = [
221
+ { value: 'option1', icon: HomeIcon, label: 'Option 1' },
222
+ { value: 'option2', icon: UserIcon, label: 'Option 2' },
223
+ ];
224
+ return { selected, options };
225
+ },
226
+ template: '<DXSegmentedControl v-model="selected" :options="options" disabled />',
227
+ }),
228
+ };
229
+
230
+ export const Interactive = {
231
+ render: () => ({
232
+ components: { DXSegmentedControl },
233
+ setup() {
234
+ const tab = ref('data');
235
+ const options = [
236
+ { value: 'data', icon: ChartBarIcon, label: 'Analytics', count: 24 },
237
+ { value: 'messages', icon: EnvelopeIcon, label: 'Messages', count: 5 },
238
+ { value: 'notifications', icon: BellIcon, label: 'Alerts', count: 12 },
239
+ ];
240
+ return { tab, options };
241
+ },
242
+ template: `
243
+ <div class="p-6 bg-slate-50 rounded-xl space-y-4">
244
+ <h3 class="text-lg font-semibold text-slate-900">Dashboard Tabs</h3>
245
+ <DXSegmentedControl
246
+ v-model="tab"
247
+ :options="options"
248
+ icon-animation="wiggle"
249
+ />
250
+ <div class="p-4 bg-white rounded-lg border border-slate-200">
251
+ <p class="text-sm text-slate-600">
252
+ Current tab: <strong class="text-slate-900">{{ tab }}</strong>
253
+ </p>
254
+ </div>
255
+ </div>
256
+ `,
257
+ }),
258
+ };
259
+
260
+ export const AllVariants = {
261
+ render: () => ({
262
+ components: { DXSegmentedControl },
263
+ setup() {
264
+ const simple = ref('all');
265
+ const withCounts = ref('all');
266
+ const withIcons = ref('grid');
267
+ const iconsOnly = ref('grid');
268
+ const animated = ref('grid');
269
+
270
+ const simpleOptions = [
271
+ { value: 'all', label: 'All' },
272
+ { value: 'active', label: 'Active' },
273
+ { value: 'inactive', label: 'Inactive' },
274
+ ];
275
+
276
+ const countOptions = [
277
+ { value: 'all', label: 'All', count: 42 },
278
+ { value: 'active', label: 'Active', count: 28 },
279
+ { value: 'archived', label: 'Archived', count: 14 },
280
+ ];
281
+
282
+ const iconOptions = [
283
+ { value: 'grid', icon: Squares2X2Icon, label: 'Grid' },
284
+ { value: 'list', icon: ListBulletIcon, label: 'List' },
285
+ { value: 'table', icon: TableCellsIcon, label: 'Table' },
286
+ ];
287
+
288
+ const iconOnlyOptions = [
289
+ { value: 'grid', icon: Squares2X2Icon },
290
+ { value: 'list', icon: ListBulletIcon },
291
+ { value: 'table', icon: TableCellsIcon },
292
+ ];
293
+
294
+ return { simple, withCounts, withIcons, iconsOnly, animated, simpleOptions, countOptions, iconOptions, iconOnlyOptions };
295
+ },
296
+ template: `
297
+ <div class="space-y-6">
298
+ <div>
299
+ <p class="text-xs text-slate-500 mb-2">Simple</p>
300
+ <DXSegmentedControl v-model="simple" :options="simpleOptions" />
301
+ </div>
302
+
303
+ <div>
304
+ <p class="text-xs text-slate-500 mb-2">With Counts</p>
305
+ <DXSegmentedControl v-model="withCounts" :options="countOptions" />
306
+ </div>
307
+
308
+ <div>
309
+ <p class="text-xs text-slate-500 mb-2">With Icons</p>
310
+ <DXSegmentedControl v-model="withIcons" :options="iconOptions" />
311
+ </div>
312
+
313
+ <div>
314
+ <p class="text-xs text-slate-500 mb-2">Icons Only</p>
315
+ <DXSegmentedControl v-model="iconsOnly" :options="iconOnlyOptions" />
316
+ </div>
317
+
318
+ <div>
319
+ <p class="text-xs text-slate-500 mb-2">Animated Icons</p>
320
+ <DXSegmentedControl v-model="animated" :options="iconOnlyOptions" icon-animation="scale" />
321
+ </div>
322
+ </div>
323
+ `,
324
+ }),
325
+ };
326
+
@@ -0,0 +1,116 @@
1
+ <template>
2
+ <div class="inline-flex" data-component="DXSegmentedControl">
3
+ <p v-if="label" class="text-sm font-medium text-slate-700 mb-2">{{ label }}</p>
4
+ <div class="relative inline-flex p-1 bg-slate-100 rounded-xl gap-1">
5
+ <!-- Floating indicator -->
6
+ <div
7
+ class="absolute bg-white rounded-lg shadow-sm transition-all duration-200 ease-out"
8
+ :style="indicatorStyle"
9
+ />
10
+
11
+ <!-- Buttons -->
12
+ <button
13
+ v-for="(option, index) in options"
14
+ :key="option.value"
15
+ type="button"
16
+ :ref="el => { if (el) buttonRefs[index] = el }"
17
+ class="relative z-10 px-4 py-1.5 text-sm font-medium transition-colors duration-150 rounded-lg whitespace-nowrap min-w-[60px] text-center inline-flex items-center justify-center gap-1.5"
18
+ :class="[
19
+ modelValue === option.value
20
+ ? 'text-slate-900'
21
+ : 'text-slate-600 hover:text-slate-900',
22
+ disabled && 'opacity-60 cursor-not-allowed',
23
+ ]"
24
+ :disabled="disabled"
25
+ @click="select(option.value)"
26
+ >
27
+ <DXIcon
28
+ v-if="option.icon"
29
+ :icon="option.icon"
30
+ size="xs"
31
+ :animation="getIconAnimation(option)"
32
+ />
33
+ <span v-if="option.label">{{ option.label }}</span>
34
+ <span
35
+ v-if="option.count !== undefined && option.count !== null"
36
+ class="inline-flex items-center justify-center min-w-[20px] h-5 px-1.5 text-[11px] font-semibold rounded-full"
37
+ :class="modelValue === option.value
38
+ ? 'bg-slate-800 text-white'
39
+ : 'bg-slate-200 text-slate-700'"
40
+ >
41
+ {{ option.count }}
42
+ </span>
43
+ </button>
44
+ </div>
45
+ </div>
46
+ </template>
47
+
48
+ <script setup>
49
+ import { ref, computed, watch, nextTick, onMounted } from "vue";
50
+ import DXIcon from "../../atoms/DXIcon/DXIcon.vue";
51
+
52
+ const props = defineProps({
53
+ modelValue: [String, Number, Boolean],
54
+ options: {
55
+ type: Array,
56
+ required: true,
57
+ },
58
+ label: { type: String, default: "" },
59
+ /** Анимация иконок: none | wiggle | scale | rotate */
60
+ iconAnimation: { type: String, default: "none" },
61
+ /** Анимировать только активную иконку */
62
+ animateActiveOnly: { type: Boolean, default: true },
63
+ disabled: { type: Boolean, default: false },
64
+ });
65
+
66
+ const emit = defineEmits(["update:modelValue"]);
67
+
68
+ const buttonRefs = ref([]);
69
+ const indicatorStyle = ref({});
70
+
71
+ const selectedIndex = computed(() => {
72
+ return props.options.findIndex((opt) => opt.value === props.modelValue);
73
+ });
74
+
75
+ const updateIndicator = () => {
76
+ const index = selectedIndex.value;
77
+ if (index >= 0 && buttonRefs.value[index]) {
78
+ const button = buttonRefs.value[index];
79
+ indicatorStyle.value = {
80
+ width: `${button.offsetWidth}px`,
81
+ height: `${button.offsetHeight}px`,
82
+ left: `${button.offsetLeft}px`,
83
+ top: `${button.offsetTop}px`,
84
+ };
85
+ }
86
+ };
87
+
88
+ const select = (value) => {
89
+ if (!props.disabled) {
90
+ emit("update:modelValue", value);
91
+ }
92
+ };
93
+
94
+ // Определяет анимацию для иконки
95
+ const getIconAnimation = (option) => {
96
+ // Если анимация отключена
97
+ if (props.iconAnimation === 'none') return 'none';
98
+
99
+ // Если анимировать только активную иконку
100
+ if (props.animateActiveOnly) {
101
+ return props.modelValue === option.value ? props.iconAnimation : 'none';
102
+ }
103
+
104
+ // Анимировать все иконки
105
+ return props.iconAnimation;
106
+ };
107
+
108
+ watch(() => props.modelValue, () => {
109
+ nextTick(updateIndicator);
110
+ });
111
+
112
+ onMounted(() => {
113
+ nextTick(updateIndicator);
114
+ });
115
+ </script>
116
+
@@ -0,0 +1,2 @@
1
+ export { default } from './DXSegmentedControl.vue';
2
+