@dxtmisha/constructor 0.23.0 → 0.30.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.
Files changed (343) hide show
  1. package/package.json +36 -6
  2. package/src/classes/AriaStaticInclude.ts +269 -0
  3. package/src/classes/DescriptionInclude.ts +19 -2
  4. package/src/classes/EnabledInclude.ts +11 -0
  5. package/src/classes/EventClickInclude.ts +2 -2
  6. package/src/classes/LabelHighlightInclude.ts +35 -0
  7. package/src/classes/LabelInclude.ts +40 -5
  8. package/src/classes/ModelInclude.ts +50 -1
  9. package/src/classes/ModelValueInclude.ts +73 -0
  10. package/src/classes/TabIndexInclude.ts +260 -0
  11. package/src/classes/TextInclude.ts +102 -0
  12. package/src/classes/TouchEventInclude.ts +284 -0
  13. package/src/classes/field/FieldArrowInclude.ts +189 -0
  14. package/src/classes/field/FieldAttributesInclude.ts +87 -28
  15. package/src/classes/field/FieldChangeInclude.ts +1 -1
  16. package/src/classes/field/FieldElementInclude.ts +1 -1
  17. package/src/classes/field/FieldEventInclude.ts +253 -0
  18. package/src/classes/field/FieldInputModeInclude.ts +48 -0
  19. package/src/classes/field/FieldMatchInclude.ts +9 -3
  20. package/src/classes/field/FieldTypeInclude.ts +11 -6
  21. package/src/classes/field/FieldValidationInclude.ts +1 -4
  22. package/src/classes/field/FieldValueInclude.ts +10 -0
  23. package/src/constructors/Accordion/Accordion.ts +68 -0
  24. package/src/constructors/Accordion/AccordionDesign.tsx +192 -0
  25. package/src/constructors/Accordion/basicTypes.ts +0 -0
  26. package/src/constructors/Accordion/index.ts +5 -0
  27. package/src/constructors/Accordion/properties.json +16 -0
  28. package/src/constructors/Accordion/props.ts +55 -0
  29. package/src/constructors/Accordion/style.scss +12 -0
  30. package/src/constructors/Accordion/types.ts +63 -0
  31. package/src/constructors/ActionSheet/ActionSheet.ts +78 -0
  32. package/src/constructors/ActionSheet/ActionSheetDesign.tsx +125 -0
  33. package/src/constructors/ActionSheet/basicTypes.ts +0 -0
  34. package/src/constructors/ActionSheet/index.ts +5 -0
  35. package/src/constructors/ActionSheet/properties.json +14 -0
  36. package/src/constructors/ActionSheet/props.ts +44 -0
  37. package/src/constructors/ActionSheet/style.scss +25 -0
  38. package/src/constructors/ActionSheet/types.ts +54 -0
  39. package/src/constructors/Actions/Actions.ts +60 -0
  40. package/src/constructors/Actions/ActionsDesign.tsx +212 -0
  41. package/src/constructors/Actions/ActionsInclude.ts +109 -0
  42. package/src/constructors/Actions/basicTypes.ts +40 -0
  43. package/src/constructors/Actions/index.ts +6 -0
  44. package/src/constructors/Actions/properties.json +63 -0
  45. package/src/constructors/Actions/props.ts +42 -0
  46. package/src/constructors/Actions/style.scss +11 -0
  47. package/src/constructors/Actions/types.ts +52 -0
  48. package/src/constructors/Anchor/Anchor.ts +113 -0
  49. package/src/constructors/Anchor/AnchorDesign.tsx +242 -0
  50. package/src/constructors/Anchor/AnchorEvent.ts +76 -0
  51. package/src/constructors/Anchor/AnchorHref.ts +54 -0
  52. package/src/constructors/Anchor/AnchorIcon.ts +54 -0
  53. package/src/constructors/Anchor/AnchorTo.ts +46 -0
  54. package/src/constructors/Anchor/basicTypes.ts +9 -0
  55. package/src/constructors/Anchor/index.ts +5 -0
  56. package/src/constructors/Anchor/properties.json +3 -0
  57. package/src/constructors/Anchor/props.ts +54 -0
  58. package/src/constructors/Anchor/style.scss +10 -0
  59. package/src/constructors/Anchor/types.ts +47 -0
  60. package/src/constructors/Arrow/Arrow.ts +134 -0
  61. package/src/constructors/Arrow/ArrowDesign.tsx +226 -0
  62. package/src/constructors/Arrow/ArrowElement.ts +139 -0
  63. package/src/constructors/Arrow/ArrowElementTarget.ts +72 -0
  64. package/src/constructors/Arrow/ArrowEvent.ts +126 -0
  65. package/src/constructors/Arrow/ArrowInclude.ts +85 -0
  66. package/src/constructors/Arrow/ArrowParent.ts +100 -0
  67. package/src/constructors/Arrow/ArrowPosition.ts +231 -0
  68. package/src/constructors/Arrow/basicTypes.ts +50 -0
  69. package/src/constructors/Arrow/index.ts +6 -0
  70. package/src/constructors/Arrow/properties.json +23 -0
  71. package/src/constructors/Arrow/props.ts +31 -0
  72. package/src/constructors/Arrow/style.scss +133 -0
  73. package/src/constructors/Arrow/types.ts +54 -0
  74. package/src/constructors/Badge/BadgeDesign.tsx +4 -1
  75. package/src/constructors/Badge/properties.json +36 -36
  76. package/src/constructors/Badge/props.ts +3 -1
  77. package/src/constructors/Badge/types.ts +3 -3
  78. package/src/constructors/Bars/Bars.ts +10 -4
  79. package/src/constructors/Bars/BarsDesign.tsx +17 -11
  80. package/src/constructors/Bars/BarsInclude.ts +5 -2
  81. package/src/constructors/Bars/properties.json +6 -6
  82. package/src/constructors/Bars/props.ts +3 -1
  83. package/src/constructors/Bars/style.scss +4 -0
  84. package/src/constructors/Bars/types.ts +3 -3
  85. package/src/constructors/Block/Block.ts +105 -0
  86. package/src/constructors/Block/BlockDesign.tsx +219 -0
  87. package/src/constructors/Block/basicTypes.ts +0 -0
  88. package/src/constructors/Block/index.ts +5 -0
  89. package/src/constructors/Block/properties.json +10 -0
  90. package/src/constructors/Block/props.ts +46 -0
  91. package/src/constructors/Block/style.scss +11 -0
  92. package/src/constructors/Block/types.ts +64 -0
  93. package/src/constructors/Button/Button.ts +26 -2
  94. package/src/constructors/Button/ButtonDesign.tsx +11 -6
  95. package/src/constructors/Button/ButtonInclude.ts +8 -5
  96. package/src/constructors/Button/index.ts +1 -0
  97. package/src/constructors/Button/properties.json +84 -84
  98. package/src/constructors/Button/props.ts +5 -1
  99. package/src/constructors/Button/style.scss +1 -1
  100. package/src/constructors/Button/types.ts +2 -2
  101. package/src/constructors/Cell/Cell.ts +23 -6
  102. package/src/constructors/Cell/CellDesign.tsx +53 -22
  103. package/src/constructors/Cell/basicTypes.ts +33 -0
  104. package/src/constructors/Cell/properties.json +52 -52
  105. package/src/constructors/Cell/props.ts +16 -13
  106. package/src/constructors/Cell/style.scss +1 -1
  107. package/src/constructors/Cell/types.ts +3 -3
  108. package/src/constructors/Chip/ChipDesign.tsx +5 -5
  109. package/src/constructors/Chip/ChipInclude.ts +83 -0
  110. package/src/constructors/Chip/basicTypes.ts +12 -0
  111. package/src/constructors/Chip/index.ts +2 -0
  112. package/src/constructors/Chip/properties.json +3 -3
  113. package/src/constructors/Chip/types.ts +5 -5
  114. package/src/constructors/ChipGroup/ChipGroup.ts +74 -0
  115. package/src/constructors/ChipGroup/ChipGroupDesign.tsx +162 -0
  116. package/src/constructors/ChipGroup/basicTypes.ts +6 -0
  117. package/src/constructors/ChipGroup/index.ts +5 -0
  118. package/src/constructors/ChipGroup/properties.json +3 -0
  119. package/src/constructors/ChipGroup/props.ts +50 -0
  120. package/src/constructors/ChipGroup/style.scss +6 -0
  121. package/src/constructors/ChipGroup/types.ts +47 -0
  122. package/src/constructors/Dialog/Dialog.ts +145 -0
  123. package/src/constructors/Dialog/DialogDesign.tsx +135 -0
  124. package/src/constructors/Dialog/basicTypes.ts +0 -0
  125. package/src/constructors/Dialog/index.ts +5 -0
  126. package/src/constructors/Dialog/properties.json +23 -0
  127. package/src/constructors/Dialog/props.ts +76 -0
  128. package/src/constructors/Dialog/style.scss +18 -0
  129. package/src/constructors/Dialog/types.ts +67 -0
  130. package/src/constructors/Field/Field.ts +58 -19
  131. package/src/constructors/Field/FieldDesign.tsx +35 -17
  132. package/src/constructors/Field/FieldInclude.ts +141 -11
  133. package/src/constructors/Field/basicTypes.ts +35 -19
  134. package/src/constructors/Field/properties.json +92 -86
  135. package/src/constructors/Field/props.ts +6 -3
  136. package/src/constructors/Field/style.scss +36 -20
  137. package/src/constructors/Field/types.ts +13 -13
  138. package/src/constructors/FieldCounter/FieldCounterDesign.tsx +1 -0
  139. package/src/constructors/FieldCounter/FieldCounterInclude.ts +3 -1
  140. package/src/constructors/FieldCounter/basicTypes.ts +1 -0
  141. package/src/constructors/FieldCounter/properties.json +3 -3
  142. package/src/constructors/FieldCounter/props.ts +5 -2
  143. package/src/constructors/FieldCounter/types.ts +1 -1
  144. package/src/constructors/FieldLabel/FieldLabelDesign.tsx +6 -2
  145. package/src/constructors/FieldLabel/FieldLabelInclude.ts +13 -4
  146. package/src/constructors/FieldLabel/properties.json +4 -4
  147. package/src/constructors/FieldLabel/props.ts +2 -2
  148. package/src/constructors/FieldLabel/types.ts +2 -2
  149. package/src/constructors/FieldMessage/FieldMessage.ts +19 -0
  150. package/src/constructors/FieldMessage/FieldMessageDesign.tsx +36 -4
  151. package/src/constructors/FieldMessage/FieldMessageInclude.ts +11 -1
  152. package/src/constructors/FieldMessage/basicTypes.ts +15 -1
  153. package/src/constructors/FieldMessage/properties.json +10 -9
  154. package/src/constructors/FieldMessage/props.ts +4 -0
  155. package/src/constructors/FieldMessage/style.scss +16 -1
  156. package/src/constructors/FieldMessage/types.ts +4 -2
  157. package/src/constructors/Icon/Icon.ts +37 -2
  158. package/src/constructors/Icon/IconDesign.tsx +46 -39
  159. package/src/constructors/Icon/properties.json +25 -25
  160. package/src/constructors/Icon/props.ts +22 -16
  161. package/src/constructors/Icon/types.ts +1 -1
  162. package/src/constructors/Image/Image.ts +68 -10
  163. package/src/constructors/Image/ImageBackground.ts +15 -2
  164. package/src/constructors/Image/ImageCoordinator.ts +4 -2
  165. package/src/constructors/Image/ImageData.ts +4 -0
  166. package/src/constructors/Image/ImageDesign.tsx +81 -15
  167. package/src/constructors/Image/ImageFile.ts +2 -13
  168. package/src/constructors/Image/ImageImg.ts +218 -0
  169. package/src/constructors/Image/ImagePdf.ts +2 -2
  170. package/src/constructors/Image/basicTypes.ts +5 -0
  171. package/src/constructors/Image/properties.json +17 -17
  172. package/src/constructors/Image/props.ts +34 -7
  173. package/src/constructors/Image/style.scss +42 -0
  174. package/src/constructors/Image/types.ts +1 -1
  175. package/src/constructors/Input/Input.ts +146 -0
  176. package/src/constructors/Input/InputDesign.tsx +174 -0
  177. package/src/constructors/Input/InputPassword.ts +54 -0
  178. package/src/constructors/Input/basicTypes.ts +3 -0
  179. package/src/constructors/Input/index.ts +5 -0
  180. package/src/constructors/Input/properties.json +2 -0
  181. package/src/constructors/Input/props.ts +53 -0
  182. package/src/constructors/Input/style.scss +5 -0
  183. package/src/constructors/Input/types.ts +48 -0
  184. package/src/constructors/List/List.ts +36 -11
  185. package/src/constructors/List/ListControl.ts +2 -2
  186. package/src/constructors/List/ListDesign.tsx +59 -38
  187. package/src/constructors/List/ListGo.ts +5 -3
  188. package/src/constructors/List/properties.json +16 -16
  189. package/src/constructors/List/props.ts +7 -0
  190. package/src/constructors/List/style.scss +14 -0
  191. package/src/constructors/List/types.ts +9 -9
  192. package/src/constructors/ListGroup/ListGroupDesign.tsx +8 -3
  193. package/src/constructors/ListGroup/basicTypes.ts +7 -0
  194. package/src/constructors/ListGroup/properties.json +15 -15
  195. package/src/constructors/ListGroup/props.ts +4 -4
  196. package/src/constructors/ListGroup/types.ts +2 -1
  197. package/src/constructors/ListItem/ListItem.ts +67 -7
  198. package/src/constructors/ListItem/ListItemDesign.tsx +13 -10
  199. package/src/constructors/ListItem/properties.json +52 -52
  200. package/src/constructors/ListItem/props.ts +24 -15
  201. package/src/constructors/ListItem/types.ts +12 -12
  202. package/src/constructors/ListMenu/ListMenu.ts +2 -1
  203. package/src/constructors/ListMenu/ListMenuDesign.tsx +3 -3
  204. package/src/constructors/ListMenu/properties.json +19 -19
  205. package/src/constructors/ListMenu/types.ts +3 -3
  206. package/src/constructors/Mask/MaskDesign.tsx +33 -28
  207. package/src/constructors/Mask/MaskEvent.ts +41 -2
  208. package/src/constructors/Mask/MaskInclude.ts +147 -0
  209. package/src/constructors/Mask/basicTypes.ts +19 -1
  210. package/src/constructors/Mask/properties.json +30 -29
  211. package/src/constructors/Mask/props.ts +1 -1
  212. package/src/constructors/Mask/style.scss +2 -4
  213. package/src/constructors/Mask/types.ts +4 -4
  214. package/src/constructors/Menu/Menu.ts +17 -5
  215. package/src/constructors/Menu/MenuDesign.tsx +11 -11
  216. package/src/constructors/Menu/MenuGo.ts +72 -0
  217. package/src/constructors/Menu/MenuInclude.ts +20 -10
  218. package/src/constructors/Menu/MenuSearch.ts +20 -1
  219. package/src/constructors/Menu/MenuValue.ts +7 -3
  220. package/src/constructors/Menu/MenuWindow.ts +2 -1
  221. package/src/constructors/Menu/basicTypes.ts +21 -4
  222. package/src/constructors/Menu/properties.json +17 -17
  223. package/src/constructors/Menu/props.ts +15 -3
  224. package/src/constructors/Menu/types.ts +6 -16
  225. package/src/constructors/Modal/Modal.ts +53 -0
  226. package/src/constructors/Modal/ModalAbstract.ts +74 -0
  227. package/src/constructors/Modal/ModalDesign.tsx +63 -0
  228. package/src/constructors/Modal/ModalDesignAbstract.tsx +226 -0
  229. package/src/constructors/Modal/basicTypes.ts +0 -0
  230. package/src/constructors/Modal/index.ts +5 -0
  231. package/src/constructors/Modal/properties.json +17 -0
  232. package/src/constructors/Modal/props.ts +45 -0
  233. package/src/constructors/Modal/style.scss +20 -0
  234. package/src/constructors/Modal/types.ts +62 -0
  235. package/src/constructors/MotionTransform/MotionTransform.ts +65 -8
  236. package/src/constructors/MotionTransform/MotionTransformDesign.tsx +55 -21
  237. package/src/constructors/MotionTransform/MotionTransformElement.ts +7 -2
  238. package/src/constructors/MotionTransform/MotionTransformInclude.ts +2 -1
  239. package/src/constructors/MotionTransform/MotionTransformState.ts +5 -0
  240. package/src/constructors/MotionTransform/basicTypes.ts +18 -2
  241. package/src/constructors/MotionTransform/properties.json +35 -35
  242. package/src/constructors/MotionTransform/props.ts +13 -7
  243. package/src/constructors/MotionTransform/style.scss +24 -2
  244. package/src/constructors/MotionTransform/types.ts +7 -7
  245. package/src/constructors/Progress/Progress.ts +12 -2
  246. package/src/constructors/Progress/ProgressDesign.tsx +75 -53
  247. package/src/constructors/Progress/ProgressInclude.ts +13 -1
  248. package/src/constructors/Progress/properties.json +47 -47
  249. package/src/constructors/Progress/props.ts +5 -1
  250. package/src/constructors/Progress/style.scss +2 -2
  251. package/src/constructors/Progress/types.ts +4 -4
  252. package/src/constructors/Ripple/Ripple.ts +1 -1
  253. package/src/constructors/Ripple/RippleDesign.tsx +7 -4
  254. package/src/constructors/Ripple/RippleItem.ts +1 -1
  255. package/src/constructors/Ripple/style.scss +4 -0
  256. package/src/constructors/Ripple/types.ts +2 -2
  257. package/src/constructors/Scrollbar/Scrollbar.ts +3 -3
  258. package/src/constructors/Scrollbar/ScrollbarDesign.tsx +1 -1
  259. package/src/constructors/Scrollbar/properties.json +33 -33
  260. package/src/constructors/Scrollbar/types.ts +1 -1
  261. package/src/constructors/Section/Section.ts +33 -0
  262. package/src/constructors/Section/SectionDesign.tsx +127 -0
  263. package/src/constructors/Section/basicTypes.ts +0 -0
  264. package/src/constructors/Section/index.ts +5 -0
  265. package/src/constructors/Section/properties.json +2 -0
  266. package/src/constructors/Section/props.ts +29 -0
  267. package/src/constructors/Section/style.scss +5 -0
  268. package/src/constructors/Section/types.ts +47 -0
  269. package/src/constructors/Select/Select.ts +172 -0
  270. package/src/constructors/Select/SelectDesign.tsx +288 -0
  271. package/src/constructors/Select/SelectFilter.ts +43 -0
  272. package/src/constructors/Select/SelectInput.ts +68 -0
  273. package/src/constructors/Select/basicTypes.ts +0 -0
  274. package/src/constructors/Select/index.ts +5 -0
  275. package/src/constructors/Select/properties.json +3 -0
  276. package/src/constructors/Select/props.ts +63 -0
  277. package/src/constructors/Select/style.scss +5 -0
  278. package/src/constructors/Select/types.ts +53 -0
  279. package/src/constructors/SelectValue/SelectValue.ts +95 -0
  280. package/src/constructors/SelectValue/SelectValueDesign.tsx +198 -0
  281. package/src/constructors/SelectValue/SelectValueInclude.ts +92 -0
  282. package/src/constructors/SelectValue/basicTypes.ts +17 -0
  283. package/src/constructors/SelectValue/index.ts +6 -0
  284. package/src/constructors/SelectValue/properties.json +7 -0
  285. package/src/constructors/SelectValue/props.ts +48 -0
  286. package/src/constructors/SelectValue/style.scss +14 -0
  287. package/src/constructors/SelectValue/types.ts +47 -0
  288. package/src/constructors/Skeleton/Skeleton.ts +1 -3
  289. package/src/constructors/Skeleton/SkeletonDesign.tsx +7 -1
  290. package/src/constructors/Skeleton/SkeletonInclude.ts +5 -0
  291. package/src/constructors/Skeleton/properties.json +24 -24
  292. package/src/constructors/Skeleton/types.ts +1 -1
  293. package/src/constructors/TextareaAutosize/TextareaAutosize.ts +41 -0
  294. package/src/constructors/TextareaAutosize/TextareaAutosizeDesign.tsx +147 -0
  295. package/src/constructors/TextareaAutosize/TextareaAutosizeResize.ts +109 -0
  296. package/src/constructors/TextareaAutosize/TextareaAutosizeValue.ts +69 -0
  297. package/src/constructors/TextareaAutosize/basicTypes.ts +0 -0
  298. package/src/constructors/TextareaAutosize/index.ts +5 -0
  299. package/src/constructors/TextareaAutosize/properties.json +6 -0
  300. package/src/constructors/TextareaAutosize/props.ts +34 -0
  301. package/src/constructors/TextareaAutosize/style.scss +31 -0
  302. package/src/constructors/TextareaAutosize/types.ts +50 -0
  303. package/src/constructors/Tooltip/Tooltip.ts +138 -0
  304. package/src/constructors/Tooltip/TooltipClasses.ts +90 -0
  305. package/src/constructors/Tooltip/TooltipDesign.tsx +198 -0
  306. package/src/constructors/Tooltip/TooltipEvent.ts +103 -0
  307. package/src/constructors/Tooltip/TooltipInclude.ts +114 -0
  308. package/src/constructors/Tooltip/TooltipOpen.ts +128 -0
  309. package/src/constructors/Tooltip/TooltipPosition.ts +92 -0
  310. package/src/constructors/Tooltip/TooltipStatus.ts +97 -0
  311. package/src/constructors/Tooltip/TooltipStyle.ts +123 -0
  312. package/src/constructors/Tooltip/basicTypes.ts +39 -0
  313. package/src/constructors/Tooltip/index.ts +6 -0
  314. package/src/constructors/Tooltip/properties.json +14 -0
  315. package/src/constructors/Tooltip/props.ts +49 -0
  316. package/src/constructors/Tooltip/style.scss +43 -0
  317. package/src/constructors/Tooltip/types.ts +58 -0
  318. package/src/constructors/Window/Window.ts +52 -16
  319. package/src/constructors/Window/WindowClasses.ts +33 -0
  320. package/src/constructors/Window/WindowClient.ts +39 -0
  321. package/src/constructors/Window/WindowDesign.tsx +31 -14
  322. package/src/constructors/Window/WindowEsc.ts +114 -0
  323. package/src/constructors/Window/WindowHidden.ts +120 -0
  324. package/src/constructors/Window/WindowInclude.ts +2 -2
  325. package/src/constructors/Window/WindowOpen.ts +10 -1
  326. package/src/constructors/Window/WindowOrigin.ts +5 -1
  327. package/src/constructors/Window/WindowStatic.ts +3 -1
  328. package/src/constructors/Window/WindowVerification.ts +8 -5
  329. package/src/constructors/Window/basicTypes.ts +26 -16
  330. package/src/constructors/Window/properties.json +239 -236
  331. package/src/constructors/Window/props.ts +10 -1
  332. package/src/constructors/Window/style.scss +11 -0
  333. package/src/constructors/Window/types.ts +2 -2
  334. package/src/functions/{getClassTegAStatic.ts → getClassTagAStatic.ts} +1 -1
  335. package/src/library.ts +13 -1
  336. package/src/types/ariaTypes.ts +366 -0
  337. package/src/types/descriptionTypes.ts +8 -0
  338. package/src/types/fieldTypes.ts +120 -16
  339. package/src/types/labelTypes.ts +39 -0
  340. package/src/types/modelTypes.ts +16 -0
  341. package/src/types/roleTypes.ts +88 -0
  342. package/src/types/textTypes.ts +33 -0
  343. package/src/types/touchEventTypes.ts +43 -0
@@ -0,0 +1,198 @@
1
+ import { h, Teleport, type VNode } from 'vue'
2
+ import {
3
+ type ConstrOptions,
4
+ type ConstrStyles,
5
+ DesignConstructorAbstract
6
+ } from '@dxtmisha/functional'
7
+
8
+ import { AriaStaticInclude } from '../../classes/AriaStaticInclude'
9
+ import { Tooltip } from './Tooltip'
10
+
11
+ import {
12
+ type TooltipPropsBasic
13
+ } from './props'
14
+ import {
15
+ type TooltipClasses,
16
+ type TooltipComponents,
17
+ type TooltipEmits,
18
+ type TooltipExpose,
19
+ type TooltipSlots
20
+ } from './types'
21
+
22
+ /**
23
+ * TooltipDesign
24
+ */
25
+ export class TooltipDesign<
26
+ COMP extends TooltipComponents,
27
+ EXPOSE extends TooltipExpose,
28
+ CLASSES extends TooltipClasses,
29
+ P extends TooltipPropsBasic
30
+ > extends DesignConstructorAbstract<
31
+ HTMLDivElement,
32
+ COMP,
33
+ TooltipEmits,
34
+ EXPOSE,
35
+ TooltipSlots,
36
+ CLASSES,
37
+ P
38
+ > {
39
+ protected readonly item: Tooltip
40
+
41
+ /**
42
+ * Constructor
43
+ * @param name class name/ название класса
44
+ * @param props properties/ свойства
45
+ * @param options list of additional parameters/ список дополнительных параметров
46
+ * @param ItemConstructor tooltip item class/ класс элемента тултипа
47
+ */
48
+ constructor(
49
+ name: string,
50
+ props: Readonly<P>,
51
+ options?: ConstrOptions<COMP, TooltipEmits, P>,
52
+ ItemConstructor: typeof Tooltip = Tooltip
53
+ ) {
54
+ super(
55
+ name,
56
+ props,
57
+ options
58
+ )
59
+
60
+ this.item = new ItemConstructor(
61
+ this.props,
62
+ this.refs,
63
+ this.element,
64
+ this.getDesign(),
65
+ this.getName(),
66
+ this.components,
67
+ this.slots,
68
+ this.emits
69
+ )
70
+
71
+ this.init()
72
+ }
73
+
74
+ /**
75
+ * Initialization of all the necessary properties for work
76
+ *
77
+ * Инициализация всех необходимых свойств для работы.
78
+ */
79
+ protected initExpose(): EXPOSE {
80
+ return {
81
+ toggle: this.item.open.toggle
82
+ } as EXPOSE
83
+ }
84
+
85
+ /**
86
+ * Improvement of the obtained list of classes.
87
+ *
88
+ * Доработка полученного списка классов.
89
+ */
90
+ protected initClasses(): Partial<CLASSES> {
91
+ return {
92
+ main: {},
93
+ ...{
94
+ // :classes [!] System label / Системная метка
95
+ label: this.getSubClass('label'),
96
+ description: this.getSubClass('description'),
97
+ body: this.getSubClass('body')
98
+ // :classes [!] System label / Системная метка
99
+ }
100
+ } as Partial<CLASSES>
101
+ }
102
+
103
+ /**
104
+ * Refinement of the received list of styles.
105
+ *
106
+ * Доработка полученного списка стилей.
107
+ */
108
+ protected initStyles(): ConstrStyles {
109
+ return {}
110
+ }
111
+
112
+ /**
113
+ * A method for rendering.
114
+ *
115
+ * Метод для рендеринга.
116
+ */
117
+ protected initRender(): VNode[] {
118
+ return [
119
+ ...this.renderControl(),
120
+ ...this.renderTooltip()
121
+ ]
122
+ }
123
+
124
+ /**
125
+ * Rendering of the control slot.
126
+ *
127
+ * Рендеринг слота управления.
128
+ */
129
+ protected readonly renderControl = (): VNode[] => {
130
+ return [
131
+ this.initSlot('control', undefined, this.item.slotData) as VNode
132
+ ]
133
+ }
134
+
135
+ /**
136
+ * Rendering of the tooltip.
137
+ *
138
+ * Рендеринг тултипа.
139
+ */
140
+ protected readonly renderTooltip = (): VNode[] => {
141
+ if (this.item.status.isShow.value) {
142
+ const children: any[] = [
143
+ ...this.item.label.render(),
144
+ ...this.item.description.render(),
145
+ ...this.renderBody()
146
+ ]
147
+
148
+ if (this.item.status.isArray.value) {
149
+ children.push(
150
+ ...this.item.arrow.render()
151
+ )
152
+ }
153
+
154
+ return [
155
+ h(
156
+ Teleport,
157
+ {
158
+ key: 'teleport',
159
+ to: 'body'
160
+ },
161
+ h(
162
+ 'div',
163
+ {
164
+ ref: this.element,
165
+ id: this.item.classes.getIdItem(),
166
+ class: this.classes?.value.main,
167
+ onMouseover: this.item.event.onMouseoverTooltip,
168
+ onMouseout: this.item.event.onMouseout,
169
+ onTransitionend: this.item.event.onTransitionend,
170
+ ...AriaStaticInclude.role('tooltip')
171
+ },
172
+ children
173
+ )
174
+ )
175
+ ]
176
+ }
177
+
178
+ return []
179
+ }
180
+
181
+ /**
182
+ * Rendering of the body slot.
183
+ *
184
+ * Рендеринг слота тела.
185
+ */
186
+ protected readonly renderBody = (): VNode[] => {
187
+ if (
188
+ this.slots
189
+ && 'body' in this.slots
190
+ ) {
191
+ return [
192
+ this.initSlot('body') as VNode
193
+ ]
194
+ }
195
+
196
+ return []
197
+ }
198
+ }
@@ -0,0 +1,103 @@
1
+ import { TooltipOpen } from './TooltipOpen'
2
+ import { TooltipStatus } from './TooltipStatus'
3
+ import { TooltipClasses } from './TooltipClasses'
4
+ import { TooltipStyle } from './TooltipStyle.ts'
5
+
6
+ /**
7
+ * Class for working with events.
8
+ *
9
+ * Класс для работы с событиями.
10
+ */
11
+ export class TooltipEvent {
12
+ protected next: boolean = false
13
+ protected timeout?: any
14
+
15
+ /**
16
+ * Constructor
17
+ * @param classes object for working with the class/ объект для работы с классом
18
+ * @param style object for working with styles/ объект для работы со стилями
19
+ * @param status object for working with statuses/ объект для работы со статусами
20
+ * @param open data opening management/ управление открытием данных
21
+ */
22
+ constructor(
23
+ protected readonly classes: TooltipClasses,
24
+ protected readonly style: TooltipStyle,
25
+ protected readonly status: TooltipStatus,
26
+ protected readonly open: TooltipOpen
27
+ ) {
28
+ }
29
+
30
+ /**
31
+ * Events on clicking an element in a mobile application.
32
+ *
33
+ * События при клике на элементе в мобильном приложении.
34
+ */
35
+ readonly onClick = () => {
36
+ requestAnimationFrame(async () => {
37
+ if (!this.next) {
38
+ clearTimeout(this.timeout)
39
+ await this.open.toggle(!this.status.open.value, true)
40
+ this.next = false
41
+ }
42
+ })
43
+ }
44
+
45
+ /**
46
+ * Element management events on receiving focus.
47
+ *
48
+ * События управления элементом при получении фокуса.
49
+ * @param target selected element/ выбранный элемент
50
+ */
51
+ readonly onMouseover = ({ target }: MouseEvent): void => {
52
+ clearTimeout(this.timeout)
53
+ this.next = true
54
+
55
+ requestAnimationFrame(async () => {
56
+ await this.open.toggle(
57
+ Boolean(this.classes.findControlByTarget(target as HTMLDivElement))
58
+ )
59
+
60
+ this.timeout = setTimeout(() => {
61
+ this.next = false
62
+ }, 640)
63
+ })
64
+ }
65
+
66
+ /**
67
+ * Element management events on receiving focus on the tooltip itself.
68
+ *
69
+ * События управления элементом при получении фокуса на самом тултипе.
70
+ */
71
+ readonly onMouseoverTooltip = (): void => {
72
+ this.open.noHide()
73
+ }
74
+
75
+ /**
76
+ * Element management events on losing focus.
77
+ *
78
+ * События управления элементом при потере фокуса.
79
+ * @param relatedTarget selected element/ выбранный элемент
80
+ */
81
+ readonly onMouseout = ({ relatedTarget }: MouseEvent): void => {
82
+ if (relatedTarget) {
83
+ this.open.toggle(
84
+ Boolean(this.classes.findControlByTarget(relatedTarget as HTMLDivElement))
85
+ ).then()
86
+ }
87
+ }
88
+
89
+ /**
90
+ * Event of the end of the transition.
91
+ *
92
+ * Событие окончания трансформации.
93
+ * @param event event data/ данные события
94
+ */
95
+ readonly onTransitionend = (event: TransitionEvent): void => {
96
+ if (
97
+ event.propertyName === 'transform'
98
+ && this.status.open.value
99
+ ) {
100
+ this.style.setMove(true)
101
+ }
102
+ }
103
+ }
@@ -0,0 +1,114 @@
1
+ import { computed, ref, type VNode } from 'vue'
2
+ import {
3
+ type ConstrBind,
4
+ DesignComponents,
5
+ getRef,
6
+ type RefOrNormal,
7
+ toBinds
8
+ } from '@dxtmisha/functional'
9
+
10
+ import type { TooltipComponentInclude, TooltipPropsInclude } from './basicTypes'
11
+ import type { TooltipExpose, TooltipSlots } from './types'
12
+ import type { TooltipProps } from './props'
13
+
14
+ /**
15
+ * TooltipInclude class provides functionality for conditionally rendering tooltip components
16
+ * within other components. It manages the logic for determining when to display tooltip
17
+ * and configures the appropriate properties.
18
+ *
19
+ * Класс TooltipInclude предоставляет функциональность для условного рендеринга компонентов
20
+ * подсказки внутри других компонентов. Он управляет логикой определения необходимости
21
+ * отображения подсказки и настраивает соответствующие свойства.
22
+ */
23
+ export class TooltipInclude<
24
+ Props extends TooltipPropsInclude = TooltipPropsInclude,
25
+ PropsExtra extends ConstrBind<TooltipProps> = ConstrBind<TooltipProps>
26
+ > {
27
+ readonly element = ref<TooltipExpose>()
28
+
29
+ /**
30
+ * Constructor
31
+ * @param props input parameter/ входной параметр
32
+ * @param className class name/ название класса
33
+ * @param components object for working with components/ объект для работы с компонентами
34
+ * @param extra additional parameter or property name/ дополнительный параметр или имя свойства
35
+ * @param index index identifier/ идентификатор индекса
36
+ */
37
+ constructor(
38
+ protected readonly props: Readonly<Props>,
39
+ protected readonly className: string,
40
+ protected readonly components?: DesignComponents<TooltipComponentInclude, Props>,
41
+ protected readonly extra?: RefOrNormal<PropsExtra>,
42
+ protected readonly index?: string
43
+ ) {
44
+ }
45
+
46
+ /** Computed bindings for the tooltip/ Вычисляемые привязки для подсказки */
47
+ readonly binds = computed<PropsExtra>(() => {
48
+ return toBinds<PropsExtra>(
49
+ getRef(this.extra),
50
+ this.props.tooltipAttrs,
51
+ {
52
+ ref: this.element,
53
+ class: `${this.className}__tooltip`
54
+ }
55
+ )
56
+ })
57
+
58
+ /**
59
+ * Render the Tooltip component
60
+ *
61
+ * Рендер компонента подсказки
62
+ */
63
+ readonly render = (
64
+ slotsChildren: TooltipSlots
65
+ ): VNode[] => {
66
+ if (this.components) {
67
+ return this.components.render(
68
+ 'tooltip',
69
+ this.binds.value,
70
+ slotsChildren as unknown as Record<string, any>,
71
+ this.index
72
+ )
73
+ }
74
+
75
+ return []
76
+ }
77
+
78
+ /**
79
+ * Get the tooltip element.
80
+ *
81
+ * Получить элемент подсказки.
82
+ */
83
+ getElement(): TooltipExpose | undefined {
84
+ return this.element.value
85
+ }
86
+
87
+ /**
88
+ * Open the tooltip.
89
+ *
90
+ * Открыть подсказку.
91
+ */
92
+ open() {
93
+ this.toggle(true)
94
+ }
95
+
96
+ /**
97
+ * Close the tooltip.
98
+ *
99
+ * Закрыть подсказку.
100
+ */
101
+ close() {
102
+ this.toggle(false)
103
+ }
104
+
105
+ /**
106
+ * Toggle the tooltip.
107
+ *
108
+ * Переключить подсказку.
109
+ * @param open open status/ статус открытия
110
+ */
111
+ toggle(open: boolean): void {
112
+ this.getElement()?.toggle(open)
113
+ }
114
+ }
@@ -0,0 +1,128 @@
1
+ import { nextTick, type ToRefs, watch } from 'vue'
2
+ import { type ConstrEmit, EventItem } from '@dxtmisha/functional'
3
+
4
+ import { TooltipStyle } from './TooltipStyle'
5
+ import { TooltipStatus } from './TooltipStatus'
6
+ import { TooltipPosition } from './TooltipPosition'
7
+
8
+ import type { TooltipProps } from './props'
9
+ import type { TooltipEmits } from './types.ts'
10
+
11
+ /**
12
+ * Class for managing the status of an open window.
13
+ *
14
+ * Класс для управления статусом открытого окна.
15
+ */
16
+ export class TooltipOpen {
17
+ protected timeout?: any
18
+ protected timeoutHide?: any
19
+ protected timeoutTo?: any
20
+
21
+ protected readonly event: EventItem<Window, Event, any>
22
+
23
+ /**
24
+ * Constructor
25
+ * @param props input data/ входные данные
26
+ * @param refs input data in the form of reactive elements/ входные данные в виде реактивных элементов
27
+ * @param style object for working with styles/ объект для работы со стилями
28
+ * @param status object for working with statuses/ объект для работы со статусами
29
+ * @param position object for working with the position of the element/ объект для работы с положением элемента
30
+ * @param emits the function is called when an event is triggered/ функция вызывается, когда срабатывает событие
31
+ */
32
+ constructor(
33
+ protected readonly props: Readonly<TooltipProps>,
34
+ refs: ToRefs<TooltipProps>,
35
+ protected readonly style: TooltipStyle,
36
+ protected readonly status: TooltipStatus,
37
+ protected readonly position: TooltipPosition,
38
+ protected readonly emits?: ConstrEmit<TooltipEmits>
39
+ ) {
40
+ this.event = new EventItem(window, ['scroll-sync'], this.onScroll)
41
+
42
+ watch([refs.open], () => {
43
+ this.toggle(Boolean(this.props.open)).then()
44
+ }, { immediate: this.props.open })
45
+ }
46
+
47
+ /**
48
+ * Element display management.
49
+ *
50
+ * Управление отображением элемента.
51
+ * @param open display status/ статус отображения
52
+ * @param flesh immediate display without delay/ мгновенное отображение без задержки
53
+ */
54
+ readonly toggle = async (
55
+ open: boolean,
56
+ flesh?: boolean
57
+ ) => {
58
+ if (
59
+ this.status.isText.value
60
+ && !this.status.isMatch(open)
61
+ ) {
62
+ clearTimeout(this.timeout)
63
+ clearTimeout(this.timeoutHide)
64
+
65
+ if (open) {
66
+ this.status.setOpen(open)
67
+ this.status.setShow(true)
68
+
69
+ await nextTick()
70
+ this.position.update()
71
+ this.status.setPreparation(true)
72
+ await nextTick()
73
+
74
+ requestAnimationFrame(() => {
75
+ this.timeout = setTimeout(() => {
76
+ this.style.setPreparation(true)
77
+ requestAnimationFrame(() => {
78
+ this.style.setShow(true)
79
+ this.event.start()
80
+ this.emits?.('tooltip', true)
81
+
82
+ if (this.props.delayHide) {
83
+ this.timeoutHide = setTimeout(() => this.toggle(false), Number(this.props.delayHide))
84
+ }
85
+ })
86
+ }, flesh ? 48 : this.props.delay)
87
+ })
88
+ } else {
89
+ this.timeoutTo = setTimeout(() => {
90
+ this.status.setOpen(open)
91
+ this.style.resetShow()
92
+ this.event.stop()
93
+
94
+ this.timeout = setTimeout(() => {
95
+ this.status.setShow(false)
96
+ this.status.setPreparation(false)
97
+ this.emits?.('tooltip', false)
98
+ }, 128)
99
+ }, flesh ? 48 : 256)
100
+ }
101
+ }
102
+ }
103
+
104
+ /**
105
+ * Cancel hiding the element.
106
+ *
107
+ * Отмена скрытия элемента.
108
+ */
109
+ noHide() {
110
+ clearTimeout(this.timeoutTo)
111
+ }
112
+
113
+ /**
114
+ * Start listening to scroll events.
115
+ *
116
+ * Запуск прослушивания событий скролла.
117
+ */
118
+ eventStop() {
119
+ this.event.stop()
120
+ }
121
+
122
+ /**
123
+ * Scroll event management.
124
+ *
125
+ * Управление событиями скролла.
126
+ */
127
+ protected readonly onScroll = () => this.toggle(false, true)
128
+ }
@@ -0,0 +1,92 @@
1
+ import { type Ref } from 'vue'
2
+
3
+ import { TooltipClasses } from './TooltipClasses'
4
+ import { TooltipStyle } from './TooltipStyle'
5
+
6
+ import type { TooltipProps } from './props'
7
+
8
+ /**
9
+ * A class for working with position.
10
+ *
11
+ * Класс для работы с позицией.
12
+ */
13
+ export class TooltipPosition {
14
+ /**
15
+ * Constructor
16
+ * @param props input data/ входные данные
17
+ * @param element instance of the element itself/ экземпляр самого элемента
18
+ * @param classes object for working with the class/ объект для работы с классом
19
+ * @param style object for working with styles/ объект для работы со стилями
20
+ */
21
+ constructor(
22
+ protected readonly props: Readonly<TooltipProps>,
23
+ protected readonly element: Ref<HTMLDivElement | undefined>,
24
+ protected readonly classes: TooltipClasses,
25
+ protected readonly style: TooltipStyle
26
+ ) {
27
+ }
28
+
29
+ /**
30
+ * Update all sizes.
31
+ *
32
+ * Обновить все размеры.
33
+ */
34
+ update() {
35
+ const element = this.element.value
36
+ const control = this.classes.findControl()
37
+
38
+ if (
39
+ element
40
+ && control
41
+ ) {
42
+ const rect = control.getBoundingClientRect()
43
+ const tooltipRect = element.getBoundingClientRect()
44
+ const indent = this.getIndent()
45
+
46
+ const top = this.isTop(rect, tooltipRect)
47
+ const x = rect.left + (rect.width / 2) - (tooltipRect.width / 2)
48
+ const y = top ? rect.top - tooltipRect.height - indent : rect.bottom + indent
49
+
50
+ let shift = 0
51
+
52
+ if (x < 0) {
53
+ shift = 0 - x
54
+ } else if (x + tooltipRect.width > window.innerWidth) {
55
+ shift = window.innerWidth - (x + tooltipRect.width)
56
+ }
57
+
58
+ this.style.set(
59
+ top,
60
+ x,
61
+ y,
62
+ shift
63
+ )
64
+ }
65
+ }
66
+
67
+ /**
68
+ * Checks whether the element should be displayed on top.
69
+ *
70
+ * Проверяет, надо ли отображать элемент сверху.
71
+ * @param rect the current position of the control element/ данное положение элемента контроля
72
+ * @param tooltipRect the current position of the element itself/ данное положение самого элемента
73
+ */
74
+ protected isTop(
75
+ rect: DOMRect,
76
+ tooltipRect: DOMRect
77
+ ) {
78
+ const indent = this.getIndent()
79
+
80
+ return (this.props.top && rect.top - tooltipRect.height - indent >= 0)
81
+ || (rect.bottom + tooltipRect.height + indent > window.innerHeight)
82
+ }
83
+
84
+ /**
85
+ * Returns the margins for the element.
86
+ *
87
+ * Возвращает отступы для элемента.
88
+ */
89
+ protected getIndent(): number {
90
+ return this.props.indent ?? 0
91
+ }
92
+ }