shared-ritm 1.3.78 → 1.3.79
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/index.css +1 -1
- package/dist/shared-ritm.es.js +15 -14
- package/dist/shared-ritm.umd.js +2 -2
- package/package.json +70 -70
- package/src/App.vue +2461 -2461
- package/src/api/services/AuthService.ts +67 -67
- package/src/api/services/ControlsService.ts +96 -96
- package/src/api/services/EquipmentService.ts +29 -29
- package/src/api/services/MetricsService.ts +143 -143
- package/src/api/services/RepairsService.ts +111 -111
- package/src/api/services/UserIssueService.ts +32 -32
- package/src/api/services/UserService.ts +129 -129
- package/src/api/services/VideoService.ts +118 -118
- package/src/api/settings/ApiService.ts +184 -184
- package/src/api/types/Api_Auth.ts +121 -121
- package/src/api/types/Api_Metrics.ts +51 -51
- package/src/api/types/Api_Repairs.ts +187 -187
- package/src/api/types/Api_Tasks.ts +376 -376
- package/src/api/types/Api_User.ts +156 -156
- package/src/api/types/Api_User_Issue.ts +36 -36
- package/src/api/types/Api_Video.ts +244 -244
- package/src/common/app-button/Button.stories.ts +369 -369
- package/src/common/app-checkbox/AppCheckbox.vue +31 -31
- package/src/common/app-checkbox/Checkbox.stories.ts +252 -252
- package/src/common/app-date-picker/DatePicker.stories.ts +66 -66
- package/src/common/app-datepicker/Datepicker.stories.ts +145 -145
- package/src/common/app-dialogs/AppConfirmDialog.vue +109 -109
- package/src/common/app-dialogs/Confirm.stories.ts +93 -93
- package/src/common/app-dropdown/Dropdown.stories.ts +94 -94
- package/src/common/app-file/File.stories.ts +104 -104
- package/src/common/app-icon/AppIcon.vue +110 -110
- package/src/common/app-icon/Icon.stories.ts +91 -91
- package/src/common/app-input/AppInput.vue +2 -0
- package/src/common/app-input/Input.stories.ts +160 -160
- package/src/common/app-input-new/AppInputNew.vue +181 -181
- package/src/common/app-input-new/InputNew.stories.ts +240 -240
- package/src/common/app-input-search/InputSearch.stories.ts +149 -149
- package/src/common/app-layout/components/AppLayoutHeader.vue +289 -289
- package/src/common/app-loader/Loader.stories.ts +114 -114
- package/src/common/app-select/AppSelect.vue +159 -159
- package/src/common/app-select/Select.stories.ts +155 -155
- package/src/common/app-sidebar/AppSidebar.vue +174 -174
- package/src/common/app-table/AppTable.vue +313 -313
- package/src/common/app-table/components/ModalSelect.stories.ts +323 -323
- package/src/common/app-table/components/ModalSelect.vue +302 -302
- package/src/common/app-table/components/TableModal.vue +367 -367
- package/src/common/app-table/controllers/useColumnSelector.ts +45 -45
- package/src/common/app-table/controllers/useTableModel.ts +97 -97
- package/src/common/app-toggle/AppToggle.vue +12 -12
- package/src/common/app-toggle/Toggle.stories.ts +245 -245
- package/src/common/app-wrapper/AppWrapper.vue +31 -31
- package/src/configs/storybook.ts +14 -14
- package/src/icons/sidebar/user-requests-icon.vue +23 -23
- package/src/index.ts +134 -134
- package/src/shared/styles/general.css +140 -140
- package/src/styles/variables.sass +12 -12
- package/src/utils/files.ts +38 -38
- package/src/utils/helpers.ts +59 -59
- package/dist/types/api/services/PhotoService.d.ts +0 -40
- package/dist/types/stories/Button.stories.d.ts +0 -13
- package/dist/types/stories/Checkbox.stories.d.ts +0 -7
- package/dist/types/stories/Confirm.stories.d.ts +0 -8
- package/dist/types/stories/DatePicker.stories.d.ts +0 -8
- package/dist/types/stories/Dropdown.stories.d.ts +0 -8
- package/dist/types/stories/File.stories.d.ts +0 -8
- package/dist/types/stories/Icon.stories.d.ts +0 -7
- package/dist/types/stories/Input.stories.d.ts +0 -11
- package/dist/types/stories/InputNew.stories.d.ts +0 -12
- package/dist/types/stories/InputSearch.stories.d.ts +0 -10
- package/dist/types/stories/Loader.stories.d.ts +0 -8
- package/dist/types/stories/Select.stories.d.ts +0 -7
- package/dist/types/stories/Toggle.stories.d.ts +0 -8
|
@@ -1,369 +1,369 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/vue3'
|
|
2
|
-
import AppButton from '@/common/app-button/AppButton.vue'
|
|
3
|
-
import { quasarColorOpts } from '@/configs/storybook'
|
|
4
|
-
|
|
5
|
-
const meta: Meta<typeof AppButton> = {
|
|
6
|
-
title: 'Components/AppButton',
|
|
7
|
-
component: AppButton,
|
|
8
|
-
tags: ['autodocs'],
|
|
9
|
-
argTypes: {
|
|
10
|
-
color: {
|
|
11
|
-
control: 'select',
|
|
12
|
-
options: quasarColorOpts,
|
|
13
|
-
description: 'Фоновый цвет кнопки. Используйте имена из палитры Quasar.',
|
|
14
|
-
table: { category: '🎨 Цвета' },
|
|
15
|
-
},
|
|
16
|
-
textColor: {
|
|
17
|
-
control: 'select',
|
|
18
|
-
options: quasarColorOpts,
|
|
19
|
-
description: 'Цвет текста, обводки и иконок внутри кнопки.',
|
|
20
|
-
table: { category: '🎨 Цвета' },
|
|
21
|
-
},
|
|
22
|
-
badgeColor: {
|
|
23
|
-
control: 'select',
|
|
24
|
-
options: quasarColorOpts,
|
|
25
|
-
description: 'Цвет бейджа (метки) поверх кнопки.',
|
|
26
|
-
table: { category: '🎨 Цвета' },
|
|
27
|
-
},
|
|
28
|
-
|
|
29
|
-
size: {
|
|
30
|
-
control: 'select',
|
|
31
|
-
options: ['xs', 'sm', 'md', 'lg', 'xl'],
|
|
32
|
-
description: 'Стандартный размер кнопки от Quasar.',
|
|
33
|
-
table: { category: '📏 Размеры' },
|
|
34
|
-
},
|
|
35
|
-
width: {
|
|
36
|
-
control: 'text',
|
|
37
|
-
description: 'Ширина кнопки (CSS-значение: например, "200px", "100%", "auto").',
|
|
38
|
-
table: { category: '📏 Размеры' },
|
|
39
|
-
},
|
|
40
|
-
height: {
|
|
41
|
-
control: 'text',
|
|
42
|
-
description: 'Высота кнопки (CSS-значение: например, "40px", "auto").',
|
|
43
|
-
table: { category: '📏 Размеры' },
|
|
44
|
-
},
|
|
45
|
-
padding: {
|
|
46
|
-
control: 'text',
|
|
47
|
-
description: 'Внутренние отступы кнопки (например, "8px 16px").',
|
|
48
|
-
table: { category: '📏 Размеры' },
|
|
49
|
-
},
|
|
50
|
-
dense: {
|
|
51
|
-
control: 'boolean',
|
|
52
|
-
description: 'Уменьшает внутренние отступы (стандартный проп Quasar).',
|
|
53
|
-
table: { category: '📏 Размеры' },
|
|
54
|
-
},
|
|
55
|
-
stretch: {
|
|
56
|
-
control: 'boolean',
|
|
57
|
-
description: 'Растягивает содержимое по высоте кнопки.',
|
|
58
|
-
table: { category: '📏 Размеры' },
|
|
59
|
-
},
|
|
60
|
-
|
|
61
|
-
disable: {
|
|
62
|
-
control: 'boolean',
|
|
63
|
-
description: 'Отключает кнопку. Может быть функцией, возвращающей boolean.',
|
|
64
|
-
table: { category: '⚡ Состояния' },
|
|
65
|
-
},
|
|
66
|
-
loading: {
|
|
67
|
-
control: 'boolean',
|
|
68
|
-
description: 'Показывает индикатор загрузки и блокирует взаимодействие.',
|
|
69
|
-
table: { category: '⚡ Состояния' },
|
|
70
|
-
},
|
|
71
|
-
percentage: {
|
|
72
|
-
control: 'number',
|
|
73
|
-
description: 'Значение прогресса (для кнопок с индикатором загрузки).',
|
|
74
|
-
table: { category: '⚡ Состояния' },
|
|
75
|
-
},
|
|
76
|
-
darkPercentage: {
|
|
77
|
-
control: 'boolean',
|
|
78
|
-
description: 'Использует тёмный цвет для индикатора прогресса.',
|
|
79
|
-
table: { category: '⚡ Состояния' },
|
|
80
|
-
},
|
|
81
|
-
|
|
82
|
-
label: {
|
|
83
|
-
control: 'text',
|
|
84
|
-
description: 'Текст кнопки.',
|
|
85
|
-
table: { category: '🔤 Текст' },
|
|
86
|
-
},
|
|
87
|
-
uppercase: {
|
|
88
|
-
control: 'boolean',
|
|
89
|
-
description: 'Преобразует текст в верхний регистр.',
|
|
90
|
-
table: { category: '🔤 Текст' },
|
|
91
|
-
},
|
|
92
|
-
wrap: {
|
|
93
|
-
control: 'boolean',
|
|
94
|
-
description: 'Разрешает перенос текста на новую строку при нехватке места.',
|
|
95
|
-
table: { category: '🔤 Текст' },
|
|
96
|
-
},
|
|
97
|
-
tooltip: {
|
|
98
|
-
control: 'text',
|
|
99
|
-
description: 'Текст всплывающей подсказки при наведении.',
|
|
100
|
-
table: { category: '🔤 Текст' },
|
|
101
|
-
},
|
|
102
|
-
badge: {
|
|
103
|
-
control: 'text',
|
|
104
|
-
description: 'Текст или число в бейдже. Пустая строка или true — показывает бейдж без текста.',
|
|
105
|
-
table: { category: '🔤 Текст' },
|
|
106
|
-
},
|
|
107
|
-
badgeInline: {
|
|
108
|
-
control: 'boolean',
|
|
109
|
-
description: 'Если true — бейдж отображается внутри кнопки.',
|
|
110
|
-
table: { category: '🔤 Текст' },
|
|
111
|
-
},
|
|
112
|
-
|
|
113
|
-
icon: {
|
|
114
|
-
control: 'text',
|
|
115
|
-
description: 'Имя иконки слева от текста.',
|
|
116
|
-
table: { category: '🖼️ Иконки' },
|
|
117
|
-
},
|
|
118
|
-
iconRight: {
|
|
119
|
-
control: 'text',
|
|
120
|
-
description: 'Имя иконки справа от текста.',
|
|
121
|
-
table: { category: '🖼️ Иконки' },
|
|
122
|
-
},
|
|
123
|
-
|
|
124
|
-
to: {
|
|
125
|
-
control: 'text',
|
|
126
|
-
description: 'Путь для vue-router (делает кнопку ссылкой).',
|
|
127
|
-
table: { category: '🔗 Навигация' },
|
|
128
|
-
},
|
|
129
|
-
href: {
|
|
130
|
-
control: 'text',
|
|
131
|
-
description: 'URL для внешней ссылки (рендерит `<a>`).',
|
|
132
|
-
table: { category: '🔗 Навигация' },
|
|
133
|
-
},
|
|
134
|
-
target: {
|
|
135
|
-
control: 'text',
|
|
136
|
-
description: 'Атрибут target для ссылки.',
|
|
137
|
-
table: { category: '🔗 Навигация' },
|
|
138
|
-
},
|
|
139
|
-
replace: {
|
|
140
|
-
control: 'boolean',
|
|
141
|
-
description: 'Если true — заменяет текущую запись в истории роутера (при использовании `to`).',
|
|
142
|
-
table: { category: '🔗 Навигация' },
|
|
143
|
-
},
|
|
144
|
-
|
|
145
|
-
rounded: {
|
|
146
|
-
control: 'boolean',
|
|
147
|
-
description: 'Скруглённые углы.',
|
|
148
|
-
table: { category: '🔘 Скругления' },
|
|
149
|
-
},
|
|
150
|
-
borderRadius: {
|
|
151
|
-
control: 'text',
|
|
152
|
-
description: 'Скругление при включённом rounded.',
|
|
153
|
-
table: { category: '🔘 Скругления' },
|
|
154
|
-
},
|
|
155
|
-
round: {
|
|
156
|
-
control: 'boolean',
|
|
157
|
-
description: 'Делает кнопку полностью круглой.',
|
|
158
|
-
table: { category: '🔘 Скругления' },
|
|
159
|
-
},
|
|
160
|
-
square: {
|
|
161
|
-
control: 'boolean',
|
|
162
|
-
description: 'Прямые углы (без скругления).',
|
|
163
|
-
table: { category: '🔘 Скругления' },
|
|
164
|
-
},
|
|
165
|
-
|
|
166
|
-
outline: {
|
|
167
|
-
control: 'boolean',
|
|
168
|
-
description: 'Кнопка с рамкой и прозрачным фоном.',
|
|
169
|
-
},
|
|
170
|
-
flat: {
|
|
171
|
-
control: 'boolean',
|
|
172
|
-
description: 'Плоская кнопка без тени и фона.',
|
|
173
|
-
},
|
|
174
|
-
unelevated: {
|
|
175
|
-
control: 'boolean',
|
|
176
|
-
description: 'Кнопка без тени.',
|
|
177
|
-
},
|
|
178
|
-
push: {
|
|
179
|
-
control: 'boolean',
|
|
180
|
-
description: 'Эффект "нажатия" при клике (вдавленная тень).',
|
|
181
|
-
},
|
|
182
|
-
glossy: {
|
|
183
|
-
control: 'boolean',
|
|
184
|
-
description: 'Добавляет глянцевый эффект.',
|
|
185
|
-
},
|
|
186
|
-
fab: {
|
|
187
|
-
control: 'boolean',
|
|
188
|
-
description: 'Floating Action Button — круглая кнопка с иконкой.',
|
|
189
|
-
},
|
|
190
|
-
fabMini: {
|
|
191
|
-
control: 'boolean',
|
|
192
|
-
description: 'Мини-версия FAB.',
|
|
193
|
-
},
|
|
194
|
-
|
|
195
|
-
align: {
|
|
196
|
-
control: 'select',
|
|
197
|
-
options: ['left', 'right', 'center', 'around', 'between', 'evenly'],
|
|
198
|
-
description:
|
|
199
|
-
'Выравнивание содержимого (иконка + текст) внутри кнопки. Работает при фиксированной/растянутой ширине.',
|
|
200
|
-
},
|
|
201
|
-
ripple: {
|
|
202
|
-
control: 'boolean',
|
|
203
|
-
description: 'Эффект волны при клике.',
|
|
204
|
-
},
|
|
205
|
-
tabindex: {
|
|
206
|
-
control: 'number',
|
|
207
|
-
description: 'Порядок фокуса при навигации с клавиатуры.',
|
|
208
|
-
},
|
|
209
|
-
stack: {
|
|
210
|
-
control: 'boolean',
|
|
211
|
-
description: 'Располагает контент в несколько строк.',
|
|
212
|
-
},
|
|
213
|
-
borderWidth: {
|
|
214
|
-
control: 'text',
|
|
215
|
-
description: 'Толщина обводки (для outline).',
|
|
216
|
-
},
|
|
217
|
-
noCaps: {
|
|
218
|
-
table: { disable: true },
|
|
219
|
-
},
|
|
220
|
-
noWrap: {
|
|
221
|
-
table: { disable: true },
|
|
222
|
-
},
|
|
223
|
-
small: {
|
|
224
|
-
table: { disable: true },
|
|
225
|
-
},
|
|
226
|
-
xSmall: {
|
|
227
|
-
table: { disable: true },
|
|
228
|
-
},
|
|
229
|
-
large: {
|
|
230
|
-
table: { disable: true },
|
|
231
|
-
},
|
|
232
|
-
fullWidth: {
|
|
233
|
-
table: { disable: true },
|
|
234
|
-
},
|
|
235
|
-
borderColor: {
|
|
236
|
-
table: { disable: true },
|
|
237
|
-
},
|
|
238
|
-
largeIcon: {
|
|
239
|
-
table: { disable: true },
|
|
240
|
-
},
|
|
241
|
-
link: {
|
|
242
|
-
table: { disable: true },
|
|
243
|
-
},
|
|
244
|
-
},
|
|
245
|
-
args: {
|
|
246
|
-
label: 'Button',
|
|
247
|
-
color: 'primary',
|
|
248
|
-
textColor: 'white',
|
|
249
|
-
},
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
export default meta
|
|
253
|
-
|
|
254
|
-
type Story = StoryObj<typeof AppButton>
|
|
255
|
-
|
|
256
|
-
export const Primary: Story = { args: { label: 'Кнопка' } }
|
|
257
|
-
|
|
258
|
-
export const Size: Story = {
|
|
259
|
-
render: () => ({
|
|
260
|
-
components: { AppButton },
|
|
261
|
-
template: `
|
|
262
|
-
<div style="display: flex; gap: 12px; flex-wrap: wrap; align-items: center;">
|
|
263
|
-
<AppButton size="xs" label="XS" color="primary" text-color="white" />
|
|
264
|
-
<AppButton size="sm" label="SM" color="primary" text-color="white" />
|
|
265
|
-
<AppButton size="md" label="MD" color="primary" text-color="white" />
|
|
266
|
-
<AppButton size="lg" label="LG" color="primary" text-color="white" />
|
|
267
|
-
<AppButton size="xl" label="XL" color="primary" text-color="white" />
|
|
268
|
-
<AppButton width="200px" label="width 200px" color="primary" text-color="white" />
|
|
269
|
-
<AppButton height="100px" label="height 100px" color="primary" text-color="white" />
|
|
270
|
-
</div>
|
|
271
|
-
`,
|
|
272
|
-
}),
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
export const Icon: Story = {
|
|
276
|
-
render: () => ({
|
|
277
|
-
components: { AppButton },
|
|
278
|
-
template: `
|
|
279
|
-
<div style="display: flex; gap: 12px; flex-wrap: wrap; align-items: center;">
|
|
280
|
-
<AppButton icon="mail" label="mail" color="primary" text-color="white" />
|
|
281
|
-
<AppButton icon="arrow_back" label="icon + iconRight" icon-right="arrow_forward" color="primary" text-color="white" />
|
|
282
|
-
<AppButton icon-right="arrow_forward" label="iconRight" color="primary" text-color="white" />
|
|
283
|
-
<AppButton icon="settings" color="primary" text-color="white" />
|
|
284
|
-
</div>
|
|
285
|
-
`,
|
|
286
|
-
}),
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
export const Badge: Story = {
|
|
290
|
-
render: () => ({
|
|
291
|
-
components: { AppButton },
|
|
292
|
-
template: `
|
|
293
|
-
<div style="display: flex; gap: 12px; flex-wrap: wrap; align-items: center;">
|
|
294
|
-
<AppButton :badge="true" label="true" color="primary" text-color="white" />
|
|
295
|
-
<AppButton badge="badge" badge-color="red" label="badge" color="primary" text-color="white" />
|
|
296
|
-
<AppButton badge="3" badge-color="red" badge-inline label="inline" color="primary" text-color="white" />
|
|
297
|
-
</div>
|
|
298
|
-
`,
|
|
299
|
-
}),
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
export const Align: Story = {
|
|
303
|
-
render: () => ({
|
|
304
|
-
components: { AppButton },
|
|
305
|
-
template: `
|
|
306
|
-
<div style="display: flex; gap: 12px; flex-wrap: wrap; align-items: center;">
|
|
307
|
-
<AppButton icon="arrow_back" width="200px" align="center" label="center" color="primary" text-color="white" />
|
|
308
|
-
<AppButton width="200px" align="center" label="center" color="primary" text-color="white" />
|
|
309
|
-
<AppButton icon="arrow_back" width="200px" align="left" label="left" color="primary" text-color="white" />
|
|
310
|
-
<AppButton width="200px" align="left" label="left" color="primary" text-color="white" />
|
|
311
|
-
<AppButton icon="arrow_back" width="200px" align="right" label="right" color="primary" text-color="white" />
|
|
312
|
-
<AppButton width="200px" align="right" label="right" color="primary" text-color="white" />
|
|
313
|
-
<AppButton icon="arrow_back" width="200px" align="around" label="around" color="primary" text-color="white" />
|
|
314
|
-
<AppButton width="200px" align="around" label="around" color="primary" text-color="white" />
|
|
315
|
-
<AppButton icon="arrow_back" width="200px" align="evenly" label="evenly" color="primary" text-color="white" />
|
|
316
|
-
<AppButton width="200px" align="evenly" label="evenly" color="primary" text-color="white" />
|
|
317
|
-
</div>
|
|
318
|
-
`,
|
|
319
|
-
}),
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
export const Spacing: Story = {
|
|
323
|
-
render: () => ({
|
|
324
|
-
components: { AppButton },
|
|
325
|
-
template: `
|
|
326
|
-
<div style="display: flex; gap: 12px; flex-wrap: wrap; align-items: center;">
|
|
327
|
-
<AppButton icon="mail" fab label="fab" color="primary" text-color="white" />
|
|
328
|
-
<AppButton icon="mail" fab-mini label="fab-mini" color="primary" text-color="white" />
|
|
329
|
-
<AppButton dense label="dense" color="primary" text-color="white" />
|
|
330
|
-
<AppButton padding="20px" label="padding 20px" color="primary" text-color="white" />
|
|
331
|
-
</div>
|
|
332
|
-
`,
|
|
333
|
-
}),
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
export const Rounding: Story = {
|
|
337
|
-
render: () => ({
|
|
338
|
-
components: { AppButton },
|
|
339
|
-
template: `
|
|
340
|
-
<div style="display: flex; gap: 12px; flex-wrap: wrap; align-items: center;">
|
|
341
|
-
<AppButton square label="square" color="primary" text-color="white" />
|
|
342
|
-
<AppButton rounded label="rounded" color="primary" text-color="white" />
|
|
343
|
-
<AppButton rounded border-radius="20px" label="rounded 20px" color="primary" text-color="white" />
|
|
344
|
-
<AppButton round label="round" color="primary" text-color="white" />
|
|
345
|
-
</div>
|
|
346
|
-
`,
|
|
347
|
-
}),
|
|
348
|
-
}
|
|
349
|
-
|
|
350
|
-
export const Other: Story = {
|
|
351
|
-
render: () => ({
|
|
352
|
-
components: { AppButton },
|
|
353
|
-
template: `
|
|
354
|
-
<div style="display: flex; gap: 12px; flex-wrap: wrap; align-items: center;">
|
|
355
|
-
<AppButton outline label="outline" text-color="primary" />
|
|
356
|
-
<AppButton outline borderWidth="5px" label="borderWidth 5px" text-color="primary" />
|
|
357
|
-
<AppButton flat label="flat" text-color="primary" />
|
|
358
|
-
<AppButton unelevated label="unelevated" color="primary" text-color="white" />
|
|
359
|
-
<AppButton push label="push" color="primary" text-color="white" />
|
|
360
|
-
<AppButton glossy label="glossy" color="primary" text-color="white" />
|
|
361
|
-
<AppButton loading label="Загрузка..." color="primary" text-color="white" />
|
|
362
|
-
<AppButton tooltip="Подсказка" label="tooltip" color="primary" text-color="white" />
|
|
363
|
-
<AppButton disable label="disable" color="primary" text-color="white" />
|
|
364
|
-
<AppButton width="100px" wrap label="wrap + width 100px" color="primary" text-color="white" />
|
|
365
|
-
<AppButton stack icon="mail" icon-right="settings" badge="123" badge-color="red" badge-inline label="stack" color="primary" text-color="white" />
|
|
366
|
-
</div>
|
|
367
|
-
`,
|
|
368
|
-
}),
|
|
369
|
-
}
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/vue3'
|
|
2
|
+
import AppButton from '@/common/app-button/AppButton.vue'
|
|
3
|
+
import { quasarColorOpts } from '@/configs/storybook'
|
|
4
|
+
|
|
5
|
+
const meta: Meta<typeof AppButton> = {
|
|
6
|
+
title: 'Components/AppButton',
|
|
7
|
+
component: AppButton,
|
|
8
|
+
tags: ['autodocs'],
|
|
9
|
+
argTypes: {
|
|
10
|
+
color: {
|
|
11
|
+
control: 'select',
|
|
12
|
+
options: quasarColorOpts,
|
|
13
|
+
description: 'Фоновый цвет кнопки. Используйте имена из палитры Quasar.',
|
|
14
|
+
table: { category: '🎨 Цвета' },
|
|
15
|
+
},
|
|
16
|
+
textColor: {
|
|
17
|
+
control: 'select',
|
|
18
|
+
options: quasarColorOpts,
|
|
19
|
+
description: 'Цвет текста, обводки и иконок внутри кнопки.',
|
|
20
|
+
table: { category: '🎨 Цвета' },
|
|
21
|
+
},
|
|
22
|
+
badgeColor: {
|
|
23
|
+
control: 'select',
|
|
24
|
+
options: quasarColorOpts,
|
|
25
|
+
description: 'Цвет бейджа (метки) поверх кнопки.',
|
|
26
|
+
table: { category: '🎨 Цвета' },
|
|
27
|
+
},
|
|
28
|
+
|
|
29
|
+
size: {
|
|
30
|
+
control: 'select',
|
|
31
|
+
options: ['xs', 'sm', 'md', 'lg', 'xl'],
|
|
32
|
+
description: 'Стандартный размер кнопки от Quasar.',
|
|
33
|
+
table: { category: '📏 Размеры' },
|
|
34
|
+
},
|
|
35
|
+
width: {
|
|
36
|
+
control: 'text',
|
|
37
|
+
description: 'Ширина кнопки (CSS-значение: например, "200px", "100%", "auto").',
|
|
38
|
+
table: { category: '📏 Размеры' },
|
|
39
|
+
},
|
|
40
|
+
height: {
|
|
41
|
+
control: 'text',
|
|
42
|
+
description: 'Высота кнопки (CSS-значение: например, "40px", "auto").',
|
|
43
|
+
table: { category: '📏 Размеры' },
|
|
44
|
+
},
|
|
45
|
+
padding: {
|
|
46
|
+
control: 'text',
|
|
47
|
+
description: 'Внутренние отступы кнопки (например, "8px 16px").',
|
|
48
|
+
table: { category: '📏 Размеры' },
|
|
49
|
+
},
|
|
50
|
+
dense: {
|
|
51
|
+
control: 'boolean',
|
|
52
|
+
description: 'Уменьшает внутренние отступы (стандартный проп Quasar).',
|
|
53
|
+
table: { category: '📏 Размеры' },
|
|
54
|
+
},
|
|
55
|
+
stretch: {
|
|
56
|
+
control: 'boolean',
|
|
57
|
+
description: 'Растягивает содержимое по высоте кнопки.',
|
|
58
|
+
table: { category: '📏 Размеры' },
|
|
59
|
+
},
|
|
60
|
+
|
|
61
|
+
disable: {
|
|
62
|
+
control: 'boolean',
|
|
63
|
+
description: 'Отключает кнопку. Может быть функцией, возвращающей boolean.',
|
|
64
|
+
table: { category: '⚡ Состояния' },
|
|
65
|
+
},
|
|
66
|
+
loading: {
|
|
67
|
+
control: 'boolean',
|
|
68
|
+
description: 'Показывает индикатор загрузки и блокирует взаимодействие.',
|
|
69
|
+
table: { category: '⚡ Состояния' },
|
|
70
|
+
},
|
|
71
|
+
percentage: {
|
|
72
|
+
control: 'number',
|
|
73
|
+
description: 'Значение прогресса (для кнопок с индикатором загрузки).',
|
|
74
|
+
table: { category: '⚡ Состояния' },
|
|
75
|
+
},
|
|
76
|
+
darkPercentage: {
|
|
77
|
+
control: 'boolean',
|
|
78
|
+
description: 'Использует тёмный цвет для индикатора прогресса.',
|
|
79
|
+
table: { category: '⚡ Состояния' },
|
|
80
|
+
},
|
|
81
|
+
|
|
82
|
+
label: {
|
|
83
|
+
control: 'text',
|
|
84
|
+
description: 'Текст кнопки.',
|
|
85
|
+
table: { category: '🔤 Текст' },
|
|
86
|
+
},
|
|
87
|
+
uppercase: {
|
|
88
|
+
control: 'boolean',
|
|
89
|
+
description: 'Преобразует текст в верхний регистр.',
|
|
90
|
+
table: { category: '🔤 Текст' },
|
|
91
|
+
},
|
|
92
|
+
wrap: {
|
|
93
|
+
control: 'boolean',
|
|
94
|
+
description: 'Разрешает перенос текста на новую строку при нехватке места.',
|
|
95
|
+
table: { category: '🔤 Текст' },
|
|
96
|
+
},
|
|
97
|
+
tooltip: {
|
|
98
|
+
control: 'text',
|
|
99
|
+
description: 'Текст всплывающей подсказки при наведении.',
|
|
100
|
+
table: { category: '🔤 Текст' },
|
|
101
|
+
},
|
|
102
|
+
badge: {
|
|
103
|
+
control: 'text',
|
|
104
|
+
description: 'Текст или число в бейдже. Пустая строка или true — показывает бейдж без текста.',
|
|
105
|
+
table: { category: '🔤 Текст' },
|
|
106
|
+
},
|
|
107
|
+
badgeInline: {
|
|
108
|
+
control: 'boolean',
|
|
109
|
+
description: 'Если true — бейдж отображается внутри кнопки.',
|
|
110
|
+
table: { category: '🔤 Текст' },
|
|
111
|
+
},
|
|
112
|
+
|
|
113
|
+
icon: {
|
|
114
|
+
control: 'text',
|
|
115
|
+
description: 'Имя иконки слева от текста.',
|
|
116
|
+
table: { category: '🖼️ Иконки' },
|
|
117
|
+
},
|
|
118
|
+
iconRight: {
|
|
119
|
+
control: 'text',
|
|
120
|
+
description: 'Имя иконки справа от текста.',
|
|
121
|
+
table: { category: '🖼️ Иконки' },
|
|
122
|
+
},
|
|
123
|
+
|
|
124
|
+
to: {
|
|
125
|
+
control: 'text',
|
|
126
|
+
description: 'Путь для vue-router (делает кнопку ссылкой).',
|
|
127
|
+
table: { category: '🔗 Навигация' },
|
|
128
|
+
},
|
|
129
|
+
href: {
|
|
130
|
+
control: 'text',
|
|
131
|
+
description: 'URL для внешней ссылки (рендерит `<a>`).',
|
|
132
|
+
table: { category: '🔗 Навигация' },
|
|
133
|
+
},
|
|
134
|
+
target: {
|
|
135
|
+
control: 'text',
|
|
136
|
+
description: 'Атрибут target для ссылки.',
|
|
137
|
+
table: { category: '🔗 Навигация' },
|
|
138
|
+
},
|
|
139
|
+
replace: {
|
|
140
|
+
control: 'boolean',
|
|
141
|
+
description: 'Если true — заменяет текущую запись в истории роутера (при использовании `to`).',
|
|
142
|
+
table: { category: '🔗 Навигация' },
|
|
143
|
+
},
|
|
144
|
+
|
|
145
|
+
rounded: {
|
|
146
|
+
control: 'boolean',
|
|
147
|
+
description: 'Скруглённые углы.',
|
|
148
|
+
table: { category: '🔘 Скругления' },
|
|
149
|
+
},
|
|
150
|
+
borderRadius: {
|
|
151
|
+
control: 'text',
|
|
152
|
+
description: 'Скругление при включённом rounded.',
|
|
153
|
+
table: { category: '🔘 Скругления' },
|
|
154
|
+
},
|
|
155
|
+
round: {
|
|
156
|
+
control: 'boolean',
|
|
157
|
+
description: 'Делает кнопку полностью круглой.',
|
|
158
|
+
table: { category: '🔘 Скругления' },
|
|
159
|
+
},
|
|
160
|
+
square: {
|
|
161
|
+
control: 'boolean',
|
|
162
|
+
description: 'Прямые углы (без скругления).',
|
|
163
|
+
table: { category: '🔘 Скругления' },
|
|
164
|
+
},
|
|
165
|
+
|
|
166
|
+
outline: {
|
|
167
|
+
control: 'boolean',
|
|
168
|
+
description: 'Кнопка с рамкой и прозрачным фоном.',
|
|
169
|
+
},
|
|
170
|
+
flat: {
|
|
171
|
+
control: 'boolean',
|
|
172
|
+
description: 'Плоская кнопка без тени и фона.',
|
|
173
|
+
},
|
|
174
|
+
unelevated: {
|
|
175
|
+
control: 'boolean',
|
|
176
|
+
description: 'Кнопка без тени.',
|
|
177
|
+
},
|
|
178
|
+
push: {
|
|
179
|
+
control: 'boolean',
|
|
180
|
+
description: 'Эффект "нажатия" при клике (вдавленная тень).',
|
|
181
|
+
},
|
|
182
|
+
glossy: {
|
|
183
|
+
control: 'boolean',
|
|
184
|
+
description: 'Добавляет глянцевый эффект.',
|
|
185
|
+
},
|
|
186
|
+
fab: {
|
|
187
|
+
control: 'boolean',
|
|
188
|
+
description: 'Floating Action Button — круглая кнопка с иконкой.',
|
|
189
|
+
},
|
|
190
|
+
fabMini: {
|
|
191
|
+
control: 'boolean',
|
|
192
|
+
description: 'Мини-версия FAB.',
|
|
193
|
+
},
|
|
194
|
+
|
|
195
|
+
align: {
|
|
196
|
+
control: 'select',
|
|
197
|
+
options: ['left', 'right', 'center', 'around', 'between', 'evenly'],
|
|
198
|
+
description:
|
|
199
|
+
'Выравнивание содержимого (иконка + текст) внутри кнопки. Работает при фиксированной/растянутой ширине.',
|
|
200
|
+
},
|
|
201
|
+
ripple: {
|
|
202
|
+
control: 'boolean',
|
|
203
|
+
description: 'Эффект волны при клике.',
|
|
204
|
+
},
|
|
205
|
+
tabindex: {
|
|
206
|
+
control: 'number',
|
|
207
|
+
description: 'Порядок фокуса при навигации с клавиатуры.',
|
|
208
|
+
},
|
|
209
|
+
stack: {
|
|
210
|
+
control: 'boolean',
|
|
211
|
+
description: 'Располагает контент в несколько строк.',
|
|
212
|
+
},
|
|
213
|
+
borderWidth: {
|
|
214
|
+
control: 'text',
|
|
215
|
+
description: 'Толщина обводки (для outline).',
|
|
216
|
+
},
|
|
217
|
+
noCaps: {
|
|
218
|
+
table: { disable: true },
|
|
219
|
+
},
|
|
220
|
+
noWrap: {
|
|
221
|
+
table: { disable: true },
|
|
222
|
+
},
|
|
223
|
+
small: {
|
|
224
|
+
table: { disable: true },
|
|
225
|
+
},
|
|
226
|
+
xSmall: {
|
|
227
|
+
table: { disable: true },
|
|
228
|
+
},
|
|
229
|
+
large: {
|
|
230
|
+
table: { disable: true },
|
|
231
|
+
},
|
|
232
|
+
fullWidth: {
|
|
233
|
+
table: { disable: true },
|
|
234
|
+
},
|
|
235
|
+
borderColor: {
|
|
236
|
+
table: { disable: true },
|
|
237
|
+
},
|
|
238
|
+
largeIcon: {
|
|
239
|
+
table: { disable: true },
|
|
240
|
+
},
|
|
241
|
+
link: {
|
|
242
|
+
table: { disable: true },
|
|
243
|
+
},
|
|
244
|
+
},
|
|
245
|
+
args: {
|
|
246
|
+
label: 'Button',
|
|
247
|
+
color: 'primary',
|
|
248
|
+
textColor: 'white',
|
|
249
|
+
},
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
export default meta
|
|
253
|
+
|
|
254
|
+
type Story = StoryObj<typeof AppButton>
|
|
255
|
+
|
|
256
|
+
export const Primary: Story = { args: { label: 'Кнопка' } }
|
|
257
|
+
|
|
258
|
+
export const Size: Story = {
|
|
259
|
+
render: () => ({
|
|
260
|
+
components: { AppButton },
|
|
261
|
+
template: `
|
|
262
|
+
<div style="display: flex; gap: 12px; flex-wrap: wrap; align-items: center;">
|
|
263
|
+
<AppButton size="xs" label="XS" color="primary" text-color="white" />
|
|
264
|
+
<AppButton size="sm" label="SM" color="primary" text-color="white" />
|
|
265
|
+
<AppButton size="md" label="MD" color="primary" text-color="white" />
|
|
266
|
+
<AppButton size="lg" label="LG" color="primary" text-color="white" />
|
|
267
|
+
<AppButton size="xl" label="XL" color="primary" text-color="white" />
|
|
268
|
+
<AppButton width="200px" label="width 200px" color="primary" text-color="white" />
|
|
269
|
+
<AppButton height="100px" label="height 100px" color="primary" text-color="white" />
|
|
270
|
+
</div>
|
|
271
|
+
`,
|
|
272
|
+
}),
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
export const Icon: Story = {
|
|
276
|
+
render: () => ({
|
|
277
|
+
components: { AppButton },
|
|
278
|
+
template: `
|
|
279
|
+
<div style="display: flex; gap: 12px; flex-wrap: wrap; align-items: center;">
|
|
280
|
+
<AppButton icon="mail" label="mail" color="primary" text-color="white" />
|
|
281
|
+
<AppButton icon="arrow_back" label="icon + iconRight" icon-right="arrow_forward" color="primary" text-color="white" />
|
|
282
|
+
<AppButton icon-right="arrow_forward" label="iconRight" color="primary" text-color="white" />
|
|
283
|
+
<AppButton icon="settings" color="primary" text-color="white" />
|
|
284
|
+
</div>
|
|
285
|
+
`,
|
|
286
|
+
}),
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
export const Badge: Story = {
|
|
290
|
+
render: () => ({
|
|
291
|
+
components: { AppButton },
|
|
292
|
+
template: `
|
|
293
|
+
<div style="display: flex; gap: 12px; flex-wrap: wrap; align-items: center;">
|
|
294
|
+
<AppButton :badge="true" label="true" color="primary" text-color="white" />
|
|
295
|
+
<AppButton badge="badge" badge-color="red" label="badge" color="primary" text-color="white" />
|
|
296
|
+
<AppButton badge="3" badge-color="red" badge-inline label="inline" color="primary" text-color="white" />
|
|
297
|
+
</div>
|
|
298
|
+
`,
|
|
299
|
+
}),
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
export const Align: Story = {
|
|
303
|
+
render: () => ({
|
|
304
|
+
components: { AppButton },
|
|
305
|
+
template: `
|
|
306
|
+
<div style="display: flex; gap: 12px; flex-wrap: wrap; align-items: center;">
|
|
307
|
+
<AppButton icon="arrow_back" width="200px" align="center" label="center" color="primary" text-color="white" />
|
|
308
|
+
<AppButton width="200px" align="center" label="center" color="primary" text-color="white" />
|
|
309
|
+
<AppButton icon="arrow_back" width="200px" align="left" label="left" color="primary" text-color="white" />
|
|
310
|
+
<AppButton width="200px" align="left" label="left" color="primary" text-color="white" />
|
|
311
|
+
<AppButton icon="arrow_back" width="200px" align="right" label="right" color="primary" text-color="white" />
|
|
312
|
+
<AppButton width="200px" align="right" label="right" color="primary" text-color="white" />
|
|
313
|
+
<AppButton icon="arrow_back" width="200px" align="around" label="around" color="primary" text-color="white" />
|
|
314
|
+
<AppButton width="200px" align="around" label="around" color="primary" text-color="white" />
|
|
315
|
+
<AppButton icon="arrow_back" width="200px" align="evenly" label="evenly" color="primary" text-color="white" />
|
|
316
|
+
<AppButton width="200px" align="evenly" label="evenly" color="primary" text-color="white" />
|
|
317
|
+
</div>
|
|
318
|
+
`,
|
|
319
|
+
}),
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
export const Spacing: Story = {
|
|
323
|
+
render: () => ({
|
|
324
|
+
components: { AppButton },
|
|
325
|
+
template: `
|
|
326
|
+
<div style="display: flex; gap: 12px; flex-wrap: wrap; align-items: center;">
|
|
327
|
+
<AppButton icon="mail" fab label="fab" color="primary" text-color="white" />
|
|
328
|
+
<AppButton icon="mail" fab-mini label="fab-mini" color="primary" text-color="white" />
|
|
329
|
+
<AppButton dense label="dense" color="primary" text-color="white" />
|
|
330
|
+
<AppButton padding="20px" label="padding 20px" color="primary" text-color="white" />
|
|
331
|
+
</div>
|
|
332
|
+
`,
|
|
333
|
+
}),
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
export const Rounding: Story = {
|
|
337
|
+
render: () => ({
|
|
338
|
+
components: { AppButton },
|
|
339
|
+
template: `
|
|
340
|
+
<div style="display: flex; gap: 12px; flex-wrap: wrap; align-items: center;">
|
|
341
|
+
<AppButton square label="square" color="primary" text-color="white" />
|
|
342
|
+
<AppButton rounded label="rounded" color="primary" text-color="white" />
|
|
343
|
+
<AppButton rounded border-radius="20px" label="rounded 20px" color="primary" text-color="white" />
|
|
344
|
+
<AppButton round label="round" color="primary" text-color="white" />
|
|
345
|
+
</div>
|
|
346
|
+
`,
|
|
347
|
+
}),
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
export const Other: Story = {
|
|
351
|
+
render: () => ({
|
|
352
|
+
components: { AppButton },
|
|
353
|
+
template: `
|
|
354
|
+
<div style="display: flex; gap: 12px; flex-wrap: wrap; align-items: center;">
|
|
355
|
+
<AppButton outline label="outline" text-color="primary" />
|
|
356
|
+
<AppButton outline borderWidth="5px" label="borderWidth 5px" text-color="primary" />
|
|
357
|
+
<AppButton flat label="flat" text-color="primary" />
|
|
358
|
+
<AppButton unelevated label="unelevated" color="primary" text-color="white" />
|
|
359
|
+
<AppButton push label="push" color="primary" text-color="white" />
|
|
360
|
+
<AppButton glossy label="glossy" color="primary" text-color="white" />
|
|
361
|
+
<AppButton loading label="Загрузка..." color="primary" text-color="white" />
|
|
362
|
+
<AppButton tooltip="Подсказка" label="tooltip" color="primary" text-color="white" />
|
|
363
|
+
<AppButton disable label="disable" color="primary" text-color="white" />
|
|
364
|
+
<AppButton width="100px" wrap label="wrap + width 100px" color="primary" text-color="white" />
|
|
365
|
+
<AppButton stack icon="mail" icon-right="settings" badge="123" badge-color="red" badge-inline label="stack" color="primary" text-color="white" />
|
|
366
|
+
</div>
|
|
367
|
+
`,
|
|
368
|
+
}),
|
|
369
|
+
}
|