@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.
Files changed (267) hide show
  1. package/.storybook/TopTheme.js +82 -0
  2. package/.storybook/TopThemeManager.js +44 -0
  3. package/.storybook/main.ts +43 -0
  4. package/.storybook/manager.ts +28 -0
  5. package/.storybook/preview-head.html +16 -0
  6. package/.storybook/preview.ts +48 -0
  7. package/.storybook/vue/coreDecorator.ts +19 -0
  8. package/.storybook/vue/vModelDecorator.ts +27 -0
  9. package/.vscode/extensions.json +11 -0
  10. package/.vscode/keybindings.example.json +121 -0
  11. package/.vscode/settings.json +46 -0
  12. package/Dockerfile +3 -0
  13. package/NPM.md +25 -0
  14. package/PUBLISH.md +18 -0
  15. package/README.md +19 -52
  16. package/STORYBOOK.md +27 -0
  17. package/USE_IN_PROJECT.md +29 -0
  18. package/build/afterBuild.sh +12 -0
  19. package/build/cssModules.ts +39 -0
  20. package/build/plugin/amdFix.ts +46 -0
  21. package/build/rollup.config.ts +18 -0
  22. package/nbproject/project.properties +11 -0
  23. package/nbproject/project.xml +9 -0
  24. package/package.json +68 -19
  25. package/public/README.md +63 -0
  26. package/src/components/common/common.ts +1 -0
  27. package/src/components/common/icon/icon.ts +4 -0
  28. package/src/components/common/icon/icon.vue +15 -0
  29. package/src/components/component.ts +133 -0
  30. package/src/components/forms/button/button.stories.ts +112 -0
  31. package/src/components/forms/button/button.ts +51 -0
  32. package/src/components/forms/button/button.vue +75 -0
  33. package/src/components/forms/button/stories/README.md +35 -0
  34. package/src/components/forms/button/stories/overview.vue +33 -0
  35. package/src/components/forms/button/style/button.css +124 -0
  36. package/src/components/forms/button/style/style-outline.css +42 -0
  37. package/src/components/forms/button/style/style-soft.css +31 -0
  38. package/src/components/forms/button/style/style-transparent.css +35 -0
  39. package/src/components/forms/checkbox/checkbox.stories.ts +33 -0
  40. package/src/components/forms/checkbox/checkbox.ts +23 -0
  41. package/src/components/forms/checkbox/checkbox.vue +135 -0
  42. package/src/components/forms/checkbox/stories/overview.vue +171 -0
  43. package/src/components/forms/controlLabel/controlLabel.stories.ts +38 -0
  44. package/src/components/forms/controlLabel/controlLabel.ts +4 -0
  45. package/src/components/forms/controlLabel/controlLabel.vue +48 -0
  46. package/src/components/forms/forms.ts +10 -0
  47. package/src/components/forms/helpers.ts +10 -0
  48. package/src/components/forms/hint/hint.stories.ts +46 -0
  49. package/src/components/forms/hint/hint.ts +8 -0
  50. package/src/components/forms/hint/hint.vue +32 -0
  51. package/src/components/forms/input/input.stories.ts +31 -0
  52. package/src/components/forms/input/input.ts +34 -0
  53. package/src/components/forms/input/input.vue +170 -0
  54. package/src/components/forms/input/stories/overview.vue +61 -0
  55. package/src/components/forms/inputDate/datepicker.css +233 -0
  56. package/src/components/forms/inputDate/datepicker.ts +101 -0
  57. package/src/components/forms/inputDate/inputDate.stories.ts +41 -0
  58. package/src/components/forms/inputDate/inputDate.ts +4 -0
  59. package/src/components/forms/inputDate/inputDate.vue +127 -0
  60. package/src/components/forms/inputDate/stories/overview.vue +35 -0
  61. package/src/components/forms/radio/radio.stories.ts +34 -0
  62. package/src/components/forms/radio/radio.ts +15 -0
  63. package/src/components/forms/radio/radio.vue +107 -0
  64. package/src/components/forms/radio/stories/overview.vue +79 -0
  65. package/src/components/forms/select/select.stories.ts +34 -0
  66. package/src/components/forms/select/select.ts +36 -0
  67. package/src/components/forms/select/select.vue +253 -0
  68. package/src/components/forms/select/stories/exampleOptions.ts +71 -0
  69. package/src/components/forms/select/stories/overview.vue +60 -0
  70. package/src/components/forms/switcher/stories/overview.vue +139 -0
  71. package/src/components/forms/switcher/switcher.stories.ts +33 -0
  72. package/src/components/forms/switcher/switcher.ts +22 -0
  73. package/src/components/forms/switcher/switcher.vue +113 -0
  74. package/src/components/forms/textarea/stories/overview.vue +62 -0
  75. package/src/components/forms/textarea/textarea.stories.ts +33 -0
  76. package/src/components/forms/textarea/textarea.ts +38 -0
  77. package/src/components/forms/textarea/textarea.vue +119 -0
  78. package/src/components/formsExt/editArea/editArea.stories.ts +72 -0
  79. package/src/components/formsExt/editArea/editArea.ts +25 -0
  80. package/src/components/formsExt/editArea/editArea.vue +172 -0
  81. package/src/components/formsExt/editArea/stories/README.md +17 -0
  82. package/src/components/formsExt/editArea/stories/overview.vue +66 -0
  83. package/src/components/formsExt/editInput/editInput.stories.ts +36 -0
  84. package/src/components/formsExt/editInput/editInput.ts +20 -0
  85. package/src/components/formsExt/editInput/editInput.vue +57 -0
  86. package/src/components/formsExt/editInput/stories/overview.vue +54 -0
  87. package/src/components/formsExt/formsExt.ts +3 -0
  88. package/src/components/formsExt/radioGroup/radioGroup.stories.ts +51 -0
  89. package/src/components/formsExt/radioGroup/radioGroup.ts +28 -0
  90. package/src/components/formsExt/radioGroup/radioGroup.vue +143 -0
  91. package/src/components/formsExt/radioGroup/stories/overview.vue +78 -0
  92. package/src/components/formsExt/radioGroup/styles/top-scrollBar.css +52 -0
  93. package/src/components/helper.js +10 -0
  94. package/src/components/helpersStories.ts +151 -0
  95. package/src/components/popup/lib/popup.globalEvents.js +205 -0
  96. package/src/components/popup/lib/popup.js +702 -0
  97. package/src/components/popup/lib/worker.globalEvents.js +78 -0
  98. package/src/components/popup/lib/worker.js +232 -0
  99. package/src/components/popup/popup/listItem.vue +42 -0
  100. package/src/components/popup/popup/opener.vue +74 -0
  101. package/src/components/popup/popup/popup.stories.ts +68 -0
  102. package/src/components/popup/popup/popup.ts +93 -0
  103. package/src/components/popup/popup/popup.vue +95 -0
  104. package/src/components/popup/popup/stories/README.md +34 -0
  105. package/src/components/popup/popup/stories/listItems.vue +44 -0
  106. package/src/components/popup/popup/stories/listSubItems.vue +52 -0
  107. package/src/components/popup/popup/stories/overview.vue +208 -0
  108. package/src/components/popup/popup/style/popup.css +243 -0
  109. package/src/components/popup/popup/style/popup.m.css +71 -0
  110. package/src/components/popup/popup/style/popup.pc.css +28 -0
  111. package/src/components/popup/popup.ts +3 -0
  112. package/src/components/popup/worker.ts +1 -0
  113. package/src/components/tabs/tabs/content.vue +24 -0
  114. package/src/components/tabs/tabs/stories/README.md +10 -0
  115. package/src/components/tabs/tabs/tab.vue +52 -0
  116. package/src/components/tabs/tabs/tabs.stories.ts +171 -0
  117. package/src/components/tabs/tabs/tabs.ts +22 -0
  118. package/src/components/tabs/tabs/tabs.vue +64 -0
  119. package/src/components/tabs/tabs.ts +3 -0
  120. package/src/core/base/Colors.stories.ts +15 -0
  121. package/src/core/base/Layout.stories.ts +15 -0
  122. package/src/core/base/Properties.stories.ts +15 -0
  123. package/src/core/base/base.mdx +21 -0
  124. package/src/core/core/core.ts +144 -0
  125. package/src/core/core/events.ts +54 -0
  126. package/src/core/core/options.ts +15 -0
  127. package/src/core/core/state.ts +44 -0
  128. package/src/core/directives/tooltip.ts +55 -0
  129. package/src/core/theme/Colors.stories.ts +15 -0
  130. package/src/core/theme/Properties.stories.ts +15 -0
  131. package/src/core/theme/theme.mdx +15 -0
  132. package/src/core/utils/date.ts +164 -0
  133. package/src/core/utils/device.ts +48 -0
  134. package/src/core/utils/dom.ts +185 -0
  135. 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
  136. 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
  137. 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
  138. package/src/docs/CSS/FAQ.mdx +43 -0
  139. 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
  140. 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
  141. 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
  142. 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
  143. package/src/docs/CSS//320/241/321/202/320/270/320/273/320/270.md +53 -0
  144. package/src/docs/CSS//320/241/321/202/320/270/320/273/320/270.mdx +4 -0
  145. 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
  146. package/src/docs/ROADMAP.md +17 -0
  147. package/src/docs/Roadmap.mdx +4 -0
  148. 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
  149. 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
  150. 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
  151. 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
  152. 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
  153. 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
  154. package/src/globals.d.ts +1 -0
  155. package/{icomoon → src/resources/icomoon}/demo-files/demo.css +161 -161
  156. package/{icomoon → src/resources/icomoon}/demo-files/demo.js +30 -30
  157. package/{icomoon → src/resources/icomoon}/demo.html +2945 -2945
  158. package/{icomoon → src/resources/icomoon}/fonts/Topvisor-2.svg +232 -232
  159. package/{icomoon → src/resources/icomoon}/style.css +647 -647
  160. package/src/resources/styles/core/colors.css +204 -0
  161. package/src/resources/styles/core/components.css +70 -0
  162. package/src/resources/styles/core/core.ts +10 -0
  163. package/src/resources/styles/core/forms/clear.css +19 -0
  164. package/src/resources/styles/core/forms/controls.css +20 -0
  165. package/src/resources/styles/core/forms/focusable.css +26 -0
  166. package/src/resources/styles/core/forms/forms.css +100 -0
  167. package/src/resources/styles/core/icon.css +58 -0
  168. package/src/resources/styles/core/layout.css +40 -0
  169. package/src/resources/styles/core/modifiers/as.css +9 -0
  170. package/src/resources/styles/core/modifiers/ellipsis.css +18 -0
  171. package/src/resources/styles/core/modifiers/modifiers.css +81 -0
  172. package/src/resources/styles/core/modifiers/only.css +19 -0
  173. package/src/resources/styles/core/select.css +16 -0
  174. package/src/resources/styles/jquery-ui.min.css +6 -0
  175. package/src/resources/styles/storybook.css +11 -0
  176. package/src/resources/styles/themes/dark/theme.css +139 -0
  177. package/src/resources/styles/themes/dark.ts +1 -0
  178. package/src/resources/styles/themes/light/theme.css +139 -0
  179. package/src/resources/styles/themes/light.ts +1 -0
  180. package/src/storybook/components/color.vue +45 -0
  181. package/src/storybook/components/colors.vue +34 -0
  182. package/src/storybook/components/icomoon.ts +38 -0
  183. package/src/storybook/components/properties.vue +82 -0
  184. package/src/storybook/resources/accessibility.png +0 -0
  185. package/src/storybook/resources/accessibility.svg +5 -0
  186. package/src/storybook/resources/addon-library.png +0 -0
  187. package/src/storybook/resources/assets.png +0 -0
  188. package/src/storybook/resources/context.png +0 -0
  189. package/src/storybook/resources/discord.svg +15 -0
  190. package/src/storybook/resources/docs.png +0 -0
  191. package/src/storybook/resources/figma-plugin.png +0 -0
  192. package/src/storybook/resources/github.svg +3 -0
  193. package/src/storybook/resources/share.png +0 -0
  194. package/src/storybook/resources/styling.png +0 -0
  195. package/src/storybook/resources/testing.png +0 -0
  196. package/src/storybook/resources/theming.png +0 -0
  197. package/src/storybook/resources/tutorials.svg +12 -0
  198. package/src/storybook/resources/youtube.svg +4 -0
  199. 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
  200. package/tsconfig.json +62 -0
  201. package/vite.config.ts +91 -0
  202. package/.chunks/datepicker-0b648b9f.es.js +0 -275
  203. package/.chunks/datepicker-0b648b9f.es.js.map +0 -1
  204. package/.chunks/datepicker-0e9a0541.amd.js +0 -234
  205. package/.chunks/datepicker-0e9a0541.amd.js.map +0 -1
  206. package/.chunks/forms-02202302.amd.js +0 -3
  207. package/.chunks/forms-02202302.amd.js.map +0 -1
  208. package/.chunks/forms-eb00d0c1.es.js +0 -946
  209. package/.chunks/forms-eb00d0c1.es.js.map +0 -1
  210. package/.chunks/popup-6f73b4b2.es.js +0 -700
  211. package/.chunks/popup-6f73b4b2.es.js.map +0 -1
  212. package/.chunks/popup-e1f34511.amd.js +0 -341
  213. package/.chunks/popup-e1f34511.amd.js.map +0 -1
  214. package/common/common.amd.js +0 -2
  215. package/common/common.amd.js.map +0 -1
  216. package/common/common.js +0 -2
  217. package/common/common.js.map +0 -1
  218. package/core/core.amd.js +0 -2
  219. package/core/core.amd.js.map +0 -1
  220. package/core/core.js +0 -6
  221. package/core/core.js.map +0 -1
  222. package/core.css +0 -1
  223. package/dark.css +0 -1
  224. package/forms/forms.amd.js +0 -2
  225. package/forms/forms.amd.js.map +0 -1
  226. package/forms/forms.js +0 -15
  227. package/forms/forms.js.map +0 -1
  228. package/forms/helpers.amd.js +0 -2
  229. package/forms/helpers.amd.js.map +0 -1
  230. package/forms/helpers.js +0 -9
  231. package/forms/helpers.js.map +0 -1
  232. package/forms.css +0 -1
  233. package/formsExt/formsExt.amd.js +0 -3
  234. package/formsExt/formsExt.amd.js.map +0 -1
  235. package/formsExt/formsExt.js +0 -152
  236. package/formsExt/formsExt.js.map +0 -1
  237. package/formsExt.css +0 -1
  238. package/light.css +0 -1
  239. package/popup/popup.amd.js +0 -3
  240. package/popup/popup.amd.js.map +0 -1
  241. package/popup/popup.js +0 -144
  242. package/popup/popup.js.map +0 -1
  243. package/popup/worker.amd.js +0 -2
  244. package/popup/worker.amd.js.map +0 -1
  245. package/popup/worker.js +0 -154
  246. package/popup/worker.js.map +0 -1
  247. package/popup.css +0 -1
  248. package/tabs/tabs.amd.js +0 -3
  249. package/tabs/tabs.amd.js.map +0 -1
  250. package/tabs/tabs.js +0 -97
  251. package/tabs/tabs.js.map +0 -1
  252. package/tabs.css +0 -1
  253. package/utils/date.amd.js +0 -2
  254. package/utils/date.amd.js.map +0 -1
  255. package/utils/date.js +0 -6
  256. package/utils/date.js.map +0 -1
  257. package/utils/device.amd.js +0 -2
  258. package/utils/device.amd.js.map +0 -1
  259. package/utils/device.js +0 -6
  260. package/utils/device.js.map +0 -1
  261. package/utils/dom.amd.js +0 -2
  262. package/utils/dom.amd.js.map +0 -1
  263. package/utils/dom.js +0 -64
  264. package/utils/dom.js.map +0 -1
  265. /package/{icomoon → src/resources/icomoon}/fonts/Topvisor-2.ttf +0 -0
  266. /package/{icomoon → src/resources/icomoon}/fonts/Topvisor-2.woff +0 -0
  267. /package/{icomoon → src/resources/icomoon}/selection.json +0 -0
@@ -0,0 +1,34 @@
1
+ ## Почему Popup, а не DropDown и не ContextMenu?
2
+
3
+ Popup реализует отображение окошка, с привязкой к кнопке, но это не обязательно меню.
4
+ В мобильной версии отображается в виде Popup, всплывающего снизу экрана.
5
+
6
+ Стандартная функциональность:
7
+
8
+ - настраиваемая шапка
9
+ - шаблон для основного содержимого
10
+ - шаблон для списка, который поддерживает вставку **ListItem** и элементы форм, например чекбоксы и радио
11
+ - для списков реализуется навигация через клавиатуру
12
+ - событие @open для отлавливания открытия Popup
13
+ - событие @close для отлавливания закрытия Popup
14
+ - настраиваемый футер
15
+
16
+ Уникальные фичи компонента:
17
+
18
+ - режим мобильной версии, активируется при размерах экрана меньше указанного, см. **Core.defineOptions()**
19
+ - поддерживаются **вложенные** Popup, поддерживает 4 уровня вложенности
20
+ - позволяет открывать Popup из любых мест, используя **всего один шаблон**, сохраняя при этом реактивность
21
+ - режим **openByHover** для имитации подсказок
22
+ - всегда добавляется на страницу в **ленивом** режиме, меню рендерится только при открытии.
23
+
24
+ ## Обычный вариант использования
25
+
26
+ Вставьте компонент Popup с указнием слота **opener** и слотом **content** или **contentList**
27
+
28
+ ## Вариант с оптмизиация путем переиспользования шаблона Popup
29
+
30
+ Вставьте компонент Popup с необходимыми слотами Popup **без** слота **opener**, укажите props **id**.
31
+
32
+ Вставьте кнопки для открытия Popup с помощью компонента **Opener**, укажите ему тот же props **id**.
33
+
34
+ Popup c одним и тем же id может быть открыт одновременно только один раз.
@@ -0,0 +1,44 @@
1
+ <script setup lang="ts">
2
+ import ListItem from '../listItem.vue';
3
+ import ListSubItems from './listSubItems.vue';
4
+
5
+ function onClick (e: any) {
6
+ const el: Element = e.currentTarget;
7
+
8
+ alert(`Вы килкнули на: "${el.innerHTML}"`);
9
+ }
10
+ </script>
11
+
12
+ <template>
13
+ <ListItem @click="onClick">
14
+ Первый элемент
15
+ </ListItem>
16
+
17
+ <ListItem @click="onClick">
18
+ Второй элемент
19
+ </ListItem>
20
+
21
+ <ListItem @click="onClick" :closeByClick="false">
22
+ Третий элемент (закрытие меню отключено)
23
+ </ListItem>
24
+
25
+ <ListItem type="delimiter"/>
26
+
27
+ <ListItem type="link" href="/" target="_blank">
28
+ Ссылка
29
+ </ListItem>
30
+
31
+ <ListItem type="delimiter"/>
32
+
33
+ <ListItem type="title">
34
+ Подменю
35
+ </ListItem>
36
+
37
+ <ListSubItems>
38
+ <ListSubItems>
39
+ <ListSubItems>
40
+
41
+ </ListSubItems>
42
+ </ListSubItems>
43
+ </ListSubItems>
44
+ </template>
@@ -0,0 +1,52 @@
1
+ <script setup lang="ts">
2
+ import Button from '@/components/forms/button/button.vue';
3
+ import Popup from '@/components/popup/popup/popup.vue';
4
+ import ListItem from '../listItem.vue';
5
+
6
+ function openSubItems (e: any) {
7
+ e.currentTarget.querySelector('.top-button').click();
8
+ }
9
+ </script>
10
+
11
+ <template>
12
+ <ListItem @click="openSubItems" :closeByClick="false">
13
+ Подменю
14
+
15
+ <Popup pos="2">
16
+ <template #opener>
17
+ <Button
18
+ color="theme"
19
+ icon=""
20
+ style="margin-left: auto"
21
+ class="more"
22
+ />
23
+ </template>
24
+
25
+ <template #contentList>
26
+ <ListItem type="control">
27
+ <Button
28
+ icon=""
29
+ :href="'https://telegram.me/share/url?url='"
30
+ target="_blank"
31
+ color="theme"
32
+ >
33
+ Telegram
34
+ </Button>
35
+ </ListItem>
36
+
37
+ <ListItem type="control">
38
+ <Button
39
+ icon=""
40
+ :href="'https://vk.com/share.php?url='"
41
+ target="_blank"
42
+ color="theme"
43
+ >
44
+ ВКонтакте
45
+ </Button>
46
+ </ListItem>
47
+
48
+ <slot></slot>
49
+ </template>
50
+ </Popup>
51
+ </ListItem>
52
+ </template>
@@ -0,0 +1,208 @@
1
+ <script setup lang="ts">
2
+ import Button from '@/components/forms/button/button.vue';
3
+
4
+ import Worker from '@/components/popup/lib/worker';
5
+ import type { Props } from '@/components/popup/popup/popup';
6
+ import Popup from '@/components/popup/popup/popup.vue';
7
+ import Opener from '@/components/popup/popup/opener.vue';
8
+ import ListItem from '@/components/popup/popup/listItem.vue';
9
+ import ListItems from './listItems.vue';
10
+
11
+ defineProps<Props>();
12
+
13
+ const pVariants = {
14
+ '0': 'На кнопке',
15
+ '1': 'Сверху',
16
+ '2': 'Справа',
17
+ '3': 'Снизу',
18
+ '4': 'Слева',
19
+ };
20
+ </script>
21
+
22
+ <template>
23
+ <h2>Простой Popup</h2>
24
+
25
+ <div style="display: flex; gap: 8px">
26
+ <Popup>
27
+ <template #opener>
28
+ <Button>
29
+ Просто текст
30
+ </Button>
31
+ </template>
32
+
33
+ <template #content>
34
+ Текст в слоте #content
35
+ </template>
36
+ </Popup>
37
+
38
+ <Popup>
39
+ <template #opener>
40
+ <Button>
41
+ Текст с кнопками
42
+ </Button>
43
+ </template>
44
+
45
+ <template #content>
46
+ Кнопки в слоте #content
47
+
48
+ <Button color="theme" icon="">Кнопка</Button>
49
+ <Button color="theme" icon="">Кнопка</Button>
50
+ <Button color="theme" icon="">Кнопка</Button>
51
+ </template>
52
+ </Popup>
53
+
54
+ <Popup :class="$style.styling">
55
+ <template #opener>
56
+ <Button>
57
+ Со стилизацией
58
+ </Button>
59
+ </template>
60
+
61
+ <template #content>
62
+ Текст в слоте #content, добавлен класс .styling
63
+ </template>
64
+ </Popup>
65
+
66
+ <Popup>
67
+ <template #opener>
68
+ <Button>
69
+ С шапкой
70
+ </Button>
71
+ </template>
72
+
73
+ <template #header>
74
+ Текст в слоте #header
75
+ </template>
76
+
77
+ <template #content>
78
+ Текст в слоте #content
79
+ </template>
80
+ </Popup>
81
+
82
+ <Popup>
83
+ <template #opener>
84
+ <Button>
85
+ Вопрос
86
+ </Button>
87
+ </template>
88
+
89
+ <template #content>
90
+ <div>
91
+ Если вы уверены, нажимете <b>Ок</b>
92
+ </div>
93
+ <div>
94
+ А если не уверены, то нажимайте <b>Отмена</b>
95
+ </div>
96
+ </template>
97
+
98
+ <template #footer>
99
+ <Button color="theme">
100
+ Отмена
101
+ </Button>
102
+ <Button>
103
+ Ок
104
+ </Button>
105
+ </template>
106
+ </Popup>
107
+
108
+ <Popup>
109
+ <template #opener>
110
+ <Button>
111
+ Список
112
+ </Button>
113
+ </template>
114
+
115
+ <template #contentList>
116
+ <ListItems/>
117
+ </template>
118
+ </Popup>
119
+
120
+ <Popup :class="$style.styling">
121
+ <template #opener>
122
+ <Button>
123
+ Все вместе
124
+ </Button>
125
+ </template>
126
+
127
+ <template #header>
128
+ Текст в слоте #header
129
+ </template>
130
+
131
+ <template #content>
132
+ Кнопки в слоте #content, добавлен класс .styling
133
+
134
+ <Button color="theme" icon="">Кнопка</Button>
135
+ <Button color="theme" icon="">Кнопка</Button>
136
+ <Button color="theme" icon="">Кнопка</Button>
137
+ </template>
138
+
139
+ <template #contentList>
140
+ <ListItem type="delimiter"/>
141
+ <ListItems/>
142
+ </template>
143
+
144
+ <template #footer>
145
+ <Button color="theme">
146
+ Отмена
147
+ </Button>
148
+ <Button>
149
+ Ок
150
+ </Button>
151
+ </template>
152
+ </Popup>
153
+ </div>
154
+
155
+ <h2>Варианты расположения с 1 шаблоном и несколькими кнопками</h2>
156
+
157
+ <div style="display: flex; gap: 8px">
158
+ <Popup id="pVariants">
159
+ <template #content>
160
+ Это всего один компонент. Сколько бы кнопок не было, компонент всегду будет всего один.
161
+ </template>
162
+ </Popup>
163
+
164
+ <Opener
165
+ v-for="(label, pos) in pVariants"
166
+ id="pVariants"
167
+ :pos="pos"
168
+ >
169
+ <Button>
170
+ {{ label }}
171
+ </Button>
172
+ </Opener>
173
+ </div>
174
+
175
+ <h2>При наведении</h2>
176
+
177
+ <Popup :openByHover="true">
178
+ <template #opener>
179
+ <Button>
180
+ Просто текст
181
+ </Button>
182
+ </template>
183
+
184
+ <template #content>
185
+ Текст в слоте #content
186
+ </template>
187
+ </Popup>
188
+
189
+ <h2>Без кнопки</h2>
190
+
191
+ <Popup>
192
+ <template #opener>
193
+ <div class="top-as-a">
194
+ Посмотреть число компонентов Popup на старнице
195
+ </div>
196
+ </template>
197
+
198
+ <template #content>
199
+ {{ Worker.vueConnectors.size }}
200
+ </template>
201
+ </Popup>
202
+ </template>
203
+
204
+ <style module>
205
+ .styling > .top-popupPanel {
206
+ box-shadow: rgba(127, 28, 138, 0.3) 0 0 30px;
207
+ }
208
+ </style>
@@ -0,0 +1,243 @@
1
+ :root{
2
+ --top-popup-background-color: var(--color-bg-3);
3
+ --top-popup-background-color-hover: var(--color-steel-150);
4
+ --top-popup-background-color-active: var(--color-steel-200);
5
+ --top-popup-border-color: var(--color-theme-100);
6
+ --top-popup-title-background-color: var(--color-steel-100);
7
+ }
8
+
9
+ .top-theme-dark{
10
+ --top-popup-background-color-hover: var(--color-gray-800);
11
+ --top-popup-background-color-active: var(--color-gray-750);
12
+ --top-popup-title-background-color: var(--color-gray-900);
13
+ }
14
+
15
+ .top-popup-front{ position: relative; }
16
+
17
+ .top-popup-wrapper{
18
+ --top-popup-padding-h: 8px;
19
+ --top-popup-padding-v: 8px;
20
+
21
+ /* см. recalcPosition() */
22
+ --top-popup-height: 0px;
23
+ --top-popup-right-bounding: 0px;
24
+ --top-popup-bottom-bounding: 0px;
25
+ --top-popup-top: 0px;
26
+ --top-popup-right: calc(100vw - var(--top-popup-right-bounding));
27
+ --top-popup-bottom: calc(var(--100vh) - var(--top-popup-bottom-bounding));
28
+ --top-popup-left: 0px;
29
+
30
+ text-align: initial; white-space: normal; word-break: normal;
31
+ position: absolute; z-index: 200000;
32
+ }
33
+ .top-popup-wrapper:not(.top-popup-wrapper-shown){ overflow: hidden; }
34
+
35
+ /* top-popupPanel */
36
+ .top-popupPanel {
37
+ cursor: default;
38
+ box-shadow: var(--top-shadow-b);
39
+ border-radius: 8px;
40
+ background: var(--top-popup-background-color);
41
+ position: absolute; overflow: hidden;
42
+ display: flex; flex-direction: column;
43
+ }
44
+
45
+ /* position */
46
+ .top-popup-wrapper > *{ opacity: 0; transition: opacity 100ms linear, transform 100ms linear; }
47
+ .top-popup-wrapper.p0 > *{ transform: translateY(-8px); }
48
+ .top-popup-wrapper.p1 > *{ transform: translateY(8px); }
49
+ .top-popup-wrapper.p2 > *{ transform: translateX(8px); }
50
+ .top-popup-wrapper.p3 > *{ transform: translateY(8px); }
51
+ .top-popup-wrapper.p4 > *{ transform: translateX(-8px); }
52
+ .top-popup-wrapper-shown:not(.top-popup-wrapper-closed) > *{opacity: 1;transform: translate(0, 0) !important;}
53
+
54
+ .top-popup-wrapper.p0 > .top-popup{ top: calc(-16px); left: calc(0px - var(--top-popup-padding-h)); }
55
+ .top-popup-wrapper.p1 > .top-popup{ bottom: calc(100% + 8px); }
56
+ .top-popup-wrapper.p2 > .top-popup{ left: calc(100% + 8px); }
57
+ .top-popup-wrapper.p3 > .top-popup{ top: calc(100% + 8px); }
58
+ .top-popup-wrapper.p4 > .top-popup{ right: calc(100% + 8px); }
59
+ .top-popup-wrapper.p2 > .top-popup,
60
+ .top-popup-wrapper.p4 > .top-popup{ margin-top: -10px; }
61
+
62
+ .top-popup-wrapper.p1.with_notch > .top-popup{ margin-bottom: 5px; }
63
+ .top-popup-wrapper.p2.with_notch > .top-popup{ margin-left: 5px; }
64
+ .top-popup-wrapper.p3.with_notch > .top-popup{ margin-top: 5px; }
65
+ .top-popup-wrapper.p4.with_notch > .top-popup{ margin-right: 5px; }
66
+
67
+ .top-popup-wrapper.invert-x > .top-popup{ right: 0; }
68
+ .top-popup-wrapper.invert-y > .top-popup{ bottom: 0; }
69
+
70
+ /* notch */
71
+ .top-popup-wrapper > .notch{ border: 7.4px solid transparent; position: absolute; display: block; }
72
+
73
+ .top-popup-wrapper.p1 > .notch{ border-bottom: 0; border-top: 7.4px solid var(--content-background-color); margin: 0 0 7.4px -7.4px; bottom: 100%; left: 50% }
74
+ .top-popup-wrapper.p2 > .notch{ border-left: 0; border-right: 7.4px solid var(--content-background-color); margin: 0 0 -7.4px 7.4px; bottom: 50%; left: 100%; }
75
+ .top-popup-wrapper.p3 > .notch{ border-top: 0; border-bottom: 7.4px solid var(--content-background-color); margin: 7.4px 0 0 -7.4px; top: 100%; left: 50%; }
76
+ .top-popup-wrapper.p4 > .notch{ border-right: 0; border-left: 7.4px solid var(--content-background-color); margin: 0 7.4px -7.4px 0; bottom: 50%; right: 100%; }
77
+
78
+ .top-popup-wrapper.p1 > .notch-border{ border-top-color: rgba(0,0,0,0.05); margin-bottom: 6px; }
79
+ .top-popup-wrapper.p2 > .notch-border{ border-right-color: rgba(0,0,0,0.05); margin-left: 6px; }
80
+ .top-popup-wrapper.p3 > .notch-border{ border-bottom-color: rgba(0,0,0,0.05); margin-top: 6px; }
81
+ .top-popup-wrapper.p4 > .notch-border{ border-left-color: rgba(0,0,0,0.05); margin-right: 6px; }
82
+
83
+ /* common */
84
+ .top-popup_header,
85
+ .top-popup_content,
86
+ .top-popup_footer{ padding: var(--top-popup-padding-h) var(--top-popup-padding-h); font-size: 14px; }
87
+ .top-popup_header,
88
+ .top-popup_footer{ display: flex; align-items: center; justify-content: space-between; }
89
+
90
+ /* header */
91
+ .top-popup_header{ border-bottom: 1px solid var(--top-popup-border-color); font-weight: 600; }
92
+ .top-popup_header > *{ font-weight: 400; }
93
+ .top-popup_header > .a{ cursor: pointer; color: var(--color-blue-450); }
94
+ .top-popup_header > .a:hover{ color: var(--color-blue-350); }
95
+
96
+ .top-popup_headerButton{ width: 60px; }
97
+
98
+ /* content */
99
+ .top-popup .top-popup_content{
100
+ /* has_scroll */
101
+ --scroll-padding-top: var(--top-popup-padding-v);
102
+ --scroll-padding-bottom: var(--top-popup-padding-v);
103
+
104
+ padding-top: var(--top-popup-padding-v); padding-bottom: var(--top-popup-padding-v); margin: 0; line-height:1.3 !important;
105
+ flex-grow: 1; overflow-y: auto;
106
+ -webkit-overflow-scrolling: touch;
107
+ }
108
+
109
+ .top-popup .top-popup_content .top-unwrap{
110
+ --top-unwrap-x: var(--top-popup-padding-h);
111
+ }
112
+
113
+ .top-popup div.top-popup_content{ display: flex; flex-direction: column; gap: 4px; }
114
+ .top-popup div.top-popup_content > *{ flex-shrink: 0; }
115
+ .top-popup div.top-popup_content > .top-button{ margin: 0; }
116
+
117
+ .top-popup ul.top-popup_content{
118
+ --scroll-padding-top: 4px;
119
+ --scroll-padding-bottom: var(--scroll-padding-top);
120
+
121
+ padding: var(--scroll-padding-top) 0;
122
+ }
123
+
124
+ ul.top-popup_content li{ margin: 0; list-style:none; display: flex; position: relative }
125
+ ul.top-popup_content li > *{ flex-grow: 1; }
126
+ ul.top-popup_content li > a:not(.top-button),
127
+ ul.top-popup_content li > i.a{
128
+ cursor: pointer;
129
+ box-sizing: border-box;
130
+ background: var(--top-popup-background-color); padding:var(--top-popup-padding-v) var(--top-popup-padding-h);
131
+ color:var(--color-text) !important; font-size: 14px; font-weight: normal !important; text-decoration:none !important; font-style: normal;
132
+ display:flex; flex: 1 1 100%; align-items: center;
133
+ transition: background-color 0.1s ease-in-out;
134
+ }
135
+ .top-popup-wrapper-no_animate ul.top-popup_content li > a:not(.top-button),
136
+ .top-popup-wrapper-no_animate ul.top-popup_content li > i.a{ transition: none; }
137
+
138
+ ul.top-popup_content li > a:not(.top-button):hover,
139
+ ul.top-popup_content li > i.a:hover{ background: var(--top-popup-background-color-hover); }
140
+ ul.top-popup_content li > a:not(.top-button).top-active,
141
+ ul.top-popup_content li > i.a.top-active{ background: var(--top-popup-background-color-active); }
142
+
143
+ /* listTitle */
144
+ li.top-popup_listTitle{
145
+ background: var(--top-popup-title-background-color); padding: var(--top-popup-padding-v) var(--top-popup-padding-h);
146
+ color: var(--color-text-3); font-size: 12px; font-weight: 400;
147
+ }
148
+ li.top-popup_listTitle:first-child{
149
+ padding-top: calc(var(--top-popup-padding-v) + var(--scroll-padding-top));
150
+ margin-top: calc(0px - var(--scroll-padding-top));
151
+ }
152
+
153
+ /* listDelimiter */
154
+ ul.top-popup_content li.top-popup_listDelimiter{
155
+ border-radius: 3px;
156
+ background: var(--top-popup-border-color);
157
+ height: 2px;
158
+ margin: calc(var(--top-popup-padding-h) / 2) var(--top-popup-padding-h);
159
+ }
160
+
161
+ /* listMore */
162
+ ul.top-popup_content li > i.a.top-popup_listMore{
163
+ height: auto; padding-right: 4px; padding-left: 4px;
164
+ font-size: 24px; line-height: 17px; text-align: center;
165
+ flex-basis: 10px;
166
+ }
167
+ ul.top-popup_content li > i.a.top-popup_listMore:before{ color: var(--color-gray-500); }
168
+ ul.top-popup_content li > * > i.top-popup_listMore{
169
+ padding: 0 var(--top-popup-padding-h); margin: 0 0 0 auto;
170
+ color: var(--color-gray-500);
171
+ font-size: 14px;
172
+ }
173
+ ul.top-popup_content li > * > i.top-popup_listMore:hover,
174
+ ul.top-popup_content li > * > i.top-popup_listMore.top-active{ color: var(--color-blue-500); }
175
+ ul.top-popup_content li > * > i.top-popup_listMore:before{ transform: rotate(90deg); }
176
+
177
+ ul.top-popup_content li a.close{ background: none !important; }
178
+
179
+ /* data-top-icon */
180
+ .top-popup_content > [data-top-icon]:before{ --top-icon-size: 20px; }
181
+
182
+ ul.top-popup_content li > [data-top-icon]:not(.top-button):before{
183
+ --top-icon-color: var(--color-text-3);
184
+ --top-icon-size: 20px;
185
+ --top-icon-width: 20px;
186
+
187
+ height: 1rem; margin-right: 8px; transition: color 0.1s;
188
+ }
189
+ ul.top-popup_content li:hover > [data-top-icon]:not(.top-button):before,
190
+ ul.top-popup_content li > [data-top-icon]:not(.top-button).top-active:before{
191
+ --top-icon-color: #378DC6;
192
+ }
193
+
194
+ /* footer */
195
+ .top-popup_footer{
196
+ padding: var(--top-popup-padding-h) var(--top-popup-padding-h); display: flex; gap:8px; justify-content: flex-end;
197
+ }
198
+ .top-popup_footer > .top-button{ margin: 0; }
199
+
200
+ /* Виджеты */
201
+ .top-popup > [data-widget]{ padding: 0 var(--top-popup-padding-h); }
202
+ .top-popup > [data-widget] + hr{ margin: 0 var(--top-popup-padding-h); }
203
+
204
+ .top-popup .placeholder{
205
+ border:1px solid #E0D9D9 !important; border-right: none !important; border-left: none !important; background:#F9F9F9 !important; margin: -1px 0; z-index: 1;
206
+ position: relative;
207
+ }
208
+
209
+ /* компоненты */
210
+ .top-popup-wrapper.simple_list > .top-popup{ min-width: 0; white-space: nowrap; }
211
+
212
+ .top-popup_content .top-column{ display: flex; flex-direction: column; gap: 4px; }
213
+ .top-popup_content li > :not(a):not(.a){ margin:0 var(--top-popup-padding-h); }
214
+ html .top-popup .top-popup_content li > .top-button{ margin:calc(var(--top-popup-padding-v) / 2) var(--top-popup-padding-h); }
215
+
216
+ .top-popup li .check_all,
217
+ .top-popup li .clear_all{ cursor: pointer; color: var(--color-cyan); padding: 8px; display: inline-block; }
218
+ .top-popup li .check_all:hover,
219
+ .top-popup li .clear_all:hover{ text-decoration: underline; }
220
+ .top-popup li .clear_all{ display: none; }
221
+
222
+ /* table */
223
+ .top-popup_content table{ margin: -9px 0; }
224
+ .top-popup_content table td,
225
+ .top-popup_content table th{ padding: 9px var(--top-popup-padding-h) 9px 0; vertical-align: top; }
226
+ .top-popup_content table th{ width: 40%; font-weight: 600; white-space: nowrap; }
227
+
228
+ /* формы */
229
+ ul.top-popup_content .a > [type="checkbox"],
230
+ ul.top-popup_content .a > [type="radio"]{ margin: -8px 0 -8px auto; }
231
+
232
+ /* deprecated */
233
+ ul.top-popup_content a > [class*=icon],
234
+ ul.top-popup_content i.a > [class*=icon]{
235
+ margin-right: 14px; text-align: center;
236
+ width: auto; height: 16px; font-size: 16px; vertical-align: top;
237
+ transition: 0.1s;
238
+ }
239
+
240
+ .top-popup .buttons{ border-radius:0 0 4px 4px; border-top:1px solid #BDC3C7; background:#ECF0F1; padding:10px 15px; margin:10px -15px -10px -15px; white-space: nowrap; }
241
+ .top-popup_footer [class*=btn]:not(.btn-transparent){ min-width: 100px; padding: 5px 14px; margin-left: 10px; }
242
+ .top-popup_footer [class*=btn]:first-child{ margin-left: 0; }
243
+ .top-popup_footer .btn.full_width{ margin: 0; flex-grow: 1; }
@@ -0,0 +1,71 @@
1
+ html.with_popup{ background: #808080; }
2
+
3
+ .top-popup-wrapper{
4
+ --top-popup-padding-h: 19px;
5
+ --top-popup-padding-v: 16px;
6
+ --top-popup-footer-offset: 25px;
7
+
8
+ width: auto !important; height: auto !important;
9
+ position: fixed; top: 0 !important; right: 0 !important; left: 0 !important; overflow: hidden;
10
+ transition: background 0.3s;
11
+ }
12
+
13
+ .top-popup-wrapper-shown:not(.top-popup-wrapper-closed){ background: rgba(0,0,0,0.5); backdrop-filter: blur(1px); }
14
+ .top-popup-wrapper-shown:not(.top-popup-wrapper-closed) > .top-popup{ opacity: 1 !important; }
15
+
16
+ .top-popup{
17
+ border-radius: 8px 8px 0 0; width: auto !important; max-height: calc(100% - var(--header-height) - 12px);
18
+ top: auto !important; right: 0 !important; bottom: 0 !important; left: 0 !important;
19
+ display: flex; flex-direction: column;
20
+
21
+ /* невозможно опустить элемент вниз за экран на 100%, fix: opacity и translateY(80%) */
22
+ transform: translateY(80%);
23
+
24
+ transition: opacity 0.3s, transform 0.3s;
25
+ }
26
+
27
+ /* from top */
28
+ .top-popup-wrapper.p-from-top{
29
+ --top-popup-footer-offset: 0px;
30
+
31
+ top: var(--header-height) !important;
32
+ }
33
+ .with_dialog .top-popup-wrapper.p-from-top{ top: 50px !important; }
34
+ .top-popup-wrapper.p-from-top > .top-popup{
35
+ border-radius: 0 0 8px 8px; max-height: calc(100% - 24px); top: 0 !important; bottom: auto !important;
36
+ transform: translateY(calc(-100% - 24px));
37
+ }
38
+
39
+ .top-popup_content:last-child,
40
+ .top-popup_footer{
41
+ --scroll-padding-bottom: calc(var(--top-popup-padding-v) + var(--top-popup-footer-offset));
42
+
43
+ padding-bottom: var(--scroll-padding-bottom);
44
+ }
45
+
46
+ /* content */
47
+ ul.top-popup_content{
48
+ --scroll-padding-top: 0px;
49
+ --scroll-padding-bottom: var(--scroll-padding-top);
50
+
51
+ display: flex; flex-direction: column;
52
+ }
53
+ ul.top-popup_content li:not(:last-child){ border-bottom: 1px solid var(--top-popup-border-color); }
54
+
55
+ .top-popup-wrapper.top-style_alt > .top-popup > ul > li{ border-bottom: none; }
56
+
57
+ /* footer */
58
+ .top-popup_footer{ flex-wrap: wrap; }
59
+ .top-popup_footer > .top-button{
60
+ --top-forms-base-height: var(--top-forms-base-height_xl);
61
+
62
+ flex-grow: 1;
63
+ }
64
+
65
+ /* listTitle */
66
+ ul.top-popup_content li.top-popup_listTitle{
67
+ --top-popup-padding-v: 12px;
68
+ }
69
+
70
+ /* listDelimiter */
71
+ ul.top-popup_content li.top-popup_listDelimiter{ border-radius: 0; border-bottom: none; height: 2px; margin: 0; }
@@ -0,0 +1,28 @@
1
+ html:not(.with_dialog){ margin-right: 0 !important; }
2
+
3
+ .top-popup{ min-width: 250px; max-width: calc(100vw - var(--top-popup-left) - 16px); max-height: calc(var(--top-popup-bottom) + var(--top-popup-height)); }
4
+ .top-popup-wrapper.invert-x > .top-popup{ max-width: calc(100vw - var(--top-popup-right) - 16px); }
5
+ .top-popup-wrapper.invert-y > .top-popup{ max-height: calc(100vh - var(--top-popup-bottom) - 16px); }
6
+
7
+ /* position */
8
+ .top-popup-wrapper.p1 > .top-popup{ max-height: calc(var(--top-popup-top) - var(--header-height) - 16px); }
9
+ .top-popup-wrapper.p3 > .top-popup{ max-height: calc(var(--top-popup-bottom) - 16px); }
10
+ .top-popup-wrapper.p2 > .top-popup{ max-width: calc(var(--top-popup-right) - 16px); }
11
+ .top-popup-wrapper.p4 > .top-popup{ max-width: calc(var(--top-popup-left) - 16px); }
12
+
13
+ /* notch */
14
+ .top-popup-wrapper.p1.with_notch > .top-popup,
15
+ .top-popup-wrapper.p3.with_notch > .top-popup{ margin-left: -16px !important; }
16
+ .top-popup-wrapper.p1.with_notch > .notch,
17
+ .top-popup-wrapper.p3.with_notch > .notch{ margin-left: -8px !important; }
18
+
19
+ .top-popup-wrapper.p1.with_notch.invert-x,
20
+ .top-popup-wrapper.p3.with_notch.invert-x{ margin-left: 3px !important; }
21
+ .top-popup-wrapper.p1.with_notch.invert-x > .notch,
22
+ .top-popup-wrapper.p3.with_notch.invert-x > .notch{ margin-left: -9px !important; }
23
+
24
+ /* listMore */
25
+ ul.top-popup_content li > * > i.top-popup_listMore{ visibility: hidden; transition: none; }
26
+ ul.top-popup_content li:hover > * > i.top-popup_listMore,
27
+ ul.top-popup_content li > *.top-active > i.top-popup_listMore,
28
+ ul.top-popup_content li > * > i.top-popup_listMore.top-active{ visibility: visible; }
@@ -0,0 +1,3 @@
1
+ export { default as Popup } from './popup/popup.vue';
2
+ export { default as PopupOpener } from './popup/opener.vue';
3
+ export { default as PopupListItem } from './popup/listItem.vue';
@@ -0,0 +1 @@
1
+ export { default } from './lib/worker.js';