dxd-style-code 0.1.11 → 0.1.13
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 +7470 -6336
- package/dist/dxd-style-code.umd.cjs +3 -3
- package/dist/style.css +1 -1
- package/package.json +2 -2
- package/src/components/atoms/DX/DX.stories.js +265 -0
- package/src/components/atoms/DX/DX.vue +80 -0
- package/src/components/atoms/DX/index.js +2 -0
- package/src/components/atoms/DXAvatar/DXAvatar.stories.js +1 -2
- package/src/components/atoms/DXBackdrop/DXBackdrop.stories.js +77 -1
- package/src/components/atoms/DXBadge/DXBadge.stories.js +83 -1
- package/src/components/atoms/DXBlockquote/DXBlockquote.stories.js +67 -1
- package/src/components/atoms/DXBox/DXBox.stories.js +1 -1
- package/src/components/atoms/DXBox/DXBox.vue +69 -2
- package/src/components/atoms/DXButton/DXButton.stories.js +94 -1
- package/src/components/atoms/DXButton/DXButton.vue +145 -11
- package/src/components/atoms/DXCard/DXCard.stories.js +72 -14
- package/src/components/atoms/DXCard/DXCard.vue +3 -4
- package/src/components/atoms/DXCheckbox/DXCheckbox.stories.js +85 -1
- package/src/components/atoms/DXCode/DXCode.stories.js +67 -1
- package/src/components/atoms/DXContainer/DXContainer.stories.js +1 -1
- package/src/components/atoms/DXContainer/DXContainer.vue +28 -1
- package/src/components/atoms/DXDivider/DXDivider.stories.js +84 -1
- package/src/components/atoms/DXFlex/DXFlex.stories.js +1 -1
- package/src/components/atoms/DXFlex/DXFlex.vue +57 -3
- package/src/components/atoms/DXFormLabel/DXFormLabel.stories.js +70 -1
- package/src/components/atoms/DXGrid/DXGrid.stories.js +1 -1
- package/src/components/atoms/DXHeading/DXHeading.stories.js +90 -1
- package/src/components/atoms/DXIcon/DXIcon.stories.js +74 -0
- package/src/components/atoms/DXIconWrapper/DXIconWrapper.stories.js +69 -0
- package/src/components/atoms/DXImage/DXImage.stories.js +483 -0
- package/src/components/atoms/DXImage/DXImage.vue +294 -0
- package/src/components/atoms/DXImage/index.js +2 -0
- package/src/components/atoms/DXInputAddon/DXInputAddon.stories.js +86 -1
- package/src/components/atoms/DXLabel/DXLabel.stories.js +62 -1
- package/src/components/atoms/DXLink/DXLink.stories.js +75 -10
- package/src/components/atoms/DXLink/DXLink.vue +59 -3
- package/src/components/atoms/DXList/DXList.stories.js +76 -1
- package/src/components/atoms/DXLoader/DXLoader.stories.js +75 -1
- package/src/components/atoms/DXNav/DXNav.stories.js +236 -0
- package/src/components/atoms/DXNav/DXNav.vue +114 -0
- package/src/components/atoms/DXNav/index.js +2 -0
- package/src/components/atoms/DXProgress/DXProgress.stories.js +76 -1
- package/src/components/atoms/DXRadio/DXRadio.stories.js +85 -1
- package/src/components/atoms/DXSkeleton/DXSkeleton.stories.js +59 -1
- package/src/components/atoms/DXSlider/DXSlider.stories.js +89 -0
- package/src/components/atoms/DXSpacer/DXSpacer.stories.js +1 -1
- package/src/components/atoms/DXStack/DXStack.stories.js +1 -1
- package/src/components/atoms/DXStack/DXStack.vue +5 -2
- package/src/components/atoms/DXTags/DXTags.stories.js +77 -0
- package/src/components/atoms/DXText/DXText.stories.js +83 -1
- package/src/components/atoms/DXToast/DXToast.stories.js +64 -1
- package/src/components/atoms/DXToggle/DXToggle.stories.js +84 -1
- package/src/components/atoms/DXToggleButton/DXToggleButton.stories.js +78 -1
- package/src/components/atoms/DXTooltip/DXTooltip.stories.js +98 -1
- package/src/components/atoms/index.js +3 -0
- package/src/components/molecules/DXActionButtons/DXActionButtons.stories.js +280 -77
- package/src/components/molecules/DXActionButtons/DXActionButtons.vue +31 -31
- package/src/components/molecules/DXAlert/DXAlert.stories.js +199 -1
- package/src/components/molecules/DXAlert/DXAlert.vue +35 -13
- package/src/components/molecules/DXBreadcrumb/DXBreadcrumb.stories.js +125 -1
- package/src/components/molecules/DXBreadcrumb/DXBreadcrumb.vue +22 -18
- package/src/components/molecules/DXButtonGroup/DXButtonGroup.stories.js +193 -6
- package/src/components/molecules/DXButtonGroup/DXButtonGroup.vue +39 -3
- package/src/components/molecules/DXCloseButton/DXCloseButton.stories.js +64 -1
- package/src/components/molecules/DXComboBox/DXComboBox.stories.js +66 -0
- package/src/components/molecules/DXCopyField/DXCopyField.stories.js +128 -1
- package/src/components/molecules/DXCopyField/DXCopyField.vue +60 -7
- package/src/components/molecules/DXDataFilter/DXDataFilter.vue +8 -6
- package/src/components/molecules/DXDatePicker/DXDatePicker.stories.js +58 -0
- package/src/components/molecules/DXFileUpload/DXFileUpload.stories.js +66 -0
- package/src/components/molecules/DXFilterGroup/DXFilterGroup.stories.js +61 -0
- package/src/components/molecules/DXFormControl/DXFormControl.stories.js +76 -0
- package/src/components/molecules/DXFormControl/DXFormControl.vue +9 -8
- package/src/components/molecules/DXInput/DXInput.stories.js +100 -1
- package/src/components/molecules/DXInputGroup/DXInputGroup.stories.js +89 -1
- package/src/components/molecules/DXInputMask/DXInputMask.stories.js +67 -0
- package/src/components/molecules/DXMenu/DXMenu.stories.js +111 -4
- package/src/components/molecules/DXMenu/DXMenu.vue +18 -5
- package/src/components/molecules/DXMenu/README.md +1 -1
- package/src/components/molecules/DXPagination/DXPagination.stories.js +105 -2
- package/src/components/molecules/DXPagination/DXPagination.vue +18 -33
- package/src/components/molecules/DXPasswordInput/DXPasswordInput.stories.js +67 -1
- package/src/components/molecules/DXRadioCard/DXRadioCard.stories.js +64 -0
- package/src/components/molecules/DXRadioGroup/DXRadioGroup.stories.js +84 -0
- package/src/components/molecules/DXRating/DXRating.stories.js +3 -2
- package/src/components/molecules/DXSearchBar/DXSearchBar.stories.js +1 -1
- package/src/components/molecules/DXSearchBar/DXSearchBar.vue +16 -12
- package/src/components/molecules/DXSearchSelect/DXSearchSelect.stories.js +71 -0
- package/src/components/molecules/DXSegmentedControl/DXSegmentedControl.stories.js +74 -0
- package/src/components/molecules/DXSelect/DXSelect.stories.js +92 -1
- package/src/components/molecules/DXStatCard/DXStatCard.stories.js +1 -1
- package/src/components/molecules/DXStatCard/DXStatCard.vue +30 -26
- package/src/components/molecules/DXTableFiltersPanel/index.js +3 -0
- package/src/components/molecules/DXTablePagination/DXTablePagination.stories.js +67 -0
- package/src/components/molecules/DXTableToolbar/DXTableToolbar.stories.js +71 -0
- package/src/components/molecules/DXTextarea/DXTextarea.stories.js +87 -1
- package/src/components/molecules/DXTimePicker/DXTimePicker.stories.js +1 -1
- package/src/components/molecules/DXValidationIcon/DXValidationIcon.stories.js +59 -1
- package/src/components/molecules/index.js +0 -1
- package/src/components/organisms/DXAccordion/DXAccordion.stories.js +75 -0
- package/src/components/organisms/DXAppLayout/DXAppLayout.stories.js +27 -25
- package/src/components/organisms/DXAuthenticationForm/DXAuthenticationForm.stories.js +0 -2
- package/src/components/organisms/DXAuthenticationForm/DXAuthenticationForm.vue +5 -8
- package/src/components/{molecules → organisms}/DXBaseTable/DXBaseTable.stories.js +78 -1
- package/src/components/{molecules → organisms}/DXBaseTable/DXBaseTable.vue +2 -2
- package/src/components/organisms/DXChartContainer/DXChartContainer.stories.js +1 -1
- package/src/components/organisms/DXChartContainer/DXChartContainer.vue +10 -6
- package/src/components/organisms/DXChatInterface/DXChatInterface.stories.js +1 -1
- package/src/components/organisms/DXChatInterface/DXChatInterface.vue +6 -4
- package/src/components/organisms/DXCommentSection/DXCommentSection.stories.js +1 -1
- package/src/components/organisms/DXCommentSection/DXCommentSection.vue +7 -6
- package/src/components/organisms/DXDashboardGrid/DXDashboardGrid.stories.js +1 -1
- package/src/components/organisms/DXDashboardGrid/DXDashboardGrid.vue +4 -2
- package/src/components/organisms/DXDashboardWidget/DXDashboardWidget.stories.js +1 -1
- package/src/components/organisms/DXDashboardWidget/DXDashboardWidget.vue +3 -2
- package/src/components/organisms/DXDataTable/DXDataTable.stories.js +1 -1
- package/src/components/organisms/DXDropdown/DXDropdown.stories.js +84 -1
- package/src/components/organisms/DXEmptyState/DXEmptyState.stories.js +64 -0
- package/src/components/organisms/DXEmptyState/DXEmptyState.vue +4 -2
- package/src/components/organisms/DXHeaderBar/DXHeaderBar.stories.js +409 -3
- package/src/components/organisms/DXHeaderBar/DXHeaderBar.vue +261 -52
- package/src/components/organisms/DXMediaGallery/DXMediaGallery.stories.js +1 -1
- package/src/components/organisms/DXMediaGallery/DXMediaGallery.vue +6 -4
- package/src/components/organisms/DXModal/DXModal.stories.js +93 -1
- package/src/components/organisms/DXModal/DXModal.vue +3 -2
- package/src/components/organisms/DXNotificationCenter/DXNotificationCenter.stories.js +1 -1
- package/src/components/organisms/DXNotificationCenter/DXNotificationCenter.vue +2 -1
- package/src/components/organisms/DXReportGenerator/DXReportGenerator.vue +4 -3
- package/src/components/organisms/DXSettingsPanel/DXSettingsPanel.vue +11 -8
- package/src/components/organisms/DXSidebar/DXSidebar.stories.js +1 -1
- package/src/components/organisms/DXSidebarMenu/DXSidebarMenu.stories.js +104 -1
- package/src/components/organisms/DXSidebarMenu/DXSidebarMenu.vue +14 -4
- package/src/components/organisms/DXSidebarMenu/README.md +3 -3
- package/src/components/organisms/DXTable/DXTable.stories.js +138 -11
- package/src/components/organisms/DXTable/DXTable.vue +1 -1
- package/src/components/organisms/DXTabs/DXTabs.stories.js +91 -1
- package/src/components/organisms/DXUserProfileCard/DXUserProfileCard.stories.js +1 -1
- package/src/components/organisms/DXUserProfileCard/DXUserProfileCard.vue +20 -18
- package/src/components/organisms/index.js +1 -0
- package/src/components/utilities/DXAnimatePresence/DXAnimatePresence.stories.js +1 -1
- package/src/components/utilities/DXBreakpointProvider/DXBreakpointProvider.stories.js +1 -1
- package/src/components/utilities/DXObserver/DXObserver.stories.js +1 -1
- package/src/components/utilities/DXPortal/DXPortal.stories.js +1 -1
- package/src/components/utilities/DXStaggeredAnimation/DXStaggeredAnimation.stories.js +2 -2
- package/src/components/utilities/DXThemeProvider/DXThemeProvider.stories.js +1 -1
- package/src/components/utilities/DXTransitionGroup/DXTransitionGroup.stories.js +1 -1
- package/src/composables/useSize.js +8 -1
- /package/src/components/{molecules → organisms}/DXBaseTable/index.js +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ref } from 'vue';
|
|
1
|
+
import { ref, onMounted, watch } from 'vue';
|
|
2
2
|
import DXHeaderBar from './DXHeaderBar.vue';
|
|
3
3
|
import DXLink from '../../atoms/DXLink/DXLink.vue';
|
|
4
4
|
import DXButton from '../../atoms/DXButton/DXButton.vue';
|
|
@@ -13,16 +13,21 @@ import {
|
|
|
13
13
|
Bars3Icon,
|
|
14
14
|
UserIcon,
|
|
15
15
|
} from '@heroicons/vue/24/outline';
|
|
16
|
+
import DXSegmentedControl from '../../molecules/DXSegmentedControl/DXSegmentedControl.vue';
|
|
17
|
+
import DXHeading from '../../atoms/DXHeading/DXHeading.vue';
|
|
18
|
+
import DXText from '../../atoms/DXText/DXText.vue';
|
|
19
|
+
import DXCard from '../../atoms/DXCard/DXCard.vue';
|
|
20
|
+
import DXBreakpointProvider from '../../utilities/DXBreakpointProvider/DXBreakpointProvider.vue';
|
|
16
21
|
|
|
17
22
|
export default {
|
|
18
23
|
title: 'Organisms/DXHeaderBar',
|
|
19
24
|
component: DXHeaderBar,
|
|
20
|
-
tags: ['autodocs'],
|
|
25
|
+
tags: ['autodocs', 'category:navigation'],
|
|
21
26
|
parameters: {
|
|
22
27
|
docs: {
|
|
23
28
|
description: {
|
|
24
29
|
component: `
|
|
25
|
-
|
|
30
|
+
|
|
26
31
|
|
|
27
32
|
Верхняя панель приложения с навигацией, поиском и действиями.
|
|
28
33
|
|
|
@@ -44,6 +49,7 @@ DXHeaderBar предоставляет стандартизированную в
|
|
|
44
49
|
- \`DXAvatar\` - для профиля пользователя
|
|
45
50
|
- \`DXInput\` - для поиска (через slot)
|
|
46
51
|
- \`DXDropdown\` - для меню профиля
|
|
52
|
+
- \`DXBreakpointProvider\` (опционально) - для получения данных о breakpoint через \`inject\`
|
|
47
53
|
|
|
48
54
|
### Используется в
|
|
49
55
|
- \`DXAppLayout\` - как верхняя панель приложения
|
|
@@ -63,6 +69,47 @@ DXHeaderBar предоставляет стандартизированную в
|
|
|
63
69
|
- Drawer меню, открывается по клику на кнопку мобильного меню
|
|
64
70
|
- Закрывается по клику на кнопку закрытия или вне меню
|
|
65
71
|
|
|
72
|
+
### Breakpoint данные
|
|
73
|
+
Компонент автоматически получает данные о breakpoint через \`inject\`, если \`DXBreakpointProvider\` обернут вокруг приложения:
|
|
74
|
+
- \`currentBreakpoint\` - текущий breakpoint (xs, sm, md, lg, xl, 2xl)
|
|
75
|
+
- \`screenWidth\` - ширина экрана в пикселях
|
|
76
|
+
- \`screenHeight\` - высота экрана в пикселях
|
|
77
|
+
- \`breakpoints\` - объект с определением всех breakpoint
|
|
78
|
+
- \`isMobile\` - computed свойство, true если breakpoint < md (768px)
|
|
79
|
+
- \`isDesktop\` - computed свойство, true если breakpoint >= md (768px)
|
|
80
|
+
|
|
81
|
+
Эти данные доступны через \`defineExpose\` для использования в родительских компонентах.
|
|
82
|
+
|
|
83
|
+
### Стилизация
|
|
84
|
+
Компонент поддерживает гибкую стилизацию через пропсы, аналогично \`DXCard\` и \`DXBox\`:
|
|
85
|
+
|
|
86
|
+
- **\`variant\`**: Вариант стилизации (опционально)
|
|
87
|
+
- \`null\` - базовый стиль (по умолчанию, без дополнительных стилей)
|
|
88
|
+
- \`bordered\` - более выраженная рамка (\`border-slate-300\`)
|
|
89
|
+
- \`elevated\` - с тенью (автоматически применяется \`shadow-sm\`, если \`shadow\` не указан)
|
|
90
|
+
- \`flat\` - без рамки (\`border-0\`)
|
|
91
|
+
|
|
92
|
+
- **\`bg\`**: Фон header
|
|
93
|
+
- \`white\` - белый фон (по умолчанию)
|
|
94
|
+
- \`slate\` - светло-серый фон (\`bg-slate-50\`)
|
|
95
|
+
- \`transparent\` - прозрачный фон
|
|
96
|
+
|
|
97
|
+
- **\`shadow\`**: Тень header
|
|
98
|
+
- \`null\` - без тени (по умолчанию)
|
|
99
|
+
- \`none\` - явно без тени
|
|
100
|
+
- \`sm\`, \`md\`, \`lg\`, \`xl\` - различные уровни тени
|
|
101
|
+
|
|
102
|
+
- **\`border\`**: Рамка header
|
|
103
|
+
- \`bottom\` - только нижняя рамка (по умолчанию)
|
|
104
|
+
- \`none\` - без рамки
|
|
105
|
+
- \`full\` - рамка со всех сторон
|
|
106
|
+
|
|
107
|
+
- **\`height\`**: Высота header
|
|
108
|
+
- \`auto\` - автоматическая высота (по умолчанию)
|
|
109
|
+
- \`sm\` - 56px (\`h-14\`)
|
|
110
|
+
- \`md\` - 64px (\`h-16\`)
|
|
111
|
+
- \`lg\` - 80px (\`h-20\`)
|
|
112
|
+
|
|
66
113
|
## Особенности
|
|
67
114
|
|
|
68
115
|
### Slots
|
|
@@ -70,8 +117,39 @@ DXHeaderBar предоставляет стандартизированную в
|
|
|
70
117
|
- \`navigation\` - навигационные ссылки (desktop)
|
|
71
118
|
- \`search\` - поисковая строка (desktop)
|
|
72
119
|
- \`actions\` - действия (desktop)
|
|
120
|
+
- \`center\` - центральный контент с абсолютным позиционированием (desktop)
|
|
73
121
|
- \`mobile-menu\` - кнопка мобильного меню
|
|
74
122
|
- \`mobile-navigation\` - навигация для мобильного меню
|
|
123
|
+
|
|
124
|
+
### Примеры использования
|
|
125
|
+
|
|
126
|
+
\`\`\`vue
|
|
127
|
+
<!-- Стандартный header -->
|
|
128
|
+
<DXHeaderBar app-name="My App" />
|
|
129
|
+
|
|
130
|
+
<!-- С тенью и полной рамкой -->
|
|
131
|
+
<DXHeaderBar
|
|
132
|
+
app-name="My App"
|
|
133
|
+
variant="elevated"
|
|
134
|
+
shadow="lg"
|
|
135
|
+
border="full"
|
|
136
|
+
/>
|
|
137
|
+
|
|
138
|
+
<!-- Плоский прозрачный -->
|
|
139
|
+
<DXHeaderBar
|
|
140
|
+
app-name="My App"
|
|
141
|
+
variant="flat"
|
|
142
|
+
bg="transparent"
|
|
143
|
+
border="none"
|
|
144
|
+
/>
|
|
145
|
+
|
|
146
|
+
<!-- Светлый фон с тенью -->
|
|
147
|
+
<DXHeaderBar
|
|
148
|
+
app-name="My App"
|
|
149
|
+
bg="slate"
|
|
150
|
+
shadow="md"
|
|
151
|
+
/>
|
|
152
|
+
\`\`\`
|
|
75
153
|
`,
|
|
76
154
|
},
|
|
77
155
|
},
|
|
@@ -123,6 +201,46 @@ DXHeaderBar предоставляет стандартизированную в
|
|
|
123
201
|
category: 'Layout',
|
|
124
202
|
},
|
|
125
203
|
},
|
|
204
|
+
variant: {
|
|
205
|
+
control: 'select',
|
|
206
|
+
options: [null, 'bordered', 'elevated', 'flat'],
|
|
207
|
+
description: 'Вариант стилизации header. Если не указан, применяется базовый стиль.',
|
|
208
|
+
table: {
|
|
209
|
+
type: { summary: 'string | null' },
|
|
210
|
+
defaultValue: { summary: 'null' },
|
|
211
|
+
category: 'Styling',
|
|
212
|
+
},
|
|
213
|
+
},
|
|
214
|
+
bg: {
|
|
215
|
+
control: 'select',
|
|
216
|
+
options: ['white', 'slate', 'transparent'],
|
|
217
|
+
description: 'Фон header.',
|
|
218
|
+
table: {
|
|
219
|
+
type: { summary: 'string' },
|
|
220
|
+
defaultValue: { summary: 'white' },
|
|
221
|
+
category: 'Styling',
|
|
222
|
+
},
|
|
223
|
+
},
|
|
224
|
+
shadow: {
|
|
225
|
+
control: 'select',
|
|
226
|
+
options: [null, 'none', 'sm', 'md', 'lg', 'xl'],
|
|
227
|
+
description: 'Тень header.',
|
|
228
|
+
table: {
|
|
229
|
+
type: { summary: 'string | null' },
|
|
230
|
+
defaultValue: { summary: 'null' },
|
|
231
|
+
category: 'Styling',
|
|
232
|
+
},
|
|
233
|
+
},
|
|
234
|
+
border: {
|
|
235
|
+
control: 'select',
|
|
236
|
+
options: ['none', 'bottom', 'full'],
|
|
237
|
+
description: 'Рамка header.',
|
|
238
|
+
table: {
|
|
239
|
+
type: { summary: 'string' },
|
|
240
|
+
defaultValue: { summary: 'bottom' },
|
|
241
|
+
category: 'Styling',
|
|
242
|
+
},
|
|
243
|
+
},
|
|
126
244
|
},
|
|
127
245
|
};
|
|
128
246
|
|
|
@@ -446,3 +564,291 @@ export const Sizes = {
|
|
|
446
564
|
}),
|
|
447
565
|
};
|
|
448
566
|
|
|
567
|
+
export const WithCenterContent = {
|
|
568
|
+
args: {
|
|
569
|
+
appName: 'My Application',
|
|
570
|
+
logo: 'https://via.placeholder.com/32x32',
|
|
571
|
+
sticky: true,
|
|
572
|
+
},
|
|
573
|
+
parameters: {
|
|
574
|
+
docs: {
|
|
575
|
+
description: {
|
|
576
|
+
story: 'Header с центральным контентом (DXSegmentedControl) с абсолютным позиционированием. Центральный контент позиционируется абсолютно по центру header и не влияет на layout остальных элементов.',
|
|
577
|
+
},
|
|
578
|
+
},
|
|
579
|
+
},
|
|
580
|
+
render: (args) => ({
|
|
581
|
+
components: { DXHeaderBar, DXSegmentedControl, DXButton, DXAvatar, DXDropdown, DXIcon },
|
|
582
|
+
setup() {
|
|
583
|
+
const currentMode = ref('list');
|
|
584
|
+
const isAuthenticated = ref(true);
|
|
585
|
+
const modeOptions = [
|
|
586
|
+
{ value: 'list', label: 'Список' },
|
|
587
|
+
{ value: 'grid', label: 'Сетка' },
|
|
588
|
+
{ value: 'card', label: 'Карточки' },
|
|
589
|
+
];
|
|
590
|
+
|
|
591
|
+
const handleModeChange = (value) => {
|
|
592
|
+
currentMode.value = value;
|
|
593
|
+
console.log('Mode changed to:', value);
|
|
594
|
+
};
|
|
595
|
+
|
|
596
|
+
return {
|
|
597
|
+
args,
|
|
598
|
+
currentMode,
|
|
599
|
+
isAuthenticated,
|
|
600
|
+
modeOptions,
|
|
601
|
+
handleModeChange,
|
|
602
|
+
UserIcon,
|
|
603
|
+
};
|
|
604
|
+
},
|
|
605
|
+
template: `
|
|
606
|
+
<DXHeaderBar v-bind="args">
|
|
607
|
+
<template #actions>
|
|
608
|
+
<DXButton variant="ghost" size="sm">
|
|
609
|
+
<template #icon>
|
|
610
|
+
<DXIcon :icon="BellIcon" size="md" />
|
|
611
|
+
</template>
|
|
612
|
+
</DXButton>
|
|
613
|
+
<DXDropdown>
|
|
614
|
+
<template #trigger>
|
|
615
|
+
<DXAvatar
|
|
616
|
+
src="https://via.placeholder.com/40x40"
|
|
617
|
+
size="sm"
|
|
618
|
+
/>
|
|
619
|
+
</template>
|
|
620
|
+
<div class="p-2">
|
|
621
|
+
<div class="px-3 py-2 text-sm text-slate-700">Профиль</div>
|
|
622
|
+
<div class="px-3 py-2 text-sm text-slate-700">Настройки</div>
|
|
623
|
+
<div class="px-3 py-2 text-sm text-slate-700">Выйти</div>
|
|
624
|
+
</div>
|
|
625
|
+
</DXDropdown>
|
|
626
|
+
</template>
|
|
627
|
+
<template #center>
|
|
628
|
+
<DXSegmentedControl
|
|
629
|
+
v-if="isAuthenticated"
|
|
630
|
+
v-model="currentMode"
|
|
631
|
+
:options="modeOptions"
|
|
632
|
+
size="sm"
|
|
633
|
+
@update:model-value="handleModeChange"
|
|
634
|
+
/>
|
|
635
|
+
</template>
|
|
636
|
+
</DXHeaderBar>
|
|
637
|
+
`,
|
|
638
|
+
}),
|
|
639
|
+
};
|
|
640
|
+
|
|
641
|
+
export const Variants = {
|
|
642
|
+
parameters: {
|
|
643
|
+
docs: {
|
|
644
|
+
description: {
|
|
645
|
+
story: 'Различные варианты стилизации header (variant).',
|
|
646
|
+
},
|
|
647
|
+
},
|
|
648
|
+
},
|
|
649
|
+
render: () => ({
|
|
650
|
+
components: { DXHeaderBar },
|
|
651
|
+
setup() {
|
|
652
|
+
return {};
|
|
653
|
+
},
|
|
654
|
+
template: `
|
|
655
|
+
<div class="space-y-4">
|
|
656
|
+
<DXHeaderBar app-name="Default (no variant)" />
|
|
657
|
+
<DXHeaderBar app-name="Bordered" variant="bordered" />
|
|
658
|
+
<DXHeaderBar app-name="Elevated" variant="elevated" />
|
|
659
|
+
<DXHeaderBar app-name="Flat" variant="flat" />
|
|
660
|
+
</div>
|
|
661
|
+
`,
|
|
662
|
+
}),
|
|
663
|
+
};
|
|
664
|
+
|
|
665
|
+
export const Backgrounds = {
|
|
666
|
+
parameters: {
|
|
667
|
+
docs: {
|
|
668
|
+
description: {
|
|
669
|
+
story: 'Различные варианты фона header (bg).',
|
|
670
|
+
},
|
|
671
|
+
},
|
|
672
|
+
},
|
|
673
|
+
render: () => ({
|
|
674
|
+
components: { DXHeaderBar },
|
|
675
|
+
setup() {
|
|
676
|
+
return {};
|
|
677
|
+
},
|
|
678
|
+
template: `
|
|
679
|
+
<div class="space-y-4">
|
|
680
|
+
<DXHeaderBar app-name="White Background" bg="white" />
|
|
681
|
+
<DXHeaderBar app-name="Slate Background" bg="slate" />
|
|
682
|
+
<DXHeaderBar app-name="Transparent Background" bg="transparent" />
|
|
683
|
+
</div>
|
|
684
|
+
`,
|
|
685
|
+
}),
|
|
686
|
+
};
|
|
687
|
+
|
|
688
|
+
export const Shadows = {
|
|
689
|
+
parameters: {
|
|
690
|
+
docs: {
|
|
691
|
+
description: {
|
|
692
|
+
story: 'Различные варианты тени header (shadow).',
|
|
693
|
+
},
|
|
694
|
+
},
|
|
695
|
+
},
|
|
696
|
+
render: () => ({
|
|
697
|
+
components: { DXHeaderBar },
|
|
698
|
+
setup() {
|
|
699
|
+
return {};
|
|
700
|
+
},
|
|
701
|
+
template: `
|
|
702
|
+
<div class="space-y-4 bg-slate-50 p-4">
|
|
703
|
+
<DXHeaderBar app-name="No Shadow" shadow="none" />
|
|
704
|
+
<DXHeaderBar app-name="Small Shadow" shadow="sm" />
|
|
705
|
+
<DXHeaderBar app-name="Medium Shadow" shadow="md" />
|
|
706
|
+
<DXHeaderBar app-name="Large Shadow" shadow="lg" />
|
|
707
|
+
<DXHeaderBar app-name="Extra Large Shadow" shadow="xl" />
|
|
708
|
+
</div>
|
|
709
|
+
`,
|
|
710
|
+
}),
|
|
711
|
+
};
|
|
712
|
+
|
|
713
|
+
export const Borders = {
|
|
714
|
+
parameters: {
|
|
715
|
+
docs: {
|
|
716
|
+
description: {
|
|
717
|
+
story: 'Различные варианты рамки header (border).',
|
|
718
|
+
},
|
|
719
|
+
},
|
|
720
|
+
},
|
|
721
|
+
render: () => ({
|
|
722
|
+
components: { DXHeaderBar },
|
|
723
|
+
setup() {
|
|
724
|
+
return {};
|
|
725
|
+
},
|
|
726
|
+
template: `
|
|
727
|
+
<div class="space-y-4">
|
|
728
|
+
<DXHeaderBar app-name="No Border" border="none" />
|
|
729
|
+
<DXHeaderBar app-name="Bottom Border" border="bottom" />
|
|
730
|
+
<DXHeaderBar app-name="Full Border" border="full" />
|
|
731
|
+
</div>
|
|
732
|
+
`,
|
|
733
|
+
}),
|
|
734
|
+
};
|
|
735
|
+
|
|
736
|
+
export const StylingCombinations = {
|
|
737
|
+
parameters: {
|
|
738
|
+
docs: {
|
|
739
|
+
description: {
|
|
740
|
+
story: 'Комбинации различных вариантов стилизации.',
|
|
741
|
+
},
|
|
742
|
+
},
|
|
743
|
+
},
|
|
744
|
+
render: () => ({
|
|
745
|
+
components: { DXHeaderBar },
|
|
746
|
+
setup() {
|
|
747
|
+
return {};
|
|
748
|
+
},
|
|
749
|
+
template: `
|
|
750
|
+
<div class="space-y-4 bg-slate-50 p-4">
|
|
751
|
+
<DXHeaderBar
|
|
752
|
+
app-name="Elevated with Shadow"
|
|
753
|
+
variant="elevated"
|
|
754
|
+
shadow="lg"
|
|
755
|
+
/>
|
|
756
|
+
<DXHeaderBar
|
|
757
|
+
app-name="Flat Transparent"
|
|
758
|
+
variant="flat"
|
|
759
|
+
bg="transparent"
|
|
760
|
+
border="none"
|
|
761
|
+
/>
|
|
762
|
+
<DXHeaderBar
|
|
763
|
+
app-name="Bordered Slate"
|
|
764
|
+
variant="bordered"
|
|
765
|
+
bg="slate"
|
|
766
|
+
border="full"
|
|
767
|
+
/>
|
|
768
|
+
</div>
|
|
769
|
+
`,
|
|
770
|
+
}),
|
|
771
|
+
};
|
|
772
|
+
|
|
773
|
+
export const WithBreakpointProvider = {
|
|
774
|
+
parameters: {
|
|
775
|
+
docs: {
|
|
776
|
+
description: {
|
|
777
|
+
story: 'DXHeaderBar автоматически получает данные о breakpoint через inject, если DXBreakpointProvider обернут вокруг приложения. Эти данные доступны через defineExpose.',
|
|
778
|
+
},
|
|
779
|
+
},
|
|
780
|
+
},
|
|
781
|
+
render: () => ({
|
|
782
|
+
components: { DXHeaderBar, DXBreakpointProvider, DXCard },
|
|
783
|
+
setup() {
|
|
784
|
+
const headerRef = ref(null);
|
|
785
|
+
const breakpointInfo = ref({
|
|
786
|
+
currentBreakpoint: null,
|
|
787
|
+
screenWidth: null,
|
|
788
|
+
isMobile: false,
|
|
789
|
+
isDesktop: false,
|
|
790
|
+
});
|
|
791
|
+
|
|
792
|
+
const updateInfo = () => {
|
|
793
|
+
if (headerRef.value) {
|
|
794
|
+
breakpointInfo.value = {
|
|
795
|
+
currentBreakpoint: headerRef.value.currentBreakpoint?.value || 'unknown',
|
|
796
|
+
screenWidth: headerRef.value.screenWidth?.value || null,
|
|
797
|
+
isMobile: headerRef.value.isMobile?.value || false,
|
|
798
|
+
isDesktop: headerRef.value.isDesktop?.value || false,
|
|
799
|
+
};
|
|
800
|
+
}
|
|
801
|
+
};
|
|
802
|
+
|
|
803
|
+
onMounted(() => {
|
|
804
|
+
updateInfo();
|
|
805
|
+
});
|
|
806
|
+
|
|
807
|
+
// Отслеживаем изменения breakpoint данных
|
|
808
|
+
watch(() => headerRef.value?.currentBreakpoint?.value, () => {
|
|
809
|
+
updateInfo();
|
|
810
|
+
}, { immediate: true });
|
|
811
|
+
|
|
812
|
+
watch(() => headerRef.value?.screenWidth?.value, () => {
|
|
813
|
+
updateInfo();
|
|
814
|
+
}, { immediate: true });
|
|
815
|
+
|
|
816
|
+
return { headerRef, breakpointInfo };
|
|
817
|
+
},
|
|
818
|
+
template: `
|
|
819
|
+
<DXBreakpointProvider>
|
|
820
|
+
<div class="space-y-4">
|
|
821
|
+
<DXHeaderBar
|
|
822
|
+
ref="headerRef"
|
|
823
|
+
app-name="Breakpoint Demo"
|
|
824
|
+
sticky
|
|
825
|
+
>
|
|
826
|
+
<template #actions>
|
|
827
|
+
<DXButton variant="ghost" size="sm">
|
|
828
|
+
<template #icon>
|
|
829
|
+
<DXIcon :icon="BellIcon" size="md" />
|
|
830
|
+
</template>
|
|
831
|
+
</DXButton>
|
|
832
|
+
</template>
|
|
833
|
+
</DXHeaderBar>
|
|
834
|
+
|
|
835
|
+
<div class="p-4">
|
|
836
|
+
<DXCard padding="md">
|
|
837
|
+
<DXHeading level="3" weight="semibold" class="mb-4">Breakpoint данные из DXHeaderBar:</DXHeading>
|
|
838
|
+
<div class="space-y-2">
|
|
839
|
+
<DXText tag="p" size="sm"><strong>Текущий breakpoint:</strong> {{ breakpointInfo.currentBreakpoint }}</DXText>
|
|
840
|
+
<DXText tag="p" size="sm"><strong>Ширина экрана:</strong> {{ breakpointInfo.screenWidth }}px</DXText>
|
|
841
|
+
<DXText tag="p" size="sm"><strong>Мобильный режим:</strong> {{ breakpointInfo.isMobile ? 'Да' : 'Нет' }}</DXText>
|
|
842
|
+
<DXText tag="p" size="sm"><strong>Десктопный режим:</strong> {{ breakpointInfo.isDesktop ? 'Да' : 'Нет' }}</DXText>
|
|
843
|
+
</div>
|
|
844
|
+
<DXText tag="p" size="xs" color="muted" class="mt-4">
|
|
845
|
+
Измените размер окна, чтобы увидеть обновление breakpoint данных.
|
|
846
|
+
</DXText>
|
|
847
|
+
</DXCard>
|
|
848
|
+
</div>
|
|
849
|
+
</div>
|
|
850
|
+
</DXBreakpointProvider>
|
|
851
|
+
`,
|
|
852
|
+
}),
|
|
853
|
+
};
|
|
854
|
+
|