@topvisor/ui 0.0.34 → 0.0.35
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/.storybook/TopTheme.js +82 -0
- package/.storybook/TopThemeManager.js +44 -0
- package/.storybook/main.ts +43 -0
- package/.storybook/manager.ts +28 -0
- package/.storybook/preview-head.html +16 -0
- package/.storybook/preview.ts +48 -0
- package/.storybook/vue/coreDecorator.ts +19 -0
- package/.storybook/vue/vModelDecorator.ts +27 -0
- package/.vscode/extensions.json +11 -0
- package/.vscode/keybindings.example.json +121 -0
- package/.vscode/settings.json +46 -0
- package/Dockerfile +3 -0
- package/NPM.md +25 -0
- package/PUBLISH.md +18 -0
- package/README.md +19 -52
- package/STORYBOOK.md +27 -0
- package/USE_IN_PROJECT.md +29 -0
- package/build/afterBuild.sh +12 -0
- package/build/cssModules.ts +39 -0
- package/build/plugin/amdFix.ts +46 -0
- package/build/rollup.config.ts +18 -0
- package/nbproject/project.properties +11 -0
- package/nbproject/project.xml +9 -0
- package/package.json +68 -19
- package/public/README.md +63 -0
- package/src/components/common/common.ts +1 -0
- package/src/components/common/icon/icon.ts +4 -0
- package/src/components/common/icon/icon.vue +15 -0
- package/src/components/component.ts +133 -0
- package/src/components/forms/button/button.stories.ts +112 -0
- package/src/components/forms/button/button.ts +51 -0
- package/src/components/forms/button/button.vue +75 -0
- package/src/components/forms/button/stories/README.md +35 -0
- package/src/components/forms/button/stories/overview.vue +33 -0
- package/src/components/forms/button/style/button.css +124 -0
- package/src/components/forms/button/style/style-outline.css +42 -0
- package/src/components/forms/button/style/style-soft.css +31 -0
- package/src/components/forms/button/style/style-transparent.css +35 -0
- package/src/components/forms/checkbox/checkbox.stories.ts +33 -0
- package/src/components/forms/checkbox/checkbox.ts +23 -0
- package/src/components/forms/checkbox/checkbox.vue +135 -0
- package/src/components/forms/checkbox/stories/overview.vue +171 -0
- package/src/components/forms/controlLabel/controlLabel.stories.ts +38 -0
- package/src/components/forms/controlLabel/controlLabel.ts +4 -0
- package/src/components/forms/controlLabel/controlLabel.vue +48 -0
- package/src/components/forms/forms.ts +10 -0
- package/src/components/forms/helpers.ts +10 -0
- package/src/components/forms/hint/hint.stories.ts +46 -0
- package/src/components/forms/hint/hint.ts +8 -0
- package/src/components/forms/hint/hint.vue +32 -0
- package/src/components/forms/input/input.stories.ts +31 -0
- package/src/components/forms/input/input.ts +34 -0
- package/src/components/forms/input/input.vue +170 -0
- package/src/components/forms/input/stories/overview.vue +61 -0
- package/src/components/forms/inputDate/datepicker.css +233 -0
- package/src/components/forms/inputDate/datepicker.ts +101 -0
- package/src/components/forms/inputDate/inputDate.stories.ts +41 -0
- package/src/components/forms/inputDate/inputDate.ts +4 -0
- package/src/components/forms/inputDate/inputDate.vue +127 -0
- package/src/components/forms/inputDate/stories/overview.vue +35 -0
- package/src/components/forms/radio/radio.stories.ts +34 -0
- package/src/components/forms/radio/radio.ts +15 -0
- package/src/components/forms/radio/radio.vue +107 -0
- package/src/components/forms/radio/stories/overview.vue +79 -0
- package/src/components/forms/select/select.stories.ts +34 -0
- package/src/components/forms/select/select.ts +36 -0
- package/src/components/forms/select/select.vue +253 -0
- package/src/components/forms/select/stories/exampleOptions.ts +71 -0
- package/src/components/forms/select/stories/overview.vue +60 -0
- package/src/components/forms/switcher/stories/overview.vue +139 -0
- package/src/components/forms/switcher/switcher.stories.ts +33 -0
- package/src/components/forms/switcher/switcher.ts +22 -0
- package/src/components/forms/switcher/switcher.vue +113 -0
- package/src/components/forms/textarea/stories/overview.vue +62 -0
- package/src/components/forms/textarea/textarea.stories.ts +33 -0
- package/src/components/forms/textarea/textarea.ts +38 -0
- package/src/components/forms/textarea/textarea.vue +119 -0
- package/src/components/formsExt/editArea/editArea.stories.ts +72 -0
- package/src/components/formsExt/editArea/editArea.ts +25 -0
- package/src/components/formsExt/editArea/editArea.vue +172 -0
- package/src/components/formsExt/editArea/stories/README.md +17 -0
- package/src/components/formsExt/editArea/stories/overview.vue +66 -0
- package/src/components/formsExt/editInput/editInput.stories.ts +36 -0
- package/src/components/formsExt/editInput/editInput.ts +20 -0
- package/src/components/formsExt/editInput/editInput.vue +57 -0
- package/src/components/formsExt/editInput/stories/overview.vue +54 -0
- package/src/components/formsExt/formsExt.ts +3 -0
- package/src/components/formsExt/radioGroup/radioGroup.stories.ts +51 -0
- package/src/components/formsExt/radioGroup/radioGroup.ts +28 -0
- package/src/components/formsExt/radioGroup/radioGroup.vue +143 -0
- package/src/components/formsExt/radioGroup/stories/overview.vue +78 -0
- package/src/components/formsExt/radioGroup/styles/top-scrollBar.css +52 -0
- package/src/components/helper.js +10 -0
- package/src/components/helpersStories.ts +151 -0
- package/src/components/popup/lib/popup.globalEvents.js +205 -0
- package/src/components/popup/lib/popup.js +702 -0
- package/src/components/popup/lib/worker.globalEvents.js +78 -0
- package/src/components/popup/lib/worker.js +232 -0
- package/src/components/popup/popup/listItem.vue +42 -0
- package/src/components/popup/popup/opener.vue +74 -0
- package/src/components/popup/popup/popup.stories.ts +68 -0
- package/src/components/popup/popup/popup.ts +93 -0
- package/src/components/popup/popup/popup.vue +95 -0
- package/src/components/popup/popup/stories/README.md +34 -0
- package/src/components/popup/popup/stories/listItems.vue +44 -0
- package/src/components/popup/popup/stories/listSubItems.vue +52 -0
- package/src/components/popup/popup/stories/overview.vue +208 -0
- package/src/components/popup/popup/style/popup.css +243 -0
- package/src/components/popup/popup/style/popup.m.css +71 -0
- package/src/components/popup/popup/style/popup.pc.css +28 -0
- package/src/components/popup/popup.ts +3 -0
- package/src/components/popup/worker.ts +1 -0
- package/src/components/tabs/tabs/content.vue +24 -0
- package/src/components/tabs/tabs/stories/README.md +10 -0
- package/src/components/tabs/tabs/tab.vue +52 -0
- package/src/components/tabs/tabs/tabs.stories.ts +171 -0
- package/src/components/tabs/tabs/tabs.ts +22 -0
- package/src/components/tabs/tabs/tabs.vue +64 -0
- package/src/components/tabs/tabs.ts +3 -0
- package/src/core/base/Colors.stories.ts +15 -0
- package/src/core/base/Layout.stories.ts +15 -0
- package/src/core/base/Properties.stories.ts +15 -0
- package/src/core/base/base.mdx +21 -0
- package/src/core/core/core.ts +144 -0
- package/src/core/core/events.ts +54 -0
- package/src/core/core/options.ts +15 -0
- package/src/core/core/state.ts +44 -0
- package/src/core/directives/tooltip.ts +55 -0
- package/src/core/theme/Colors.stories.ts +15 -0
- package/src/core/theme/Properties.stories.ts +15 -0
- package/src/core/theme/theme.mdx +15 -0
- package/src/core/utils/date.ts +164 -0
- package/src/core/utils/device.ts +48 -0
- package/src/core/utils/dom.ts +185 -0
- package/src/core//320/235/320/260/320/261/320/276/321/200 /320/270/320/272/320/276/320/275/320/276/320/272/gallery.vue" +72 -0
- package/src/core//320/235/320/260/320/261/320/276/321/200 /320/270/320/272/320/276/320/275/320/276/320/272//320/235/320/260/320/261/320/276/321/200 /320/270/320/272/320/276/320/275/320/276/320/272.mdx" +31 -0
- package/src/core//320/235/320/260/320/261/320/276/321/200 /320/270/320/272/320/276/320/275/320/276/320/272//320/235/320/260/320/261/320/276/321/200 /320/270/320/272/320/276/320/275/320/276/320/272.stories.ts" +14 -0
- package/src/docs/CSS/FAQ.mdx +43 -0
- package/src/docs/CSS//320/236/320/261/321/211/320/270/320/265 /320/274/320/276/320/264/320/270/321/204/320/270/320/272/320/260/321/202/320/276/321/200/321/213.mdx" +156 -0
- package/src/docs/CSS//320/237/320/265/321/200/320/265/320/274/320/265/320/275/320/275/321/213/320/265.mdx +47 -0
- package/src/docs/CSS//320/237/321/200/320/265/320/264/320/277/321/200/320/276/321/206/320/265/321/201/321/201/320/276/321/200/321/213.mdx +15 -0
- package/src/docs/CSS//320/240/320/265/320/272/320/276/320/274/320/265/320/275/320/264/320/260/321/206/320/270/320/270 /320/221/320/255/320/234.mdx" +49 -0
- package/src/docs/CSS//320/241/321/202/320/270/320/273/320/270.md +53 -0
- package/src/docs/CSS//320/241/321/202/320/270/320/273/320/270.mdx +4 -0
- package/src/docs/CSS//320/247/321/202/320/276 /321/202/320/260/320/272/320/276/320/265 css /320/274/320/276/320/264/321/203/320/273/321/214.mdx" +53 -0
- package/src/docs/ROADMAP.md +17 -0
- package/src/docs/Roadmap.mdx +4 -0
- package/src/docs//320/222/320/262/320/265/320/264/320/265/320/275/320/270/320/265 /320/262 Storybook.mdx" +323 -0
- package/src/docs//320/232/320/276/320/274/320/277/320/276/320/275/320/265/320/275/321/202/321/213.mdx +20 -0
- package/src/docs//320/237/320/276/320/273/320/265/320/267/320/275/320/260/321/217 /320/270/320/275/321/204/320/276/321/200/320/274/320/260/321/206/320/270/321/217.mdx" +8 -0
- package/src/docs//320/241/321/202/320/260/320/275/320/264/320/260/321/200/321/202/321/213 /320/272/320/276/320/264/320/260/IDE.mdx" +42 -0
- package/src/docs//320/241/321/202/320/260/320/275/320/264/320/260/321/200/321/202/321/213 /320/272/320/276/320/264/320/260//320/233/320/270/320/275/321/202/320/265/321/200.mdx" +72 -0
- package/src/docs//320/241/321/202/320/260/320/275/320/264/320/260/321/200/321/202/321/213 /320/272/320/276/320/264/320/260//320/241/321/202/320/260/320/275/320/264/320/260/321/200/321/202/321/213 /320/272/320/276/320/264/320/260.mdx" +29 -0
- package/src/globals.d.ts +1 -0
- package/{icomoon → src/resources/icomoon}/demo-files/demo.css +161 -161
- package/{icomoon → src/resources/icomoon}/demo-files/demo.js +30 -30
- package/{icomoon → src/resources/icomoon}/demo.html +2945 -2945
- package/{icomoon → src/resources/icomoon}/fonts/Topvisor-2.svg +232 -232
- package/{icomoon → src/resources/icomoon}/style.css +647 -647
- package/src/resources/styles/core/colors.css +204 -0
- package/src/resources/styles/core/components.css +70 -0
- package/src/resources/styles/core/core.ts +10 -0
- package/src/resources/styles/core/forms/clear.css +19 -0
- package/src/resources/styles/core/forms/controls.css +20 -0
- package/src/resources/styles/core/forms/focusable.css +26 -0
- package/src/resources/styles/core/forms/forms.css +100 -0
- package/src/resources/styles/core/icon.css +58 -0
- package/src/resources/styles/core/layout.css +40 -0
- package/src/resources/styles/core/modifiers/as.css +9 -0
- package/src/resources/styles/core/modifiers/ellipsis.css +18 -0
- package/src/resources/styles/core/modifiers/modifiers.css +81 -0
- package/src/resources/styles/core/modifiers/only.css +19 -0
- package/src/resources/styles/core/select.css +16 -0
- package/src/resources/styles/jquery-ui.min.css +6 -0
- package/src/resources/styles/storybook.css +11 -0
- package/src/resources/styles/themes/dark/theme.css +139 -0
- package/src/resources/styles/themes/dark.ts +1 -0
- package/src/resources/styles/themes/light/theme.css +139 -0
- package/src/resources/styles/themes/light.ts +1 -0
- package/src/storybook/components/color.vue +45 -0
- package/src/storybook/components/colors.vue +34 -0
- package/src/storybook/components/icomoon.ts +38 -0
- package/src/storybook/components/properties.vue +82 -0
- package/src/storybook/resources/accessibility.png +0 -0
- package/src/storybook/resources/accessibility.svg +5 -0
- package/src/storybook/resources/addon-library.png +0 -0
- package/src/storybook/resources/assets.png +0 -0
- package/src/storybook/resources/context.png +0 -0
- package/src/storybook/resources/discord.svg +15 -0
- package/src/storybook/resources/docs.png +0 -0
- package/src/storybook/resources/figma-plugin.png +0 -0
- package/src/storybook/resources/github.svg +3 -0
- package/src/storybook/resources/share.png +0 -0
- package/src/storybook/resources/styling.png +0 -0
- package/src/storybook/resources/testing.png +0 -0
- package/src/storybook/resources/theming.png +0 -0
- package/src/storybook/resources/tutorials.svg +12 -0
- package/src/storybook/resources/youtube.svg +4 -0
- package/src//320/224/320/276/320/261/321/200/320/276 /320/277/320/276/320/266/320/260/320/273/320/276/320/262/320/260/321/202/321/214.mdx" +3 -0
- package/tsconfig.json +62 -0
- package/vite.config.ts +91 -0
- package/.chunks/datepicker-0b648b9f.es.js +0 -275
- package/.chunks/datepicker-0b648b9f.es.js.map +0 -1
- package/.chunks/datepicker-0e9a0541.amd.js +0 -234
- package/.chunks/datepicker-0e9a0541.amd.js.map +0 -1
- package/.chunks/forms-02202302.amd.js +0 -3
- package/.chunks/forms-02202302.amd.js.map +0 -1
- package/.chunks/forms-eb00d0c1.es.js +0 -946
- package/.chunks/forms-eb00d0c1.es.js.map +0 -1
- package/.chunks/popup-6f73b4b2.es.js +0 -700
- package/.chunks/popup-6f73b4b2.es.js.map +0 -1
- package/.chunks/popup-e1f34511.amd.js +0 -341
- package/.chunks/popup-e1f34511.amd.js.map +0 -1
- package/common/common.amd.js +0 -2
- package/common/common.amd.js.map +0 -1
- package/common/common.js +0 -2
- package/common/common.js.map +0 -1
- package/core/core.amd.js +0 -2
- package/core/core.amd.js.map +0 -1
- package/core/core.js +0 -6
- package/core/core.js.map +0 -1
- package/core.css +0 -1
- package/dark.css +0 -1
- package/forms/forms.amd.js +0 -2
- package/forms/forms.amd.js.map +0 -1
- package/forms/forms.js +0 -15
- package/forms/forms.js.map +0 -1
- package/forms/helpers.amd.js +0 -2
- package/forms/helpers.amd.js.map +0 -1
- package/forms/helpers.js +0 -9
- package/forms/helpers.js.map +0 -1
- package/forms.css +0 -1
- package/formsExt/formsExt.amd.js +0 -3
- package/formsExt/formsExt.amd.js.map +0 -1
- package/formsExt/formsExt.js +0 -152
- package/formsExt/formsExt.js.map +0 -1
- package/formsExt.css +0 -1
- package/light.css +0 -1
- package/popup/popup.amd.js +0 -3
- package/popup/popup.amd.js.map +0 -1
- package/popup/popup.js +0 -144
- package/popup/popup.js.map +0 -1
- package/popup/worker.amd.js +0 -2
- package/popup/worker.amd.js.map +0 -1
- package/popup/worker.js +0 -154
- package/popup/worker.js.map +0 -1
- package/popup.css +0 -1
- package/tabs/tabs.amd.js +0 -3
- package/tabs/tabs.amd.js.map +0 -1
- package/tabs/tabs.js +0 -97
- package/tabs/tabs.js.map +0 -1
- package/tabs.css +0 -1
- package/utils/date.amd.js +0 -2
- package/utils/date.amd.js.map +0 -1
- package/utils/date.js +0 -6
- package/utils/date.js.map +0 -1
- package/utils/device.amd.js +0 -2
- package/utils/device.amd.js.map +0 -1
- package/utils/device.js +0 -6
- package/utils/device.js.map +0 -1
- package/utils/dom.amd.js +0 -2
- package/utils/dom.amd.js.map +0 -1
- package/utils/dom.js +0 -64
- package/utils/dom.js.map +0 -1
- /package/{icomoon → src/resources/icomoon}/fonts/Topvisor-2.ttf +0 -0
- /package/{icomoon → src/resources/icomoon}/fonts/Topvisor-2.woff +0 -0
- /package/{icomoon → src/resources/icomoon}/selection.json +0 -0
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { ref } from 'vue';
|
|
3
|
+
import type { Props } from '../checkbox';
|
|
4
|
+
import Checkbox from '../checkbox.vue';
|
|
5
|
+
|
|
6
|
+
defineProps<Props>();
|
|
7
|
+
|
|
8
|
+
const checkbox1 = ref(false);
|
|
9
|
+
const checkbox2 = ref([]);
|
|
10
|
+
const checkbox3 = ref(new Set<string>());
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<template>
|
|
14
|
+
<div>
|
|
15
|
+
<h2>Чекбокс:</h2>
|
|
16
|
+
|
|
17
|
+
<Checkbox
|
|
18
|
+
:="$props"
|
|
19
|
+
:indeterminate="false"
|
|
20
|
+
:disabled="false"
|
|
21
|
+
>
|
|
22
|
+
Чекбокс
|
|
23
|
+
</Checkbox>
|
|
24
|
+
|
|
25
|
+
<Checkbox
|
|
26
|
+
:="$props"
|
|
27
|
+
:modelValue="true"
|
|
28
|
+
:indeterminate="false"
|
|
29
|
+
:disabled="false"
|
|
30
|
+
>
|
|
31
|
+
Чекбокс
|
|
32
|
+
</Checkbox>
|
|
33
|
+
|
|
34
|
+
<Checkbox
|
|
35
|
+
:="$props"
|
|
36
|
+
:indeterminate="true"
|
|
37
|
+
:disabled="false"
|
|
38
|
+
>
|
|
39
|
+
Чекбокс
|
|
40
|
+
</Checkbox>
|
|
41
|
+
|
|
42
|
+
<h2>Чекбокс disabled:</h2>
|
|
43
|
+
|
|
44
|
+
<Checkbox
|
|
45
|
+
:="$props"
|
|
46
|
+
:indeterminate="false"
|
|
47
|
+
:disabled="true"
|
|
48
|
+
>
|
|
49
|
+
Чекбокс
|
|
50
|
+
</Checkbox>
|
|
51
|
+
|
|
52
|
+
<Checkbox
|
|
53
|
+
:="$props"
|
|
54
|
+
:modelValue="true"
|
|
55
|
+
:indeterminate="false"
|
|
56
|
+
:disabled="true"
|
|
57
|
+
>
|
|
58
|
+
Чекбокс
|
|
59
|
+
</Checkbox>
|
|
60
|
+
|
|
61
|
+
<Checkbox
|
|
62
|
+
:="$props"
|
|
63
|
+
:indeterminate="true"
|
|
64
|
+
:disabled="true"
|
|
65
|
+
>
|
|
66
|
+
Чекбокс
|
|
67
|
+
</Checkbox>
|
|
68
|
+
|
|
69
|
+
<h2>Чекбокс с описанием:</h2>
|
|
70
|
+
|
|
71
|
+
<Checkbox
|
|
72
|
+
:="$props"
|
|
73
|
+
:indeterminate="false"
|
|
74
|
+
description="Перед вам потрясающий чекбокс"
|
|
75
|
+
>
|
|
76
|
+
Чекбокс
|
|
77
|
+
</Checkbox>
|
|
78
|
+
|
|
79
|
+
<Checkbox
|
|
80
|
+
:="$props"
|
|
81
|
+
:modelValue="true"
|
|
82
|
+
:indeterminate="false"
|
|
83
|
+
description="А этот чекбокс уже отмечен"
|
|
84
|
+
>
|
|
85
|
+
Чекбокс
|
|
86
|
+
</Checkbox>
|
|
87
|
+
|
|
88
|
+
<Checkbox
|
|
89
|
+
:="$props"
|
|
90
|
+
:indeterminate="true"
|
|
91
|
+
description="indeterminate - неопределенное состояние"
|
|
92
|
+
>
|
|
93
|
+
Чекбокс
|
|
94
|
+
</Checkbox>
|
|
95
|
+
|
|
96
|
+
<h2>Поддерижваемые типы v-model</h2>
|
|
97
|
+
|
|
98
|
+
<h3>boolean</h3>
|
|
99
|
+
|
|
100
|
+
<p>
|
|
101
|
+
<b>Ваш выбор:</b> {{ checkbox1 }}
|
|
102
|
+
</p>
|
|
103
|
+
|
|
104
|
+
<Checkbox
|
|
105
|
+
:="$props"
|
|
106
|
+
v-model="checkbox1"
|
|
107
|
+
/>
|
|
108
|
+
|
|
109
|
+
<h3>string[]</h3>
|
|
110
|
+
|
|
111
|
+
<p>
|
|
112
|
+
<b>Ваш выбор:</b> {{ checkbox2 }}
|
|
113
|
+
</p>
|
|
114
|
+
|
|
115
|
+
<Checkbox
|
|
116
|
+
:="$props"
|
|
117
|
+
value="Яблоко"
|
|
118
|
+
v-model="checkbox2"
|
|
119
|
+
>
|
|
120
|
+
Яблоко
|
|
121
|
+
</Checkbox>
|
|
122
|
+
|
|
123
|
+
<Checkbox
|
|
124
|
+
:="$props"
|
|
125
|
+
value="Груша"
|
|
126
|
+
v-model="checkbox2"
|
|
127
|
+
>
|
|
128
|
+
Груша
|
|
129
|
+
</Checkbox>
|
|
130
|
+
|
|
131
|
+
<Checkbox
|
|
132
|
+
:="$props"
|
|
133
|
+
value="Банан"
|
|
134
|
+
v-model="checkbox2"
|
|
135
|
+
indeterminate
|
|
136
|
+
>
|
|
137
|
+
Банан
|
|
138
|
+
</Checkbox>
|
|
139
|
+
|
|
140
|
+
<h3>Set[]</h3>
|
|
141
|
+
|
|
142
|
+
<p>
|
|
143
|
+
<b>Ваш выбор:</b> {{ checkbox3 }}
|
|
144
|
+
</p>
|
|
145
|
+
|
|
146
|
+
<Checkbox
|
|
147
|
+
:="$props"
|
|
148
|
+
value="Яблоко"
|
|
149
|
+
v-model="checkbox3"
|
|
150
|
+
>
|
|
151
|
+
Яблоко
|
|
152
|
+
</Checkbox>
|
|
153
|
+
|
|
154
|
+
<Checkbox
|
|
155
|
+
:="$props"
|
|
156
|
+
value="Груша"
|
|
157
|
+
v-model="checkbox3"
|
|
158
|
+
>
|
|
159
|
+
Груша
|
|
160
|
+
</Checkbox>
|
|
161
|
+
|
|
162
|
+
<Checkbox
|
|
163
|
+
:="$props"
|
|
164
|
+
value="Банан"
|
|
165
|
+
v-model="checkbox3"
|
|
166
|
+
indeterminate
|
|
167
|
+
>
|
|
168
|
+
Банан
|
|
169
|
+
</Checkbox>
|
|
170
|
+
</div>
|
|
171
|
+
</template>
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/vue3';
|
|
2
|
+
|
|
3
|
+
import { genArgsTypes } from '@/components/helpersStories';
|
|
4
|
+
import Component from './controlLabel.vue';
|
|
5
|
+
import * as ComponentsConst from './controlLabel';
|
|
6
|
+
|
|
7
|
+
const argTypes = genArgsTypes(Component, ComponentsConst);
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Компонент для вставки заголовка с описанием к элементу управления формы.
|
|
11
|
+
*
|
|
12
|
+
* Элементы управления:
|
|
13
|
+
* - checkbox
|
|
14
|
+
* - radio
|
|
15
|
+
* - switcher
|
|
16
|
+
*/
|
|
17
|
+
const meta = {
|
|
18
|
+
component: Component,
|
|
19
|
+
tags: ['autodocs'],
|
|
20
|
+
argTypes,
|
|
21
|
+
} satisfies Meta<typeof Component>;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* test 2
|
|
25
|
+
*/
|
|
26
|
+
type Story = StoryObj<typeof meta>;
|
|
27
|
+
|
|
28
|
+
export const Playground = {
|
|
29
|
+
args: {
|
|
30
|
+
title: 'Заголовок',
|
|
31
|
+
description: 'Комментарий',
|
|
32
|
+
}
|
|
33
|
+
} satisfies Story;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* test 3
|
|
37
|
+
*/
|
|
38
|
+
export default meta;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { Props } from './controlLabel';
|
|
3
|
+
|
|
4
|
+
defineProps<Props>();
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<template>
|
|
8
|
+
<div class="top-forms-optionLabel">
|
|
9
|
+
<div
|
|
10
|
+
:class="{
|
|
11
|
+
'top-forms-optionLabel_title': true,
|
|
12
|
+
'top-forms-optionLabel_title-disabled': disabled,
|
|
13
|
+
}"
|
|
14
|
+
>
|
|
15
|
+
<!-- @slot Слот с заголовком -->
|
|
16
|
+
<slot></slot>
|
|
17
|
+
</div>
|
|
18
|
+
|
|
19
|
+
<div
|
|
20
|
+
v-if="description"
|
|
21
|
+
class="top-forms-optionLabel_description"
|
|
22
|
+
>
|
|
23
|
+
{{ description }}
|
|
24
|
+
</div>
|
|
25
|
+
</div>
|
|
26
|
+
</template>
|
|
27
|
+
|
|
28
|
+
<style module>
|
|
29
|
+
.top-forms-optionLabel {
|
|
30
|
+
flex-grow: 1;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.top-forms-optionLabel_title {
|
|
34
|
+
min-height: var(--top-forms-option-height);
|
|
35
|
+
display: flex;
|
|
36
|
+
align-items: center;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.top-forms-optionLabel_title-disabled {
|
|
40
|
+
color: var(--color-text-3);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.top-forms-optionLabel_description {
|
|
44
|
+
color: var(--color-text-3);
|
|
45
|
+
font-size: 0.85em;
|
|
46
|
+
line-height: var(--top-forms-option-height);
|
|
47
|
+
}
|
|
48
|
+
</style>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { default as Button } from './button/button.vue'
|
|
2
|
+
export { default as Checkbox } from './checkbox/checkbox.vue'
|
|
3
|
+
export { default as ControlLabel } from './controlLabel/controlLabel.vue'
|
|
4
|
+
export { default as Hint } from './hint/hint.vue'
|
|
5
|
+
export { default as Input } from './input/input.vue'
|
|
6
|
+
export { default as InputDate } from './inputDate/inputDate.vue'
|
|
7
|
+
export { default as Radio } from './radio/radio.vue'
|
|
8
|
+
export { default as Switcher } from './switcher/switcher.vue'
|
|
9
|
+
export { default as Textarea } from './textarea/textarea.vue'
|
|
10
|
+
export { default as Select } from './select/select.vue'
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/vue3';
|
|
2
|
+
|
|
3
|
+
import { genArgsTypes, genOverviewStory } from '@/components/helpersStories';
|
|
4
|
+
import Component from './hint.vue';
|
|
5
|
+
import * as ComponentsConst from './hint';
|
|
6
|
+
import TabsTab from '@/components/tabs/tabs/tab.vue';
|
|
7
|
+
import TabsContent from '@/components/tabs/tabs/content.vue';
|
|
8
|
+
import Button from '@/components/forms/button/button.vue';
|
|
9
|
+
import Textarea from '@/components/forms/textarea/textarea.vue';
|
|
10
|
+
import Hint from '@/components/forms/hint/hint.vue';
|
|
11
|
+
|
|
12
|
+
const argTypes = genArgsTypes(Component, ComponentsConst);
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Компонент для вывода иконки с подсказкой
|
|
16
|
+
*
|
|
17
|
+
* Для настройки tooltip см. директиву v-top-tooltip
|
|
18
|
+
*/
|
|
19
|
+
const meta = {
|
|
20
|
+
component: Component,
|
|
21
|
+
tags: ['autodocs'],
|
|
22
|
+
args: {
|
|
23
|
+
hint: 'Текст подсказки',
|
|
24
|
+
},
|
|
25
|
+
argTypes,
|
|
26
|
+
} satisfies Meta<typeof Component>;
|
|
27
|
+
|
|
28
|
+
type Story = StoryObj<typeof meta>;
|
|
29
|
+
|
|
30
|
+
export const Playground = {} satisfies Story;
|
|
31
|
+
|
|
32
|
+
export const Tooltip = {
|
|
33
|
+
render: (args) => ({
|
|
34
|
+
components: {
|
|
35
|
+
Hint: Component,
|
|
36
|
+
},
|
|
37
|
+
setup() {
|
|
38
|
+
return { args };
|
|
39
|
+
},
|
|
40
|
+
template: `
|
|
41
|
+
<Hint :hint="args.hint" v-top-tooltip></Hint>
|
|
42
|
+
`,
|
|
43
|
+
}),
|
|
44
|
+
} satisfies Story;
|
|
45
|
+
|
|
46
|
+
export default meta;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { Props } from './hint';
|
|
3
|
+
|
|
4
|
+
const props = defineProps<Props>();
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<template>
|
|
8
|
+
<span
|
|
9
|
+
class="top-hint"
|
|
10
|
+
data-top-icon=""
|
|
11
|
+
:title="hint"
|
|
12
|
+
></span>
|
|
13
|
+
</template>
|
|
14
|
+
|
|
15
|
+
<style module>
|
|
16
|
+
.top-hint {
|
|
17
|
+
--top-icon-size: 16px;
|
|
18
|
+
--top-icon-width: var(--top-icon-size);
|
|
19
|
+
|
|
20
|
+
border-radius: 50%;
|
|
21
|
+
background: var(--content-background-color);
|
|
22
|
+
padding: 1px;
|
|
23
|
+
color: var(--color-text-4);
|
|
24
|
+
line-height: 1;
|
|
25
|
+
z-index: 1;
|
|
26
|
+
pointer-events: all;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.top-hint:hover {
|
|
30
|
+
color: var(--color-text-3);
|
|
31
|
+
}
|
|
32
|
+
</style>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/vue3';
|
|
2
|
+
|
|
3
|
+
import { genArgsTypes, genOverviewStory } from '@/components/helpersStories';
|
|
4
|
+
import Component from './input.vue';
|
|
5
|
+
import * as ComponentsConst from './input';
|
|
6
|
+
import OverviewComponent from './stories/overview.vue';
|
|
7
|
+
|
|
8
|
+
const argTypes = genArgsTypes(Component, ComponentsConst, true);
|
|
9
|
+
|
|
10
|
+
const meta = {
|
|
11
|
+
component: Component,
|
|
12
|
+
tags: ['autodocs'],
|
|
13
|
+
argTypes,
|
|
14
|
+
args: {
|
|
15
|
+
modelValue: '',
|
|
16
|
+
},
|
|
17
|
+
} satisfies Meta<typeof Component>;
|
|
18
|
+
|
|
19
|
+
type Story = StoryObj<typeof meta>;
|
|
20
|
+
|
|
21
|
+
export const Playground = {} satisfies Story;
|
|
22
|
+
|
|
23
|
+
export const Overview: Story = genOverviewStory({
|
|
24
|
+
args: {
|
|
25
|
+
title: 'Заголовок поля',
|
|
26
|
+
captionType: '',
|
|
27
|
+
isError: false,
|
|
28
|
+
},
|
|
29
|
+
}, OverviewComponent);
|
|
30
|
+
|
|
31
|
+
export default meta;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { Size } from '@/components/forms/helpers';
|
|
2
|
+
import { sizes } from '@/components/forms/helpers';
|
|
3
|
+
|
|
4
|
+
export interface Props {
|
|
5
|
+
modelValue: string;
|
|
6
|
+
|
|
7
|
+
name?: string;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
readonly?: boolean;
|
|
10
|
+
|
|
11
|
+
title?: string;
|
|
12
|
+
captionType?: CaptionType;
|
|
13
|
+
|
|
14
|
+
size?: Size;
|
|
15
|
+
icon?: string;
|
|
16
|
+
icon2?: string;
|
|
17
|
+
addCleaner?: boolean;
|
|
18
|
+
isError?: boolean;
|
|
19
|
+
modificator?: string;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface Emits {
|
|
23
|
+
(e: 'update:modelValue', value: string): void;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export const captionTypes = {
|
|
27
|
+
none: '',
|
|
28
|
+
slide: 'slide',
|
|
29
|
+
top: 'top',
|
|
30
|
+
} as const;
|
|
31
|
+
|
|
32
|
+
export type CaptionType = typeof captionTypes[keyof typeof captionTypes];
|
|
33
|
+
|
|
34
|
+
export { sizes };
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed } from 'vue';
|
|
3
|
+
import type { Props, Emits } from './input';
|
|
4
|
+
|
|
5
|
+
defineOptions({
|
|
6
|
+
inheritAttrs: false,
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
10
|
+
size: 's',
|
|
11
|
+
captionType: '',
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
const emit = defineEmits<Emits>();
|
|
15
|
+
|
|
16
|
+
const localValue = computed({
|
|
17
|
+
get() {
|
|
18
|
+
return props.modelValue;
|
|
19
|
+
},
|
|
20
|
+
set(value) {
|
|
21
|
+
emit('update:modelValue', value);
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
const placeholder = computed(() => {
|
|
26
|
+
if (props.addCleaner && !props.title) {
|
|
27
|
+
return '';
|
|
28
|
+
}
|
|
29
|
+
if (props.captionType !== '') {
|
|
30
|
+
return '';
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return props.title;
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
const clean = () => {
|
|
37
|
+
emit('update:modelValue', '');
|
|
38
|
+
};
|
|
39
|
+
</script>
|
|
40
|
+
|
|
41
|
+
<template>
|
|
42
|
+
<label
|
|
43
|
+
:class="{
|
|
44
|
+
['top-input']: true,
|
|
45
|
+
['top-size_' + size]: true,
|
|
46
|
+
['top-disabled']: disabled,
|
|
47
|
+
['top-input-' + modificator]: !!modificator,
|
|
48
|
+
['top-input-withCleaner']: addCleaner && localValue && localValue !== '0000-00-00',
|
|
49
|
+
['top-formsCaptionWrapper']: captionType !== '',
|
|
50
|
+
['top-formsCaptionWrapper-always']: captionType === 'top',
|
|
51
|
+
}"
|
|
52
|
+
:data-top-icon="icon"
|
|
53
|
+
:data-top-icon2="icon2"
|
|
54
|
+
>
|
|
55
|
+
<input
|
|
56
|
+
type="text"
|
|
57
|
+
:class="{
|
|
58
|
+
['top-input_input']: true,
|
|
59
|
+
['top-input_input-' + modificator]: !!modificator,
|
|
60
|
+
['top-forms-focusable']: !disabled,
|
|
61
|
+
['top-error']: isError,
|
|
62
|
+
}"
|
|
63
|
+
autocomplete="off_always"
|
|
64
|
+
:name="name"
|
|
65
|
+
v-model="localValue"
|
|
66
|
+
:title="title"
|
|
67
|
+
:placeholder="placeholder"
|
|
68
|
+
:disabled="disabled"
|
|
69
|
+
:readonly="readonly"
|
|
70
|
+
@keydown.esc.stop="() => (addCleaner || !!$slots.btn) && clean()"
|
|
71
|
+
:="$attrs"
|
|
72
|
+
>
|
|
73
|
+
|
|
74
|
+
<span
|
|
75
|
+
v-if="addCleaner && localValue && localValue !== '0000-00-00'"
|
|
76
|
+
class="top-input_cleaner"
|
|
77
|
+
data-top-icon=""
|
|
78
|
+
@click.prevent="clean"
|
|
79
|
+
></span>
|
|
80
|
+
|
|
81
|
+
<span
|
|
82
|
+
v-if="captionType !== ''"
|
|
83
|
+
class="top-formsCaption"
|
|
84
|
+
>
|
|
85
|
+
{{ title }}
|
|
86
|
+
</span>
|
|
87
|
+
|
|
88
|
+
<!-- @slot Слот для вставки произвольного кода в label -->
|
|
89
|
+
<slot></slot>
|
|
90
|
+
</label>
|
|
91
|
+
</template>
|
|
92
|
+
|
|
93
|
+
<style module>
|
|
94
|
+
.top-input {
|
|
95
|
+
--top-forms_clear-width: 0px;
|
|
96
|
+
|
|
97
|
+
width: 180px;
|
|
98
|
+
position: relative;
|
|
99
|
+
display: inline-flex;
|
|
100
|
+
align-items: center;
|
|
101
|
+
gap: var(--top-gap-1);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.top-input_input {
|
|
105
|
+
background: var(--top-forms-background-color);
|
|
106
|
+
height: var(--top-forms-base-height);
|
|
107
|
+
padding: 0;
|
|
108
|
+
padding-right: calc(max(var(--top-forms-padding), calc(var(--top-icon2-width) + var(--top-forms_clear-width))));
|
|
109
|
+
padding-left: calc(max(var(--top-forms-padding), var(--top-icon-width)));
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.top-input_input:hover {
|
|
113
|
+
background: var(--top-forms-background-color-hover);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.top-input_input:focus {
|
|
117
|
+
outline-color: var(--color-theme-75);
|
|
118
|
+
outline-offset: 0;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/* значки */
|
|
122
|
+
.top-input[data-top-icon]:before,
|
|
123
|
+
.top-input[data-top-icon2]:after {
|
|
124
|
+
--top-icon-color: var(--color-text-secondary);
|
|
125
|
+
--top-icon2-color: var(--color-text-secondary);
|
|
126
|
+
|
|
127
|
+
position: absolute;
|
|
128
|
+
z-index: 3;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.top-input[data-top-icon]:before {
|
|
132
|
+
left: 0;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.top-input[data-top-icon2]:after {
|
|
136
|
+
right: 0;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/* cleaner */
|
|
140
|
+
.top-input-withCleaner {
|
|
141
|
+
--top-forms_clear-width: 24px;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.top-input_cleaner {
|
|
145
|
+
--top-icon-size: 20px;
|
|
146
|
+
--top-icon-width: 20px;
|
|
147
|
+
--top-icon-color: var(--color-text-3);
|
|
148
|
+
|
|
149
|
+
cursor: pointer;
|
|
150
|
+
border-radius: 50%;
|
|
151
|
+
width: 24px;
|
|
152
|
+
height: 24px;
|
|
153
|
+
position: absolute;
|
|
154
|
+
right: calc(var(--top-forms-border-width) + max(var(--top-icon2-width), var(--top-forms-padding) / 2));
|
|
155
|
+
z-index: 1;
|
|
156
|
+
display: flex;
|
|
157
|
+
align-items: center;
|
|
158
|
+
justify-content: center;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.top-input_cleaner:hover {
|
|
162
|
+
--top-icon-color: var(--color-text-2);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/* TODO: перенести в inputsRange */
|
|
166
|
+
.top-input_input {
|
|
167
|
+
width: 50%;
|
|
168
|
+
flex-grow: 1;
|
|
169
|
+
}
|
|
170
|
+
</style>
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { sizes } from '@/components/forms/helpers';
|
|
3
|
+
import type { Props } from '../input';
|
|
4
|
+
import { Input, Button } from '../../forms';
|
|
5
|
+
import { reactive } from 'vue';
|
|
6
|
+
|
|
7
|
+
defineProps<Props>();
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Варианты props для вывода компонента в различных состояних
|
|
11
|
+
*/
|
|
12
|
+
const genVariantProps = () => [
|
|
13
|
+
{
|
|
14
|
+
modelValue: '',
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
modelValue: 'Текст введен',
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
modelValue: '',
|
|
21
|
+
title: 'С иконкой поиска',
|
|
22
|
+
icon: '',
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
modelValue: '',
|
|
26
|
+
title: 'С кнопкой очистки',
|
|
27
|
+
addCleaner: true,
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
modelValue: '',
|
|
31
|
+
title: 'Не активное',
|
|
32
|
+
disabled: true,
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
modelValue: '',
|
|
36
|
+
title: 'Только чтение',
|
|
37
|
+
readonly: true,
|
|
38
|
+
},
|
|
39
|
+
] satisfies Props[];
|
|
40
|
+
|
|
41
|
+
const variantPropsBySize: Record<string, Props[]> = {};
|
|
42
|
+
Object.values(sizes).forEach(keySize => variantPropsBySize[keySize] = reactive(genVariantProps()));
|
|
43
|
+
</script>
|
|
44
|
+
|
|
45
|
+
<template>
|
|
46
|
+
<div>
|
|
47
|
+
<template v-for="size in sizes">
|
|
48
|
+
<h2>Размер: {{ size }}</h2>
|
|
49
|
+
|
|
50
|
+
<template v-for="props in variantPropsBySize[size]">
|
|
51
|
+
<Input
|
|
52
|
+
:="{ ...$props, ...props }"
|
|
53
|
+
v-model="props.modelValue"
|
|
54
|
+
:size="size"
|
|
55
|
+
/>
|
|
56
|
+
|
|
57
|
+
</template>
|
|
58
|
+
<hr>
|
|
59
|
+
</template>
|
|
60
|
+
</div>
|
|
61
|
+
</template>
|