@dxtmisha/wiki 0.24.3 → 0.39.1
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/package.json +8 -8
- package/src/classes/WikiStorybook.ts +92 -1
- package/src/classes/WikiStorybookItem.ts +79 -5
- package/src/classes/WikiStorybookProp.ts +109 -0
- package/src/library.ts +1 -0
- package/src/media/descriptions/wikiDescriptions.ts +32 -0
- package/src/media/descriptions/wikiDescriptionsAccordion.ts +204 -0
- package/src/media/descriptions/wikiDescriptionsActionSheet.ts +264 -0
- package/src/media/descriptions/wikiDescriptionsActions.ts +189 -0
- package/src/media/descriptions/wikiDescriptionsAnchor.ts +78 -0
- package/src/media/descriptions/wikiDescriptionsArrow.ts +214 -0
- package/src/media/descriptions/wikiDescriptionsBadge.ts +43 -0
- package/src/media/descriptions/wikiDescriptionsBars.ts +33 -0
- package/src/media/descriptions/wikiDescriptionsBlock.ts +159 -0
- package/src/media/descriptions/wikiDescriptionsButton.ts +32 -1
- package/src/media/descriptions/wikiDescriptionsCell.ts +26 -1
- package/src/media/descriptions/wikiDescriptionsChip.ts +42 -0
- package/src/media/descriptions/wikiDescriptionsChipGroup.ts +199 -0
- package/src/media/descriptions/wikiDescriptionsDialog.ts +226 -0
- package/src/media/descriptions/wikiDescriptionsField.ts +57 -2
- package/src/media/descriptions/wikiDescriptionsFieldCounter.ts +32 -0
- package/src/media/descriptions/wikiDescriptionsFieldLabel.ts +22 -0
- package/src/media/descriptions/wikiDescriptionsFieldMessage.ts +25 -0
- package/src/media/descriptions/wikiDescriptionsIcon.ts +46 -8
- package/src/media/descriptions/wikiDescriptionsImage.ts +91 -7
- package/src/media/descriptions/wikiDescriptionsInput.ts +313 -0
- package/src/media/descriptions/wikiDescriptionsList.ts +31 -0
- package/src/media/descriptions/wikiDescriptionsListGroup.ts +57 -0
- package/src/media/descriptions/wikiDescriptionsListItem.ts +42 -0
- package/src/media/descriptions/wikiDescriptionsListMenu.ts +41 -0
- package/src/media/descriptions/wikiDescriptionsMask.ts +42 -0
- package/src/media/descriptions/wikiDescriptionsMenu.ts +179 -0
- package/src/media/descriptions/wikiDescriptionsModal.ts +200 -0
- package/src/media/descriptions/wikiDescriptionsMotionTransform.ts +59 -6
- package/src/media/descriptions/wikiDescriptionsPage.ts +155 -0
- package/src/media/descriptions/wikiDescriptionsProgress.ts +39 -0
- package/src/media/descriptions/wikiDescriptionsRipple.ts +42 -3
- package/src/media/descriptions/wikiDescriptionsScrollbar.ts +48 -0
- package/src/media/descriptions/wikiDescriptionsSection.ts +152 -0
- package/src/media/descriptions/wikiDescriptionsSelect.ts +253 -0
- package/src/media/descriptions/wikiDescriptionsSelectValue.ts +107 -0
- package/src/media/descriptions/wikiDescriptionsSkeleton.ts +42 -1
- package/src/media/descriptions/wikiDescriptionsTextareaAutosize.ts +80 -0
- package/src/media/descriptions/wikiDescriptionsTooltip.ts +136 -0
- package/src/media/descriptions/wikiDescriptionsWindow.ts +60 -0
- package/src/media/functional/en/conversions.mdx +67 -0
- package/src/media/functional/en/dataUtils.mdx +25 -0
- package/src/media/functional/en/datetimeRef.mdx +1 -1
- package/src/media/functional/en/eventRef.mdx +1 -1
- package/src/media/functional/en/executionUtils.mdx +58 -0
- package/src/media/functional/en/geoFlagRef.mdx +1 -1
- package/src/media/functional/en/geoIntlRef.mdx +1 -1
- package/src/media/functional/en/geoRef.mdx +2 -2
- package/src/media/functional/en/meta.mdx +1206 -0
- package/src/media/functional/en/metaManager.mdx +376 -0
- package/src/media/functional/en/metaOg.mdx +694 -0
- package/src/media/functional/en/metaTwitter.mdx +853 -0
- package/src/media/functional/en/reactive.mdx +40 -0
- package/src/media/functional/en/refTypes.mdx +1 -1
- package/src/media/functional/en/useApiRef.mdx +5 -5
- package/src/media/functional/en/useMeta.mdx +431 -0
- package/src/media/functional/en/validationUtils.mdx +11 -0
- package/src/media/functional/functional-basic/functions/getCurrentDate/getCurrentDate.en.mdx +25 -0
- package/src/media/functional/functional-basic/functions/getCurrentDate/getCurrentDate.ru.mdx +25 -0
- package/src/media/functional/functional-basic/functions/getCurrentDate/getCurrentDate.vi.mdx +25 -0
- package/src/media/functional/functional-basic/functions/isEnter/isEnter.en.mdx +30 -0
- package/src/media/functional/functional-basic/functions/isEnter/isEnter.ru.mdx +30 -0
- package/src/media/functional/functional-basic/functions/isEnter/isEnter.vi.mdx +30 -0
- package/src/media/functional/ru/conversions.mdx +67 -0
- package/src/media/functional/ru/dataUtils.mdx +25 -0
- package/src/media/functional/ru/datetimeRef.mdx +2 -2
- package/src/media/functional/ru/eventRef.mdx +1 -1
- package/src/media/functional/ru/executionUtils.mdx +58 -0
- package/src/media/functional/ru/geoFlagRef.mdx +1 -1
- package/src/media/functional/ru/geoIntl.mdx +2 -2
- package/src/media/functional/ru/geoIntlRef.mdx +1 -1
- package/src/media/functional/ru/geoRef.mdx +2 -2
- package/src/media/functional/ru/listTypes.mdx +1 -1
- package/src/media/functional/ru/meta.mdx +1330 -0
- package/src/media/functional/ru/metaManager.mdx +376 -0
- package/src/media/functional/ru/metaOg.mdx +694 -0
- package/src/media/functional/ru/metaTwitter.mdx +853 -0
- package/src/media/functional/ru/reactive.mdx +40 -0
- package/src/media/functional/ru/refTypes.mdx +2 -2
- package/src/media/functional/ru/useApiRef.mdx +5 -5
- package/src/media/functional/ru/useMeta.mdx +431 -0
- package/src/media/functional/ru/validationUtils.mdx +11 -0
- package/src/media/mdx/Accordion/accordion.en.mdx +59 -0
- package/src/media/mdx/Accordion/accordion.ru.mdx +59 -0
- package/src/media/mdx/Accordion/slots.en.mdx +6 -0
- package/src/media/mdx/Accordion/slots.ru.mdx +6 -0
- package/src/media/mdx/Accordion/wikiMdxAccordion.ts +25 -0
- package/src/media/mdx/ActionSheet/actionSheet.en.mdx +61 -0
- package/src/media/mdx/ActionSheet/actionSheet.ru.mdx +61 -0
- package/src/media/mdx/ActionSheet/touchClose.en.mdx +21 -0
- package/src/media/mdx/ActionSheet/touchClose.ru.mdx +21 -0
- package/src/media/mdx/ActionSheet/wikiMdxActionSheet.ts +25 -0
- package/src/media/mdx/Actions/actions.en.mdx +48 -0
- package/src/media/mdx/Actions/actions.ru.mdx +48 -0
- package/src/media/mdx/Actions/flexible.en.mdx +19 -0
- package/src/media/mdx/Actions/flexible.ru.mdx +19 -0
- package/src/media/mdx/Actions/list.en.mdx +50 -0
- package/src/media/mdx/Actions/list.ru.mdx +50 -0
- package/src/media/mdx/Actions/wikiMdxActions.ts +31 -0
- package/src/media/mdx/Anchor/anchor.en.mdx +34 -0
- package/src/media/mdx/Anchor/anchor.ru.mdx +34 -0
- package/src/media/mdx/Anchor/expose.go.en.mdx +6 -0
- package/src/media/mdx/Anchor/expose.go.ru.mdx +6 -0
- package/src/media/mdx/Anchor/hide.en.mdx +28 -0
- package/src/media/mdx/Anchor/hide.ru.mdx +28 -0
- package/src/media/mdx/Anchor/isCopy.en.mdx +23 -0
- package/src/media/mdx/Anchor/isCopy.ru.mdx +23 -0
- package/src/media/mdx/Anchor/scroll.en.mdx +34 -0
- package/src/media/mdx/Anchor/scroll.ru.mdx +35 -0
- package/src/media/mdx/Anchor/wikiMdxAnchor.ts +43 -0
- package/src/media/mdx/Arrow/arrow.en.mdx +33 -0
- package/src/media/mdx/Arrow/arrow.ru.mdx +33 -0
- package/src/media/mdx/Arrow/wikiMdxArrow.ts +19 -0
- package/src/media/mdx/Block/block.en.mdx +42 -0
- package/src/media/mdx/Block/block.ru.mdx +42 -0
- package/src/media/mdx/Block/wikiMdxBlock.ts +19 -0
- package/src/media/mdx/ChipGroup/chipGroup.en.mdx +51 -0
- package/src/media/mdx/ChipGroup/chipGroup.ru.mdx +51 -0
- package/src/media/mdx/ChipGroup/selected.en.mdx +50 -0
- package/src/media/mdx/ChipGroup/selected.ru.mdx +50 -0
- package/src/media/mdx/ChipGroup/wikiMdxChipGroup.ts +25 -0
- package/src/media/mdx/Dialog/buttons.en.mdx +45 -0
- package/src/media/mdx/Dialog/buttons.ru.mdx +45 -0
- package/src/media/mdx/Dialog/dialog.en.mdx +66 -0
- package/src/media/mdx/Dialog/dialog.ru.mdx +65 -0
- package/src/media/mdx/Dialog/events.en.mdx +63 -0
- package/src/media/mdx/Dialog/events.ru.mdx +63 -0
- package/src/media/mdx/Dialog/states.en.mdx +58 -0
- package/src/media/mdx/Dialog/states.ru.mdx +57 -0
- package/src/media/mdx/Dialog/wikiMdxDialog.ts +37 -0
- package/src/media/mdx/Field/arrows.en.mdx +22 -6
- package/src/media/mdx/Field/arrows.ru.mdx +22 -6
- package/src/media/mdx/Field/slots.en.mdx +0 -13
- package/src/media/mdx/Field/slots.ru.mdx +0 -13
- package/src/media/mdx/Image/flag.en.mdx +23 -0
- package/src/media/mdx/Image/flag.ru.mdx +23 -0
- package/src/media/mdx/Image/image.en.mdx +26 -21
- package/src/media/mdx/Image/image.ru.mdx +26 -22
- package/src/media/mdx/Image/img-tag.en.mdx +105 -0
- package/src/media/mdx/Image/img-tag.ru.mdx +105 -0
- package/src/media/mdx/Image/wikiMdxImage.ts +12 -0
- package/src/media/mdx/Input/currency.en.mdx +38 -0
- package/src/media/mdx/Input/currency.ru.mdx +38 -0
- package/src/media/mdx/Input/date.en.mdx +53 -0
- package/src/media/mdx/Input/date.ru.mdx +53 -0
- package/src/media/mdx/Input/input.en.mdx +143 -0
- package/src/media/mdx/Input/input.ru.mdx +71 -0
- package/src/media/mdx/Input/mask.en.mdx +30 -0
- package/src/media/mdx/Input/mask.ru.mdx +30 -0
- package/src/media/mdx/Input/number.en.mdx +41 -0
- package/src/media/mdx/Input/number.ru.mdx +41 -0
- package/src/media/mdx/Input/type.en.mdx +26 -0
- package/src/media/mdx/Input/type.ru.mdx +26 -0
- package/src/media/mdx/Input/wikiMdxInput.ts +49 -0
- package/src/media/mdx/Menu/event.updateValue.en.mdx +29 -0
- package/src/media/mdx/Menu/event.updateValue.ru.mdx +30 -0
- package/src/media/mdx/Menu/expose.navigation.en.mdx +12 -0
- package/src/media/mdx/Menu/expose.navigation.ru.mdx +12 -0
- package/src/media/mdx/Menu/navigation.en.mdx +56 -0
- package/src/media/mdx/Menu/navigation.ru.mdx +56 -0
- package/src/media/mdx/Menu/slots.control.en.mdx +65 -0
- package/src/media/mdx/Menu/slots.control.ru.mdx +65 -0
- package/src/media/mdx/Menu/slots.en.mdx +2 -24
- package/src/media/mdx/Menu/slots.ru.mdx +2 -24
- package/src/media/mdx/Menu/wikiMdxMenu.ts +27 -3
- package/src/media/mdx/Modal/differences.en.mdx +130 -0
- package/src/media/mdx/Modal/differences.ru.mdx +65 -0
- package/src/media/mdx/Modal/modal.en.mdx +63 -0
- package/src/media/mdx/Modal/modal.ru.mdx +63 -0
- package/src/media/mdx/Modal/wikiMdxModal.ts +25 -0
- package/src/media/mdx/MotionTransform/expose.motionTransformElement.en.mdx +13 -0
- package/src/media/mdx/MotionTransform/expose.motionTransformElement.ru.mdx +14 -0
- package/src/media/mdx/MotionTransform/wikiMdxMotionTransform.ts +6 -0
- package/src/media/mdx/Page/page.en.mdx +38 -0
- package/src/media/mdx/Page/page.ru.mdx +38 -0
- package/src/media/mdx/Page/wikiMdxPage.ts +19 -0
- package/src/media/mdx/Section/section.en.mdx +38 -0
- package/src/media/mdx/Section/section.ru.mdx +38 -0
- package/src/media/mdx/Section/wikiMdxSection.ts +19 -0
- package/src/media/mdx/Select/select.en.mdx +69 -0
- package/src/media/mdx/Select/select.ru.mdx +69 -0
- package/src/media/mdx/Select/wikiMdxSelect.ts +19 -0
- package/src/media/mdx/SelectValue/selectValue.en.mdx +64 -0
- package/src/media/mdx/SelectValue/selectValue.ru.mdx +64 -0
- package/src/media/mdx/SelectValue/wikiMdxSelectValue.ts +19 -0
- package/src/media/mdx/TextareaAutosize/textarea-autosize.en.mdx +65 -0
- package/src/media/mdx/TextareaAutosize/textarea-autosize.ru.mdx +65 -0
- package/src/media/mdx/TextareaAutosize/wikiMdxTextareaAutosize.ts +19 -0
- package/src/media/mdx/Tooltip/event.tooltip.en.mdx +7 -0
- package/src/media/mdx/Tooltip/event.tooltip.ru.mdx +8 -0
- package/src/media/mdx/Tooltip/slot.control.en.mdx +14 -0
- package/src/media/mdx/Tooltip/slot.control.ru.mdx +14 -0
- package/src/media/mdx/Tooltip/tooltip.en.mdx +34 -0
- package/src/media/mdx/Tooltip/tooltip.ru.mdx +34 -0
- package/src/media/mdx/Tooltip/wikiMdxTooltip.ts +31 -0
- package/src/media/mdx/Window/classes.ru.mdx +1 -1
- package/src/media/mdx/event/events.actions.en.mdx +44 -0
- package/src/media/mdx/event/events.actions.ru.mdx +44 -0
- package/src/media/mdx/event/events.inputStandard.en.mdx +6 -0
- package/src/media/mdx/event/events.inputStandard.ru.mdx +6 -0
- package/src/media/mdx/event/wikiMdxEvent.ts +20 -8
- package/src/media/mdx/expose/expose.clear.en.mdx +1 -1
- package/src/media/mdx/expose/expose.descriptionId.en.mdx +6 -0
- package/src/media/mdx/expose/expose.descriptionId.ru.mdx +6 -0
- package/src/media/mdx/expose/expose.id.en.mdx +6 -0
- package/src/media/mdx/expose/expose.id.ru.mdx +6 -0
- package/src/media/mdx/expose/expose.labelId.en.mdx +6 -0
- package/src/media/mdx/expose/expose.labelId.ru.mdx +6 -0
- package/src/media/mdx/expose/wikiMdxExpose.ts +18 -0
- package/src/media/mdx/slot/body.en.mdx +6 -0
- package/src/media/mdx/slot/body.ru.mdx +6 -0
- package/src/media/mdx/slot/headline.en.mdx +7 -0
- package/src/media/mdx/slot/headline.ru.mdx +6 -0
- package/src/media/mdx/slot/leading.en.mdx +7 -0
- package/src/media/mdx/slot/leading.ru.mdx +7 -0
- package/src/media/mdx/slot/secondary.en.mdx +5 -0
- package/src/media/mdx/slot/secondary.ru.mdx +5 -0
- package/src/media/mdx/slot/trailing.en.mdx +7 -0
- package/src/media/mdx/slot/trailing.ru.mdx +7 -0
- package/src/media/mdx/slot/wikiMdxSlot.ts +30 -0
- package/src/media/mdx/style/isSkeleton.en.mdx +2 -2
- package/src/media/mdx/style/isSkeleton.ru.mdx +2 -2
- package/src/media/mdx/value/v-model-selected.en.mdx +28 -0
- package/src/media/mdx/value/v-model-selected.ru.mdx +28 -0
- package/src/media/mdx/value/v-model.en.mdx +26 -0
- package/src/media/mdx/value/v-model.ru.mdx +26 -0
- package/src/media/mdx/value/wikiMdxValue.ts +24 -3
- package/src/media/mdx/wikiMdx.ts +33 -1
- package/src/media/props/wiki.ts +44 -0
- package/src/media/props/wikiActions.ts +43 -0
- package/src/media/props/wikiActionsInclude.ts +62 -0
- package/src/media/props/wikiAnchor.ts +85 -0
- package/src/media/props/wikiAria.ts +123 -0
- package/src/media/props/wikiArrow.ts +24 -0
- package/src/media/props/wikiArrowInclude.ts +45 -0
- package/src/media/props/wikiAttributes.ts +143 -0
- package/src/media/props/wikiBadge.ts +7 -4
- package/src/media/props/wikiBars.ts +7 -6
- package/src/media/props/wikiBarsInclude.ts +82 -0
- package/src/media/props/wikiButton.ts +8 -4
- package/src/media/props/wikiChip.ts +4 -2
- package/src/media/props/wikiChipGroup.ts +39 -0
- package/src/media/props/wikiDialog.ts +33 -0
- package/src/media/props/wikiField.ts +18 -31
- package/src/media/props/wikiFieldCounterInclude.ts +87 -0
- package/src/media/props/wikiForm.ts +267 -0
- package/src/media/props/wikiHook.ts +20 -0
- package/src/media/props/wikiIcon.ts +19 -6
- package/src/media/props/wikiIconInclude.ts +322 -0
- package/src/media/props/wikiImage.ts +97 -20
- package/src/media/props/wikiInformation.ts +164 -0
- package/src/media/props/wikiInput.ts +34 -0
- package/src/media/props/wikiList.ts +10 -4
- package/src/media/props/wikiListItem.ts +23 -2
- package/src/media/props/wikiMask.ts +2 -12
- package/src/media/props/wikiMaskInclude.ts +54 -0
- package/src/media/props/wikiMenu.ts +1 -11
- package/src/media/props/wikiMotionTransform.ts +7 -13
- package/src/media/props/wikiOption.ts +356 -0
- package/src/media/props/wikiProgress.ts +8 -5
- package/src/media/props/wikiScrollbar.ts +6 -6
- package/src/media/props/wikiSelect.ts +68 -0
- package/src/media/props/wikiSelectValue.ts +30 -0
- package/src/media/props/wikiStatus.ts +34 -57
- package/src/media/props/wikiStyle.ts +85 -406
- package/src/media/props/wikiTechnical.ts +141 -1
- package/src/media/props/wikiText.ts +167 -0
- package/src/media/props/wikiTooltip.ts +53 -0
- package/src/media/props/wikiValue.ts +22 -276
- package/src/media/props/wikiWindow.ts +24 -45
- package/src/shims-mdx.d.ts +5 -0
- package/src/styles/storybookStyle.scss +3 -1
- package/src/types/storybookTypes.ts +48 -4
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
import type { StorybookComponentsDescriptionItem } from '../../types/storybookTypes'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Descriptions for Select component properties
|
|
5
|
+
*
|
|
6
|
+
* Описания свойств компонента Select
|
|
7
|
+
*/
|
|
8
|
+
export const wikiDescriptionsSelect: StorybookComponentsDescriptionItem = {
|
|
9
|
+
name: 'Select',
|
|
10
|
+
description: {
|
|
11
|
+
en: 'Complete select dropdown control combining Field, Menu, SelectValue and Input for sophisticated selection interface',
|
|
12
|
+
ru: 'Полнофункциональный элемент выбора из выпадающего списка, объединяющий Field, Menu, SelectValue и Input для продвинутого интерфейса выбора'
|
|
13
|
+
},
|
|
14
|
+
possibilities: {
|
|
15
|
+
en: [
|
|
16
|
+
'single or multiple value selection',
|
|
17
|
+
'built-in search and filtering capabilities',
|
|
18
|
+
'editable selected value mode (editValue)',
|
|
19
|
+
'AJAX data loading with caching support',
|
|
20
|
+
'filter mode for real-time option filtering',
|
|
21
|
+
'validation with standard Field features',
|
|
22
|
+
'keyboard navigation and accessibility',
|
|
23
|
+
'custom option list via slots or data',
|
|
24
|
+
'icon support for dropdown arrow and search',
|
|
25
|
+
'auto-close control for multiple selection',
|
|
26
|
+
'integration with all Field component features (label, counter, messages, icons)'
|
|
27
|
+
],
|
|
28
|
+
ru: [
|
|
29
|
+
'выбор одиночного или множественных значений',
|
|
30
|
+
'встроенный поиск и возможности фильтрации',
|
|
31
|
+
'режим редактирования выбранного значения (editValue)',
|
|
32
|
+
'AJAX загрузка данных с поддержкой кеширования',
|
|
33
|
+
'режим фильтрации для реального времени',
|
|
34
|
+
'валидация со стандартными функциями Field',
|
|
35
|
+
'клавиатурная навигация и доступность',
|
|
36
|
+
'пользовательский список опций через слоты или данные',
|
|
37
|
+
'поддержка иконок для стрелки выпадающего списка и поиска',
|
|
38
|
+
'управление автозакрытием для множественного выбора',
|
|
39
|
+
'интеграция со всеми возможностями компонента Field (подпись, счётчик, сообщения, иконки)'
|
|
40
|
+
]
|
|
41
|
+
},
|
|
42
|
+
import: [
|
|
43
|
+
'import { ref } from \'vue\''
|
|
44
|
+
],
|
|
45
|
+
render: `
|
|
46
|
+
<DesignComponent v-bind="args" />
|
|
47
|
+
`,
|
|
48
|
+
stories: [
|
|
49
|
+
{
|
|
50
|
+
id: 'SelectBasic',
|
|
51
|
+
name: {
|
|
52
|
+
en: 'Basic',
|
|
53
|
+
ru: 'Базовые'
|
|
54
|
+
},
|
|
55
|
+
setup: `
|
|
56
|
+
const options = ref([
|
|
57
|
+
{label: 'JavaScript', value: 'js'},
|
|
58
|
+
{label: 'TypeScript', value: 'ts'},
|
|
59
|
+
{label: 'Python', value: 'py'},
|
|
60
|
+
{label: 'Java', value: 'java'},
|
|
61
|
+
{label: 'C++', value: 'cpp'},
|
|
62
|
+
{label: 'Ruby', value: 'rb'},
|
|
63
|
+
{label: 'Go', value: 'go'},
|
|
64
|
+
{label: 'PHP', value: 'php'}
|
|
65
|
+
])
|
|
66
|
+
|
|
67
|
+
return { options }
|
|
68
|
+
`,
|
|
69
|
+
template: `
|
|
70
|
+
<div class="wiki-storybook-flex-column">
|
|
71
|
+
<DesignComponent
|
|
72
|
+
type="select"
|
|
73
|
+
label="Standard select"
|
|
74
|
+
placeholder="Select option"
|
|
75
|
+
:option="options"
|
|
76
|
+
/>
|
|
77
|
+
<DesignComponent
|
|
78
|
+
type="select"
|
|
79
|
+
label="With search"
|
|
80
|
+
placeholder="Search..."
|
|
81
|
+
showSearch
|
|
82
|
+
:option="options"
|
|
83
|
+
/>
|
|
84
|
+
<DesignComponent
|
|
85
|
+
type="select"
|
|
86
|
+
label="With filter"
|
|
87
|
+
placeholder="Type to filter"
|
|
88
|
+
showSearch
|
|
89
|
+
filterMode
|
|
90
|
+
:option="options"
|
|
91
|
+
/>
|
|
92
|
+
<DesignComponent
|
|
93
|
+
type="select"
|
|
94
|
+
label="Edit value"
|
|
95
|
+
placeholder="Select or type"
|
|
96
|
+
editValue
|
|
97
|
+
filterMode
|
|
98
|
+
:option="options"
|
|
99
|
+
/>
|
|
100
|
+
<DesignComponent
|
|
101
|
+
type="select"
|
|
102
|
+
label="With arrows"
|
|
103
|
+
placeholder="Select option"
|
|
104
|
+
arrow="carousel"
|
|
105
|
+
:option="options"
|
|
106
|
+
/>
|
|
107
|
+
</div>
|
|
108
|
+
`
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
id: 'SelectVModel',
|
|
112
|
+
name: {
|
|
113
|
+
en: 'Two-way binding (v-model)',
|
|
114
|
+
ru: 'Двусторонняя привязка (v-model)'
|
|
115
|
+
},
|
|
116
|
+
setup: `
|
|
117
|
+
return {
|
|
118
|
+
singleValue: ref('option2'),
|
|
119
|
+
multipleValue: ref(['option1', 'option3'])
|
|
120
|
+
}
|
|
121
|
+
`,
|
|
122
|
+
template: `
|
|
123
|
+
<div class="wiki-storybook-flex-column">
|
|
124
|
+
<DesignComponent
|
|
125
|
+
v-model="singleValue"
|
|
126
|
+
type="select"
|
|
127
|
+
label="Single select"
|
|
128
|
+
arrow="carousel"
|
|
129
|
+
:option="[
|
|
130
|
+
{label: 'First option', value: 'option1'},
|
|
131
|
+
{label: 'Second option', value: 'option2'},
|
|
132
|
+
{label: 'Third option', value: 'option3'}
|
|
133
|
+
]"
|
|
134
|
+
/>
|
|
135
|
+
<div>Selected: {{ singleValue }}</div>
|
|
136
|
+
|
|
137
|
+
<DesignComponent
|
|
138
|
+
v-model="multipleValue"
|
|
139
|
+
type="select"
|
|
140
|
+
label="Multiple select"
|
|
141
|
+
multiple
|
|
142
|
+
:option="[
|
|
143
|
+
{label: 'First option', value: 'option1'},
|
|
144
|
+
{label: 'Second option', value: 'option2'},
|
|
145
|
+
{label: 'Third option', value: 'option3'}
|
|
146
|
+
]"
|
|
147
|
+
/>
|
|
148
|
+
<div>Selected: {{ multipleValue }}</div>
|
|
149
|
+
</div>
|
|
150
|
+
`
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
id: 'SelectSkeleton',
|
|
154
|
+
name: {
|
|
155
|
+
en: 'Skeleton',
|
|
156
|
+
ru: 'Скелетон'
|
|
157
|
+
},
|
|
158
|
+
components: ['Skeleton'],
|
|
159
|
+
template: `
|
|
160
|
+
<DesignSkeleton :active="true" style="max-width:320px">
|
|
161
|
+
<div class="wiki-storybook-flex-column">
|
|
162
|
+
<DesignComponent
|
|
163
|
+
isSkeleton
|
|
164
|
+
type="select"
|
|
165
|
+
label="Loading select"
|
|
166
|
+
helperMessage="Options are loading..."
|
|
167
|
+
:option="[
|
|
168
|
+
{label: 'First option', value: 'option1'},
|
|
169
|
+
{label: 'Second option', value: 'option2'},
|
|
170
|
+
{label: 'Third option', value: 'option3'}
|
|
171
|
+
]"
|
|
172
|
+
/>
|
|
173
|
+
</div>
|
|
174
|
+
</DesignSkeleton>
|
|
175
|
+
`
|
|
176
|
+
}
|
|
177
|
+
],
|
|
178
|
+
documentation: {
|
|
179
|
+
body: `
|
|
180
|
+
<StorybookDescriptions componentName={'Select'} type={'select'}/>
|
|
181
|
+
<Canvas of={Component.SelectBasic}/>
|
|
182
|
+
|
|
183
|
+
<StorybookDescriptions componentName={'Value'} type={'value'}/>
|
|
184
|
+
<StorybookDescriptions componentName={'Value'} type={'v-model'}/>
|
|
185
|
+
<Canvas of={Component.SelectVModel}/>
|
|
186
|
+
|
|
187
|
+
<StorybookDescriptions componentName={'Style'} type={'isSkeleton'}/>
|
|
188
|
+
<Canvas of={Component.SelectSkeleton}/>
|
|
189
|
+
`,
|
|
190
|
+
events: `
|
|
191
|
+
<StorybookDescriptions componentName={'Event'} type={'input'}/>
|
|
192
|
+
<StorybookDescriptions componentName={'Event'} type={'change'}/>
|
|
193
|
+
`,
|
|
194
|
+
expose: `
|
|
195
|
+
<StorybookDescriptions componentName={'Expose'} type={'selected'}/>
|
|
196
|
+
<StorybookDescriptions componentName={'Expose'} type={'validation'}/>
|
|
197
|
+
`,
|
|
198
|
+
slots: `
|
|
199
|
+
<StorybookDescriptions componentName={'Slot'} type={'label'} />
|
|
200
|
+
<StorybookDescriptions componentName={'Slot'} type={'prefix'} />
|
|
201
|
+
<StorybookDescriptions componentName={'Slot'} type={'suffix'} />
|
|
202
|
+
<StorybookDescriptions componentName={'Slot'} type={'caption'} />
|
|
203
|
+
<StorybookDescriptions componentName={'Slot'} type={'leading'} />
|
|
204
|
+
<StorybookDescriptions componentName={'Slot'} type={'trailing'} />
|
|
205
|
+
<StorybookDescriptions componentName={'List'} type={'slot.html'}/>
|
|
206
|
+
<StorybookDescriptions componentName={'Menu'} type={'slots'}/>
|
|
207
|
+
`
|
|
208
|
+
},
|
|
209
|
+
ai: {
|
|
210
|
+
description: `
|
|
211
|
+
The select is a comprehensive form component used for choosing one or multiple values from a collection of options.
|
|
212
|
+
It integrates a trigger field, a dropdown menu, and value display logic into a single cohesive control.
|
|
213
|
+
|
|
214
|
+
**Key Features:**
|
|
215
|
+
1. **Data Handling (\`option\`):**
|
|
216
|
+
- **Static Data:** Accepts an array of objects or strings via the \`option\` prop.
|
|
217
|
+
- **Mapping:** Use \`keyLabel\` and \`keyValue\` to specify which properties to use for display and value (defaults to 'label' and 'value').
|
|
218
|
+
- **Async Data:** Use the \`ajax\` prop to provide a function that returns a Promise with the list of options. Supports caching via \`cache\`.
|
|
219
|
+
|
|
220
|
+
2. **Selection Modes:**
|
|
221
|
+
- **Single Selection:** Default. Displays the selected item's label as text.
|
|
222
|
+
- **Multiple Selection (\`multiple\`):** Allows selecting multiple items. Displays them as Chips. Use \`max\` to limit the number of selections.
|
|
223
|
+
- **Editable (\`editValue\`):** Allows the user to type into the input field, acting like a Combobox.
|
|
224
|
+
|
|
225
|
+
3. **Search & Filtering:**
|
|
226
|
+
- **Filter Mode (\`filterMode\`):** Filters the list options in real-time as the user types.
|
|
227
|
+
- **Show Search (\`showSearch\`):** Adds a dedicated search input field inside the dropdown menu (useful for mobile or when \`editValue\` is false).
|
|
228
|
+
|
|
229
|
+
4. **Appearance & Feedback:**
|
|
230
|
+
- **Field Integration:** Inherits all \`Field\` styling props (\`label\`, \`helperMessage\`, \`validationMessage\`, \`icon\`, \`loading\`).
|
|
231
|
+
- **Placeholder:** Text shown when no value is selected.
|
|
232
|
+
- **Cancel:** The \`cancel\` prop controls the visibility of the clear button ('auto', 'always', 'none').
|
|
233
|
+
|
|
234
|
+
**Usage Examples:**
|
|
235
|
+
|
|
236
|
+
- **Standard Select:**
|
|
237
|
+
\`<Select label="Choose a fruit" :option="['Apple', 'Banana', 'Orange']" />\`
|
|
238
|
+
|
|
239
|
+
- **Multiple Select with Object Data:**
|
|
240
|
+
\`<Select
|
|
241
|
+
label="Assignees"
|
|
242
|
+
multiple
|
|
243
|
+
:option="users"
|
|
244
|
+
key-label="name"
|
|
245
|
+
key-value="id"
|
|
246
|
+
v-model="selectedUserIds"
|
|
247
|
+
/>\`
|
|
248
|
+
|
|
249
|
+
- **Searchable Select:**
|
|
250
|
+
\`<Select label="Country" :option="countries" filter-mode />\`
|
|
251
|
+
`
|
|
252
|
+
}
|
|
253
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import type { StorybookComponentsDescriptionItem } from '../../types/storybookTypes'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Descriptions for SelectValue component properties
|
|
5
|
+
*
|
|
6
|
+
* Описания свойств компонента SelectValue
|
|
7
|
+
*/
|
|
8
|
+
export const wikiDescriptionsSelectValue: StorybookComponentsDescriptionItem = {
|
|
9
|
+
name: 'SelectValue',
|
|
10
|
+
description: {
|
|
11
|
+
en: 'Display component for selected values in select controls, showing chips for multiple selection or single text value',
|
|
12
|
+
ru: 'Компонент отображения выбранных значений в элементах выбора, показывающий чипы для множественного выбора или одиночное текстовое значение'
|
|
13
|
+
},
|
|
14
|
+
possibilities: {
|
|
15
|
+
en: [
|
|
16
|
+
'single or multiple value display modes',
|
|
17
|
+
'automatic chip rendering for multiple selections',
|
|
18
|
+
'placeholder support for empty state',
|
|
19
|
+
'cancel icon for clearing individual selections',
|
|
20
|
+
'customizable chip appearance via chipAttrs',
|
|
21
|
+
'optional icon display in chips',
|
|
22
|
+
'responsive handling of selected items',
|
|
23
|
+
'disabled and readonly states support'
|
|
24
|
+
],
|
|
25
|
+
ru: [
|
|
26
|
+
'режимы отображения одиночного или множественного значения',
|
|
27
|
+
'автоматический рендеринг чипов для множественного выбора',
|
|
28
|
+
'поддержка плейсхолдера для пустого состояния',
|
|
29
|
+
'иконка отмены для очистки отдельных выборов',
|
|
30
|
+
'настраиваемый внешний вид чипов через chipAttrs',
|
|
31
|
+
'опциональное отображение иконок в чипах',
|
|
32
|
+
'адаптивная обработка выбранных элементов',
|
|
33
|
+
'поддержка состояний disabled и readonly'
|
|
34
|
+
]
|
|
35
|
+
},
|
|
36
|
+
import: [],
|
|
37
|
+
stories: [
|
|
38
|
+
{
|
|
39
|
+
id: 'SelectValueBasic',
|
|
40
|
+
name: {
|
|
41
|
+
en: 'Basic',
|
|
42
|
+
ru: 'Базовые'
|
|
43
|
+
},
|
|
44
|
+
template: `
|
|
45
|
+
<div class="wiki-storybook-flex-column">
|
|
46
|
+
<div class="wiki-storybook-item wiki-storybook-item--padding wiki-storybook-item--auto">
|
|
47
|
+
<div class="wiki-storybook-item__label wiki-storybook-item__label--static">Placeholder</div>
|
|
48
|
+
<DesignComponent placeholder="Select option"/>
|
|
49
|
+
</div>
|
|
50
|
+
<div class="wiki-storybook-item wiki-storybook-item--padding wiki-storybook-item--auto">
|
|
51
|
+
<div class="wiki-storybook-item__label wiki-storybook-item__label--static">Single value</div>
|
|
52
|
+
<DesignComponent :value="[{ label: 'Option 1', value: '1' }]"/>
|
|
53
|
+
</div>
|
|
54
|
+
<div class="wiki-storybook-item wiki-storybook-item--padding wiki-storybook-item--auto">
|
|
55
|
+
<div class="wiki-storybook-item__label wiki-storybook-item__label--static">Multiple values</div>
|
|
56
|
+
<DesignComponent
|
|
57
|
+
:multiple="true"
|
|
58
|
+
:value="[
|
|
59
|
+
{ label: 'Option 1', value: '1', index: '1' },
|
|
60
|
+
{ label: 'Option 2', value: '2', index: '2' },
|
|
61
|
+
{ label: 'Option 3', value: '3', index: '3' }
|
|
62
|
+
]"
|
|
63
|
+
/>
|
|
64
|
+
</div>
|
|
65
|
+
</div>
|
|
66
|
+
`
|
|
67
|
+
}
|
|
68
|
+
],
|
|
69
|
+
documentation: {
|
|
70
|
+
body: `
|
|
71
|
+
<StorybookDescriptions componentName={'SelectValue'} type={'selectValue'}/>
|
|
72
|
+
<Canvas of={Component.SelectValueBasic}/>
|
|
73
|
+
`,
|
|
74
|
+
events: `
|
|
75
|
+
<StorybookDescriptions componentName={'Event'} type={'click'}/>
|
|
76
|
+
`
|
|
77
|
+
},
|
|
78
|
+
ai: {
|
|
79
|
+
description: `
|
|
80
|
+
SelectValue is a specialized display component used primarily within Select-like inputs to render the selected value(s).
|
|
81
|
+
It handles the visual representation of selection, switching between a simple text label (single selection) and a group of chips (multiple selection).
|
|
82
|
+
|
|
83
|
+
**Key Features:**
|
|
84
|
+
1. **Display Modes:**
|
|
85
|
+
- **Single Selection (default):** Renders the label of the first item in the \`value\` array as text.
|
|
86
|
+
- **Multiple Selection (\`multiple\`):** Renders each item in the \`value\` array as a \`Chip\` component.
|
|
87
|
+
|
|
88
|
+
2. **Data Handling (\`value\`):**
|
|
89
|
+
- Accepts an array of objects: \`[{ label: 'Text', value: 'val', ... }]\`.
|
|
90
|
+
- Even for single selection, it expects an array (uses the first item).
|
|
91
|
+
- If \`value\` is empty, it displays the \`placeholder\`.
|
|
92
|
+
|
|
93
|
+
3. **Chip Customization (Multiple Mode):**
|
|
94
|
+
- \`chipAttrs\`: Allows passing props to the internal \`Chip\` components (e.g., \`{ outline: true, icon: 'check' }\`).
|
|
95
|
+
- Handles chip removal events automatically if not disabled/readonly.
|
|
96
|
+
|
|
97
|
+
**When to use:**
|
|
98
|
+
- Inside the trigger area of a **Select**, **Combobox**, or **Autocomplete** component.
|
|
99
|
+
- To display a list of selected tags or tokens.
|
|
100
|
+
|
|
101
|
+
**Usage Examples:**
|
|
102
|
+
|
|
103
|
+
- **Multiple Values (Chips):**
|
|
104
|
+
\`<SelectValue multiple :value="[{ label: 'Apple' }, { label: 'Banana' }]" />\`
|
|
105
|
+
`
|
|
106
|
+
}
|
|
107
|
+
}
|
|
@@ -10,7 +10,7 @@ export const wikiDescriptionsSkeleton: StorybookComponentsDescriptionItem = {
|
|
|
10
10
|
en: [
|
|
11
11
|
'animated loading placeholders for content',
|
|
12
12
|
'control visibility with `active` property',
|
|
13
|
-
'child elements react to skeleton state via `isSkeleton` property or special classes',
|
|
13
|
+
'child elements react to the skeleton state via `isSkeleton` property or special classes',
|
|
14
14
|
'customizable appearance and animation'
|
|
15
15
|
],
|
|
16
16
|
ru: [
|
|
@@ -129,5 +129,46 @@ export const wikiDescriptionsSkeleton: StorybookComponentsDescriptionItem = {
|
|
|
129
129
|
expose: `
|
|
130
130
|
<StorybookDescriptions componentName={'Skeleton'} type={'expose.isActive'}/>
|
|
131
131
|
`
|
|
132
|
+
},
|
|
133
|
+
ai: {
|
|
134
|
+
description: `
|
|
135
|
+
Skeleton is a structural component used to display a loading state (placeholder) for content.
|
|
136
|
+
It creates an animated "ghost" version of the UI to improve perceived performance and prevent layout shifts (CLS).
|
|
137
|
+
|
|
138
|
+
**Key Features:**
|
|
139
|
+
1. **Activation (\`active\`):**
|
|
140
|
+
- The \`active\` prop controls the visibility of the skeleton effect.
|
|
141
|
+
- When \`true\`, the component applies loading styles and accessibility attributes.
|
|
142
|
+
|
|
143
|
+
2. **Context & Inheritance:**
|
|
144
|
+
- Uses Vue's \`provide\`/\`inject\` mechanism.
|
|
145
|
+
- Child components (like \`Image\`, \`Field\`, \`Chip\`) automatically detect if they are inside an active \`Skeleton\` and switch to their own skeleton view without needing individual props.
|
|
146
|
+
|
|
147
|
+
3. **Styling Classes (Slot Props):**
|
|
148
|
+
- The component exposes CSS classes via the default slot to style raw HTML elements.
|
|
149
|
+
- **Text:** \`classText\` (lines), \`classTextVariant\` (headings).
|
|
150
|
+
- **Background:** \`classBackground\` (blocks, images), \`classBackgroundVariant\`.
|
|
151
|
+
- **Border:** \`classBorder\` (outlines).
|
|
152
|
+
|
|
153
|
+
4. **Accessibility:**
|
|
154
|
+
- Automatically applies \`aria-busy="true"\` and \`aria-live="polite"\` to the wrapper.
|
|
155
|
+
|
|
156
|
+
**Usage Examples:**
|
|
157
|
+
|
|
158
|
+
- **Wrapping Smart Components:**
|
|
159
|
+
\`<Skeleton :active="isLoading">
|
|
160
|
+
<div class="profile">
|
|
161
|
+
<Image :value="user.avatar" /> <!-- Auto-skeleton -->
|
|
162
|
+
<Field :value="user.name" readonly /> <!-- Auto-skeleton -->
|
|
163
|
+
</div>
|
|
164
|
+
</Skeleton>\`
|
|
165
|
+
|
|
166
|
+
- **Manual Structure (using slot classes):**
|
|
167
|
+
\`<Skeleton :active="isLoading" v-slot="{ classes }">
|
|
168
|
+
<div :class="classes.classBackground" style="height: 200px"></div>
|
|
169
|
+
<h3 :class="classes.classTextVariant"></h3>
|
|
170
|
+
<p :class="classes.classText"></p>
|
|
171
|
+
</Skeleton>\`
|
|
172
|
+
`
|
|
132
173
|
}
|
|
133
174
|
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import type { StorybookComponentsDescriptionItem } from '../../types/storybookTypes'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Descriptions for TextareaAutosize component
|
|
5
|
+
*
|
|
6
|
+
* Описания свойств компонента TextareaAutosize
|
|
7
|
+
*/
|
|
8
|
+
export const wikiDescriptionsTextareaAutosize: StorybookComponentsDescriptionItem = {
|
|
9
|
+
name: 'TextareaAutosize',
|
|
10
|
+
description: {
|
|
11
|
+
en: 'Textarea component that automatically adjusts its height based on content',
|
|
12
|
+
ru: 'Компонент текстового поля, которое автоматически подстраивает свою высоту под содержимое'
|
|
13
|
+
},
|
|
14
|
+
possibilities: {
|
|
15
|
+
en: [
|
|
16
|
+
'automatic height adjustment based on content',
|
|
17
|
+
'clone element for precise height calculation',
|
|
18
|
+
'respects padding and styling from the original textarea',
|
|
19
|
+
'smooth height transitions on content change',
|
|
20
|
+
'supports all standard textarea attributes via inputAttrs',
|
|
21
|
+
'optional autosize toggle for flexibility',
|
|
22
|
+
'reactive value binding with input event emission'
|
|
23
|
+
],
|
|
24
|
+
ru: [
|
|
25
|
+
'автоматическая подстройка высоты под содержимое',
|
|
26
|
+
'элемент-клон для точного расчёта высоты',
|
|
27
|
+
'учитывает отступы и стили исходного textarea',
|
|
28
|
+
'плавные переходы высоты при изменении содержимого',
|
|
29
|
+
'поддержка всех стандартных атрибутов textarea через inputAttrs',
|
|
30
|
+
'опциональное отключение autosize для гибкости',
|
|
31
|
+
'реактивная привязка значения с генерацией события input'
|
|
32
|
+
]
|
|
33
|
+
},
|
|
34
|
+
import: [],
|
|
35
|
+
render: `
|
|
36
|
+
<DesignComponent v-bind="args" :inputAttrs="{style: 'width: 240px; border: 1px solid #90A1B9FF'}" />
|
|
37
|
+
`,
|
|
38
|
+
stories: [],
|
|
39
|
+
documentation: {
|
|
40
|
+
body: `
|
|
41
|
+
<StorybookDescriptions componentName={'TextareaAutosize'} type={'textarea-autosize'}/>
|
|
42
|
+
`,
|
|
43
|
+
events: `
|
|
44
|
+
<StorybookDescriptions componentName={'Event'} type={'input-standard'}/>
|
|
45
|
+
`,
|
|
46
|
+
expose: `
|
|
47
|
+
<StorybookDescriptions componentName={'Expose'} type={'value'}/>
|
|
48
|
+
`
|
|
49
|
+
},
|
|
50
|
+
ai: {
|
|
51
|
+
description: `
|
|
52
|
+
**Note:** This is a subcomponent of \`Textarea\`. You should generally not use it directly.
|
|
53
|
+
It is automatically integrated into the \`Textarea\` component to provide auto-resizing capabilities.
|
|
54
|
+
|
|
55
|
+
TextareaAutosize is a functional component that renders a \`<textarea>\` element capable of automatically adjusting its height to fit the content.
|
|
56
|
+
|
|
57
|
+
**Key Features:**
|
|
58
|
+
1. **Auto-Resizing Logic:**
|
|
59
|
+
- It renders a hidden "clone" element (a \`div\`) that mirrors the styles (font, padding, border, width) of the actual textarea.
|
|
60
|
+
- As text is entered, the content is copied to the clone, and the clone's height is measured.
|
|
61
|
+
- The textarea's height is then updated to match the clone's height, ensuring no scrollbars appear and the field grows/shrinks dynamically.
|
|
62
|
+
|
|
63
|
+
2. **Input Attributes (\`inputAttrs\`):**
|
|
64
|
+
- Standard HTML attributes for the textarea (like \`placeholder\`, \`rows\`, \`disabled\`, \`readonly\`, \`style\`) should be passed via the \`inputAttrs\` prop.
|
|
65
|
+
- This ensures they are applied directly to the native \`<textarea>\` element.
|
|
66
|
+
|
|
67
|
+
3. **Value Management:**
|
|
68
|
+
- It manages the input value and emits updates, allowing for reactive data binding.
|
|
69
|
+
|
|
70
|
+
**When to use:**
|
|
71
|
+
- This component is designed to be the internal engine for the \`Textarea\` component.
|
|
72
|
+
- Use \`Textarea\` instead for a complete form field with labels, validation, and styling.
|
|
73
|
+
|
|
74
|
+
**Usage Examples:**
|
|
75
|
+
|
|
76
|
+
- **Internal Usage:**
|
|
77
|
+
\`<TextareaAutosize :value="modelValue" :inputAttrs="{ rows: 1 }" />\`
|
|
78
|
+
`
|
|
79
|
+
}
|
|
80
|
+
}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import type { StorybookComponentsDescriptionItem } from '../../types/storybookTypes'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Descriptions for Tooltip component properties
|
|
5
|
+
*
|
|
6
|
+
* Описания свойств компонента Tooltip
|
|
7
|
+
*/
|
|
8
|
+
export const wikiDescriptionsTooltip: StorybookComponentsDescriptionItem = {
|
|
9
|
+
name: 'Tooltip',
|
|
10
|
+
description: {
|
|
11
|
+
en: 'Component for displaying a popup hint when hovering over an element',
|
|
12
|
+
ru: 'Компонент для отображения всплывающей подсказки при наведении на элемент'
|
|
13
|
+
},
|
|
14
|
+
possibilities: {
|
|
15
|
+
en: [
|
|
16
|
+
'displaying text or other content in a popup window',
|
|
17
|
+
'automatic positioning relative to the element',
|
|
18
|
+
'support for delay before showing and hiding',
|
|
19
|
+
'customizable indentation and padding',
|
|
20
|
+
'ability to control the open state',
|
|
21
|
+
'support for an arrow pointing to the element'
|
|
22
|
+
],
|
|
23
|
+
ru: [
|
|
24
|
+
'отображение текста или другого контента во всплывающем окне',
|
|
25
|
+
'автоматическое позиционирование относительно элемента',
|
|
26
|
+
'поддержка задержки перед показом и скрытием',
|
|
27
|
+
'настраиваемые отступы и поля',
|
|
28
|
+
'возможность управления состоянием открытия',
|
|
29
|
+
'поддержка стрелки, указывающей на элемент'
|
|
30
|
+
]
|
|
31
|
+
},
|
|
32
|
+
import: [],
|
|
33
|
+
render: `
|
|
34
|
+
<DesignComponent v-bind="args">
|
|
35
|
+
<template #control="{ binds }">
|
|
36
|
+
<span v-bind="binds">
|
|
37
|
+
Hover me
|
|
38
|
+
</span>
|
|
39
|
+
</template>
|
|
40
|
+
</DesignComponent>
|
|
41
|
+
`,
|
|
42
|
+
stories: [
|
|
43
|
+
{
|
|
44
|
+
id: 'TooltipAllSlots',
|
|
45
|
+
name: {
|
|
46
|
+
en: 'All slots demonstration',
|
|
47
|
+
ru: 'Демонстрация всех слотов'
|
|
48
|
+
},
|
|
49
|
+
template: `
|
|
50
|
+
<DesignComponent>
|
|
51
|
+
<template #control="{ binds }">
|
|
52
|
+
<button class="wiki-storybook-button" v-bind="binds">
|
|
53
|
+
Hover me (All Slots)
|
|
54
|
+
</button>
|
|
55
|
+
</template>
|
|
56
|
+
|
|
57
|
+
<template #default>
|
|
58
|
+
Default Slot
|
|
59
|
+
</template>
|
|
60
|
+
|
|
61
|
+
<template #description>
|
|
62
|
+
Description Slot
|
|
63
|
+
</template>
|
|
64
|
+
|
|
65
|
+
<template #body>
|
|
66
|
+
<div class="wiki-storybook-item--padding">
|
|
67
|
+
Body Slot Content
|
|
68
|
+
</div>
|
|
69
|
+
</template>
|
|
70
|
+
</DesignComponent>
|
|
71
|
+
`
|
|
72
|
+
}
|
|
73
|
+
],
|
|
74
|
+
documentation: {
|
|
75
|
+
body: `
|
|
76
|
+
<StorybookDescriptions componentName={'Tooltip'} type={'tooltip'}/>
|
|
77
|
+
`,
|
|
78
|
+
events: `
|
|
79
|
+
<StorybookDescriptions componentName={'Tooltip'} type={'event.tooltip'}/>
|
|
80
|
+
`,
|
|
81
|
+
slots: `
|
|
82
|
+
<Canvas of={Component.TooltipAllSlots}/>
|
|
83
|
+
<StorybookDescriptions componentName={'Tooltip'} type={'slot.control'}/>
|
|
84
|
+
<StorybookDescriptions componentName={'Slot'} type={'default'}/>
|
|
85
|
+
<StorybookDescriptions componentName={'Slot'} type={'description'}/>
|
|
86
|
+
<StorybookDescriptions componentName={'Slot'} type={'body'}/>
|
|
87
|
+
`
|
|
88
|
+
},
|
|
89
|
+
ai: {
|
|
90
|
+
render: `
|
|
91
|
+
<div :class="classDemo.item">
|
|
92
|
+
<Tooltip open embedded v-bind="args">
|
|
93
|
+
<template #control="{ binds }">
|
|
94
|
+
<button v-bind="binds">Hover me</button>
|
|
95
|
+
</template>
|
|
96
|
+
</Tooltip>
|
|
97
|
+
</div>
|
|
98
|
+
`,
|
|
99
|
+
description: `
|
|
100
|
+
Tooltip is a floating component that displays contextual information when a user interacts with a trigger element (hover or focus).
|
|
101
|
+
It is designed to provide auxiliary descriptions, labels, or helper text.
|
|
102
|
+
|
|
103
|
+
**Key Features:**
|
|
104
|
+
1. **Trigger Integration:**
|
|
105
|
+
- Uses the \`#control\` slot to wrap the target element.
|
|
106
|
+
- Provides \`binds\` (events and ARIA attributes) that **must** be applied to the trigger element using \`v-bind="binds"\`.
|
|
107
|
+
|
|
108
|
+
2. **Content & Layout:**
|
|
109
|
+
- \`label\`: Primary text content.
|
|
110
|
+
- \`description\`: Secondary text content.
|
|
111
|
+
- \`#default\`: Slot for custom HTML content.
|
|
112
|
+
- Includes a built-in \`Arrow\` component pointing to the trigger.
|
|
113
|
+
|
|
114
|
+
3. **Behavior:**
|
|
115
|
+
- **Positioning:** Automatically calculates position (top, bottom, left, right) to stay within the viewport.
|
|
116
|
+
- **Timing:** Configurable \`delay\` (open) and \`delayHide\` (close).
|
|
117
|
+
- **Interaction:** Supports \`interactive\` mode (allows hovering the tooltip content) and \`disabled\` state.
|
|
118
|
+
|
|
119
|
+
**Usage Examples:**
|
|
120
|
+
|
|
121
|
+
- **Basic Label:**
|
|
122
|
+
\`<Tooltip label="Save changes">
|
|
123
|
+
<template #control="{ binds }">
|
|
124
|
+
<button v-bind="binds">Save</button>
|
|
125
|
+
</template>
|
|
126
|
+
</Tooltip>\`
|
|
127
|
+
|
|
128
|
+
- **With Description:**
|
|
129
|
+
\`<Tooltip label="User Profile" description="Click to edit settings">
|
|
130
|
+
<template #control="{ binds }">
|
|
131
|
+
<Avatar v-bind="binds" />
|
|
132
|
+
</template>
|
|
133
|
+
</Tooltip>\`
|
|
134
|
+
`
|
|
135
|
+
}
|
|
136
|
+
}
|