@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,97 @@
1
+ import { computed, ref } from 'vue'
2
+
3
+ import type { TooltipSlots } from './types'
4
+ import type { TooltipProps } from './props'
5
+
6
+ /**
7
+ * Class for working with display statuses.
8
+ *
9
+ * Класс для работы со статусами отображения.
10
+ */
11
+ export class TooltipStatus {
12
+ readonly open = ref(false)
13
+ readonly show = ref(false)
14
+ readonly preparation = ref(false)
15
+
16
+ /**
17
+ * Constructor
18
+ * @param props input data/ входные данные
19
+ * @param slots object for working with slots/ объект для работы со слотами
20
+ */
21
+ constructor(
22
+ protected readonly props: Readonly<TooltipProps>,
23
+ protected readonly slots?: TooltipSlots
24
+ ) {
25
+ }
26
+
27
+ /**
28
+ * Checks if there is text to display.
29
+ *
30
+ * Проверяет, есть ли текст для отображения.
31
+ */
32
+ readonly isText = computed<boolean>(() =>
33
+ !this.props.disabled
34
+ && Boolean(
35
+ this.props.label
36
+ || this.props.description
37
+ || (
38
+ this.slots
39
+ && (
40
+ 'default' in this.slots
41
+ || 'description' in this.slots
42
+ || 'body' in this.slots
43
+ )
44
+ )
45
+ )
46
+ )
47
+
48
+ /** Checks if the element needs to be displayed/ Проверяет, нужно ли отображать элемент */
49
+ readonly isShow = computed<boolean>(
50
+ () => Boolean(this.show.value || this.open.value || this.props.inDom) && this.isText.value
51
+ )
52
+
53
+ /** Checks if the content is an array/ Проверяет, является ли содержимое массивом */
54
+ readonly isArray = computed<boolean>(
55
+ () => Boolean(this.props.arrowShow && this.preparation.value)
56
+ )
57
+
58
+ /**
59
+ * Checks if the current status matches the selected one.
60
+ *
61
+ * Проверяет, соответствует ли текущий статус выбранному.
62
+ * @param open the value of the current state/ значение текущего состояния
63
+ */
64
+ isMatch(open: boolean): boolean {
65
+ return this.open.value === open
66
+ }
67
+
68
+ /**
69
+ * Changes the open state.
70
+ *
71
+ * Изменяет состояние открытия.
72
+ * @param open the value of the current state/ значение текущего состояния
73
+ */
74
+ setOpen(open: boolean) {
75
+ this.open.value = open
76
+ }
77
+
78
+ /**
79
+ * Changes the display state.
80
+ *
81
+ * Изменяет состояние показа.
82
+ * @param show the value of the current state/ значение текущего состояния
83
+ */
84
+ setShow(show: boolean) {
85
+ this.show.value = show
86
+ }
87
+
88
+ /**
89
+ * Changes the preparation status.
90
+ *
91
+ * Изменяет статус подготовки.
92
+ * @param preparation the value of the current state/ значение текущего состояния
93
+ */
94
+ setPreparation(preparation: boolean) {
95
+ this.preparation.value = preparation
96
+ }
97
+ }
@@ -0,0 +1,123 @@
1
+ import { type Ref } from 'vue'
2
+
3
+ /**
4
+ * Style management class.
5
+ *
6
+ * Класс управления стилями.
7
+ */
8
+ export class TooltipStyle {
9
+ /**
10
+ * Constructor
11
+ * @param element instance of the element itself/ экземпляр самого элемента
12
+ * @param className class name/ название класса
13
+ */
14
+ constructor(
15
+ protected readonly element: Ref<HTMLDivElement | undefined>,
16
+ protected readonly className: string
17
+ ) {
18
+ }
19
+
20
+ /**
21
+ * Changing styles.
22
+ *
23
+ * Изменение стилей.
24
+ * @param top should the element be placed on top/ нужно ли поместить элемент сверху
25
+ * @param x value of X/ значение X
26
+ * @param y value of Y/ значение Y
27
+ * @param shift value for shift/ значение для сдвига
28
+ */
29
+ set(
30
+ top: boolean,
31
+ x: number,
32
+ y: number,
33
+ shift: number
34
+ ) {
35
+ const element = this.element.value
36
+
37
+ if (element) {
38
+ element.classList.toggle(`${this.className}--top`, top)
39
+ element.style.setProperty(`--${this.className}-sys-x`, `${x}px`)
40
+ element.style.setProperty(`--${this.className}-sys-y`, `${y}px`)
41
+ element.style.setProperty(`--${this.className}-sys-shift`, `${shift}px`)
42
+ }
43
+ }
44
+
45
+ /**
46
+ * Changes the preparation status.
47
+ *
48
+ * Изменяет статус подготовки.
49
+ * @param status the value of the current state/ значение текущего состояния
50
+ */
51
+ setPreparation(status: boolean) {
52
+ const element = this.element.value
53
+
54
+ if (element) {
55
+ element.classList.toggle(`${this.className}--preparation`, status)
56
+ }
57
+ }
58
+
59
+ /**
60
+ * Changes the preparation status.
61
+ *
62
+ * Изменяет статус подготовки.
63
+ * @param status the value of the current state/ значение текущего состояния
64
+ */
65
+ setShow(status: boolean) {
66
+ const element = this.element.value
67
+
68
+ if (element) {
69
+ element.classList.toggle(`${this.className}--show`, status)
70
+
71
+ if (!status) {
72
+ this.setMove(status)
73
+ }
74
+ }
75
+ }
76
+
77
+ /**
78
+ * Changes the move status.
79
+ *
80
+ * Изменяет статус перемещения.
81
+ * @param status the value of the current state/ значение текущего состояния
82
+ */
83
+ setMove(status: boolean) {
84
+ const element = this.element.value
85
+
86
+ if (element) {
87
+ element.classList.toggle(`${this.className}--move`, status)
88
+ }
89
+ }
90
+
91
+ /**
92
+ * Reset all records to the initial state.
93
+ *
94
+ * Сброс всех записей до начального состояния.
95
+ */
96
+ reset() {
97
+ const element = this.element.value
98
+
99
+ if (element) {
100
+ element.classList.remove(`${this.className}--top`)
101
+ element.classList.remove(`${this.className}--preparation`)
102
+ element.classList.remove(`${this.className}--show`)
103
+
104
+ element.style.removeProperty(`--${this.className}-sys-x`)
105
+ element.style.removeProperty(`--${this.className}-sys-y`)
106
+ element.style.removeProperty(`--${this.className}-sys-shift`)
107
+ }
108
+ }
109
+
110
+ /**
111
+ * Resets the display state.
112
+ *
113
+ * Сбрасывает состояние показа.
114
+ */
115
+ resetShow() {
116
+ const element = this.element.value
117
+
118
+ if (element) {
119
+ element.classList.remove(`${this.className}--preparation`)
120
+ element.classList.remove(`${this.className}--show`)
121
+ }
122
+ }
123
+ }
@@ -0,0 +1,39 @@
1
+ import type { Ref } from 'vue'
2
+ import type { ConstrBind } from '@dxtmisha/functional'
3
+
4
+ import type { AriaList } from '../../types/ariaTypes'
5
+ import type { TooltipProps } from './props'
6
+
7
+ export type TooltipControlBinds
8
+ = AriaList
9
+ & {
10
+ class: string
11
+ onclick: () => void
12
+ onmouseover: (event: MouseEvent) => void
13
+ onmouseout: (event: MouseEvent) => void
14
+ }
15
+ export type TooltipControl
16
+ = TooltipControlBinds
17
+ & {
18
+ open: Ref<boolean>
19
+ binds: TooltipControlBinds
20
+ }
21
+
22
+ /**
23
+ * Component map for including the Tooltip component/
24
+ * Карта компонентов для подключения компонента Tooltip
25
+ */
26
+ export type TooltipComponentInclude = {
27
+ tooltip?: object
28
+ }
29
+
30
+ /**
31
+ * Props used to include and configure the Tooltip component/
32
+ * Свойства для подключения и настройки компонента Tooltip
33
+ */
34
+ export interface TooltipPropsInclude<
35
+ Tooltip extends TooltipProps = TooltipProps
36
+ > {
37
+ /** Additional attributes for Tooltip component/ Дополнительные атрибуты для компонента Tooltip */
38
+ tooltipAttrs?: ConstrBind<Tooltip>
39
+ }
@@ -0,0 +1,6 @@
1
+ export * from './Tooltip'
2
+ export * from './TooltipDesign'
3
+ export * from './TooltipInclude'
4
+ export * from './props'
5
+ export * from './types'
6
+ export * from './basicTypes'
@@ -0,0 +1,14 @@
1
+ {
2
+ "arrowSize": {
3
+ "_type": "var"
4
+ },
5
+ "paddingX": {
6
+ "_type": "var"
7
+ },
8
+ "paddingY": {
9
+ "_type": "var"
10
+ },
11
+ "#label": {},
12
+ "#description": {},
13
+ "#body": {}
14
+ }
@@ -0,0 +1,49 @@
1
+ import type { LabelProps } from '../../types/labelTypes'
2
+ import type { DescriptionProps } from '../../types/descriptionTypes'
3
+
4
+ import type { ArrowProps, ArrowPropsInclude } from '../Arrow'
5
+
6
+ interface TooltipPropsToken {
7
+ // :type [!] System label / Системная метка
8
+ // :type [!] System label / Системная метка
9
+ }
10
+
11
+ export interface TooltipPropsBasic<
12
+ Arrow extends ArrowProps = ArrowProps
13
+ > extends LabelProps,
14
+ DescriptionProps,
15
+ ArrowPropsInclude<Arrow> {
16
+ // Status
17
+ open?: boolean
18
+ disabled?: boolean
19
+
20
+ // Style
21
+ inDom?: boolean
22
+ top?: boolean
23
+ indent?: number
24
+ delay?: number
25
+ delayHide?: number
26
+ }
27
+
28
+ /**
29
+ * Type describing incoming properties.
30
+ *
31
+ * Тип, описывающий входящие свойства.
32
+ */
33
+ export interface TooltipProps extends TooltipPropsBasic, TooltipPropsToken {
34
+ }
35
+
36
+ /**
37
+ * Default value for property.
38
+ *
39
+ * Значение по умолчанию для свойства.
40
+ */
41
+ export const defaultsTooltip = {
42
+ indent: 4,
43
+ delay: 64,
44
+ delayHide: 0,
45
+ ...{
46
+ // :default [!] System label / Системная метка
47
+ // :default [!] System label / Системная метка
48
+ }
49
+ }
@@ -0,0 +1,43 @@
1
+ @use "@dxtmisha/styles/properties" as ui;
2
+
3
+ @mixin mixinTooltip {
4
+ @include ui.initByCustom('origin', -50%);
5
+
6
+ position: fixed;
7
+ top: calc(#{ui.v('??sys.y', 0px)});
8
+ left: calc(#{ui.v('??sys.x', 0px)} + #{ui.v('??sys.shift', 0px)});
9
+
10
+ @include ui.flexY;
11
+ align-items: stretch;
12
+ opacity: 0;
13
+ pointer-events: none;
14
+
15
+ @include ui.paddingX(ui.v('??paddingX'));
16
+ padding-top: ui.v('??paddingY');
17
+ padding-bottom: ui.v('??paddingY');
18
+
19
+ transition: opacity ui.v('d.sys.transitionDuration.xs') linear;
20
+ transform-origin: calc(50% - #{ui.v('??sys.shift', 0px)}) #{ui.v('??origin')};
21
+
22
+ z-index: 999999;
23
+
24
+ &--top {
25
+ @include ui.initByCustom('origin', 150%);
26
+ }
27
+
28
+ &--preparation {
29
+ transform: scale(0.4);
30
+ }
31
+
32
+ &--show {
33
+ opacity: 1;
34
+
35
+ transform: none;
36
+ transition: opacity ui.v('d.sys.transitionDuration.xs') linear,
37
+ transform ui.v('d.sys.transitionDuration.sm') ui.v('d.sys.transitionFunction.deceleration');
38
+ }
39
+
40
+ &--move {
41
+ pointer-events: unset;
42
+ }
43
+ }
@@ -0,0 +1,58 @@
1
+ import type { ConstrClass } from '@dxtmisha/functional'
2
+
3
+ import type { LabelSlots } from '../../types/labelTypes'
4
+ import type { DescriptionSlots } from '../../types/descriptionTypes'
5
+
6
+ import type { ArrowComponentInclude } from '../Arrow'
7
+
8
+ import type { TooltipControl } from './basicTypes'
9
+
10
+ /**
11
+ * Interface for describing which components need to be connected for work.
12
+ *
13
+ * Интерфейс для описания, какие компоненты надо подключить для работы.
14
+ */
15
+ export type TooltipComponents = ArrowComponentInclude
16
+
17
+ /**
18
+ * Type describing available events.
19
+ *
20
+ * Тип, описывающий доступные события.
21
+ */
22
+ export type TooltipEmits = {
23
+ tooltip: [open: boolean]
24
+ }
25
+
26
+ /**
27
+ * Type describing available properties.
28
+ *
29
+ * Тип, описывающий доступные свойства.
30
+ */
31
+ export interface TooltipExpose {
32
+ toggle(open: boolean, flash?: boolean): Promise<void>
33
+ }
34
+
35
+ /**
36
+ * Type describing available slots.
37
+ *
38
+ * Тип, описывающий доступные слоты.
39
+ */
40
+ export interface TooltipSlots extends LabelSlots, DescriptionSlots {
41
+ control?(props: TooltipControl): any
42
+
43
+ body?(): any
44
+ }
45
+
46
+ /**
47
+ * Type describing subclasses.
48
+ *
49
+ * Тип, описывающий подклассы.
50
+ */
51
+ export type TooltipClasses = {
52
+ main: ConstrClass
53
+ // :classes [!] System label / Системная метка
54
+ label: string
55
+ description: string
56
+ body: string
57
+ // :classes [!] System label / Системная метка
58
+ }
@@ -1,9 +1,12 @@
1
1
  import { computed, onMounted, onUnmounted, type Ref, type ToRefs, watch } from 'vue'
2
2
  import { type ConstrClassObject, type ConstrEmit, DesignComp } from '@dxtmisha/functional'
3
3
 
4
+ import { AriaStaticInclude } from '../../classes/AriaStaticInclude'
4
5
  import { ScrollbarInclude } from '../Scrollbar/ScrollbarInclude'
5
6
  import { ImageInclude } from '../Image/ImageInclude'
6
7
  import { ModelInclude } from '../../classes/ModelInclude'
8
+ import { TabIndexInclude } from '../../classes/TabIndexInclude'
9
+ import { TextInclude } from '../../classes/TextInclude'
7
10
 
8
11
  import { WindowClient } from './WindowClient'
9
12
  import { WindowHook } from './WindowHook'
@@ -24,6 +27,8 @@ import { WindowStyles } from './WindowStyles'
24
27
  import { WindowOpen } from './WindowOpen'
25
28
  import { WindowVerification } from './WindowVerification'
26
29
  import { WindowEvent } from './WindowEvent'
30
+ import { WindowEsc } from './WindowEsc'
31
+ import { WindowHidden } from './WindowHidden'
27
32
 
28
33
  import type { WindowControlItem } from './basicTypes'
29
34
  import type { WindowComponents, WindowEmits, WindowSlots } from './types'
@@ -48,6 +53,7 @@ export class Window {
48
53
  readonly classes: WindowClasses
49
54
  /** Element manager for window DOM element/ Менеджер элементов для DOM элемента окна */
50
55
  readonly element: WindowElement
56
+ readonly tabIndex: TabIndexInclude
51
57
 
52
58
  /** Status manager for window state/ Менеджер статуса для состояния окна */
53
59
  readonly status: WindowStatus
@@ -80,8 +86,13 @@ export class Window {
80
86
  /** Image manager for window content/ Менеджер изображений для содержимого окна */
81
87
  readonly image: ImageInclude
82
88
 
83
- /** Returns data for managing slot data/ Возвращает данные для управления данными слотами */
84
- readonly slotData: WindowControlItem
89
+ /** Escape key manager for window closing/ Менеджер клавиши Escape для закрытия окна */
90
+ readonly esc: WindowEsc
91
+
92
+ readonly text: TextInclude
93
+
94
+ /** Hidden manager for hiding elements outside the window when open/ Менеджер скрытия элементов вне окна при открытии */
95
+ readonly hidden: WindowHidden
85
96
 
86
97
  /**
87
98
  * Constructor
@@ -104,11 +115,14 @@ export class Window {
104
115
  protected readonly slots?: WindowSlots,
105
116
  protected readonly emits?: ConstrEmit<WindowEmits>
106
117
  ) {
107
- this.client = new WindowClient()
108
118
  this.hook = new WindowHook(props)
109
119
 
110
120
  this.classes = new WindowClasses(className)
111
121
  this.element = new WindowElement(this.classes, element)
122
+ this.client = new WindowClient(this.element)
123
+ this.tabIndex = new TabIndexInclude(
124
+ () => this.element.getBody()
125
+ )
112
126
 
113
127
  this.status = new WindowStatus(this.element)
114
128
  this.persistent = new WindowPersistent(props, this.classes, this.element)
@@ -131,6 +145,7 @@ export class Window {
131
145
  this.client,
132
146
  this.hook,
133
147
  this.element,
148
+ this.tabIndex,
134
149
  this.status,
135
150
  this.flash,
136
151
  this.coordinates,
@@ -168,19 +183,13 @@ export class Window {
168
183
  components,
169
184
  emits
170
185
  )
171
-
172
- this.slotData = {
173
- classesWindow: this.classes.list,
174
- class: this.classes.list.controlId,
175
- open: this.open.item,
176
- onclick: this.event.onClick,
177
- oncontextmenu: this.event.onContextmenu,
178
- binds: {
179
- class: this.classes.list.controlId,
180
- onclick: this.event.onClick,
181
- oncontextmenu: this.event.onContextmenu
182
- }
183
- }
186
+ this.esc = new WindowEsc(
187
+ this.open.item,
188
+ () => this.open.close(),
189
+ () => !this.props.persistent
190
+ )
191
+ this.text = new TextInclude(this.props)
192
+ this.hidden = new WindowHidden(this.classes, this.open)
184
193
 
185
194
  new ModelInclude<boolean>('open', this.emits, this.open.item)
186
195
 
@@ -190,6 +199,33 @@ export class Window {
190
199
  onUnmounted(this.stop)
191
200
  }
192
201
 
202
+ /** Checks if the role is a menu/ Проверяет, является ли роль меню */
203
+ isMenu(): boolean {
204
+ return this.props.role === 'menu'
205
+ || this.props.role === 'menuitemcheckbox'
206
+ || this.props.role === 'menuitemradio'
207
+ }
208
+
209
+ /** Returns data for managing slot data/ Возвращает данные для управления данными слотами */
210
+ readonly slotData = computed<WindowControlItem>(() => ({
211
+ classesWindow: this.classes.list,
212
+ class: this.classes.list.controlId,
213
+ open: this.open.item,
214
+ onclick: this.event.onClick,
215
+ oncontextmenu: this.event.onContextmenu,
216
+ binds: {
217
+ class: this.classes.list.controlId,
218
+ onclick: this.event.onClick,
219
+ oncontextmenu: this.event.onContextmenu,
220
+ ...AriaStaticInclude.control(
221
+ this.classes.getControlId(),
222
+ this.classes.getId(),
223
+ this.props.ariaHaspopup,
224
+ this.open.item.value
225
+ )
226
+ }
227
+ }))
228
+
193
229
  /**
194
230
  * Returns the list of available classes.
195
231
  *
@@ -13,6 +13,7 @@ export class WindowClasses {
13
13
  * Идентификация текущего окна. Используется для поиска текущего компонента и его контроля.
14
14
  */
15
15
  protected readonly id = `window--${getElementId()}`
16
+ protected readonly controlId = `${this.id}-control`
16
17
 
17
18
  readonly list: WindowClassesList
18
19
 
@@ -39,6 +40,29 @@ export class WindowClasses {
39
40
  )
40
41
  }
41
42
 
43
+ /**
44
+ * Checks if the selected element is a window teleport.
45
+ *
46
+ * Проверяет, является ли выбранный элемент телепортом окна.
47
+ * @param target selected item/ выбранный элемент
48
+ */
49
+ isWindowTeleport(target?: HTMLElement): boolean {
50
+ return Boolean(
51
+ target
52
+ && target.classList.contains(`${this.className}__teleport`)
53
+ )
54
+ }
55
+
56
+ /**
57
+ * Checks if the selected element is a window or a window teleport.
58
+ *
59
+ * Проверяет, является ли выбранный элемент окном или телепортом окна.
60
+ * @param target selected item/ выбранный элемент
61
+ */
62
+ isWindowOrTeleport(target?: HTMLElement): boolean {
63
+ return this.isWindow(target) || this.isWindowTeleport(target)
64
+ }
65
+
42
66
  /**
43
67
  * Returns the identifier of the current window.
44
68
  *
@@ -48,6 +72,15 @@ export class WindowClasses {
48
72
  return this.id
49
73
  }
50
74
 
75
+ /**
76
+ * Returns the identifier of the control of the current window.
77
+ *
78
+ * Возвращает идентификатор контроля текущего окна.
79
+ */
80
+ getControlId(): string {
81
+ return this.controlId
82
+ }
83
+
51
84
  /**
52
85
  * Returns the full name of the class for the status.
53
86
  *
@@ -1,3 +1,5 @@
1
+ import type { WindowElement } from './WindowElement'
2
+
1
3
  /**
2
4
  * Sentinel value for an "unset" client coordinate.
3
5
  * Used to distinguish the absence of data from a valid point (including 0,0).
@@ -20,6 +22,11 @@ export class WindowClient {
20
22
  protected x: number = WINDOW_NULL_VALUE
21
23
  protected y: number = WINDOW_NULL_VALUE
22
24
 
25
+ constructor(
26
+ protected readonly element: WindowElement
27
+ ) {
28
+ }
29
+
23
30
  /**
24
31
  * Checks if the button was pressed.
25
32
  *
@@ -29,6 +36,15 @@ export class WindowClient {
29
36
  return this.x !== WINDOW_NULL_VALUE && this.y !== WINDOW_NULL_VALUE
30
37
  }
31
38
 
39
+ /**
40
+ * Checks if the coordinates are at the origin (0,0).
41
+ *
42
+ * Проверяет, находятся ли координаты в начале координат (0,0).
43
+ */
44
+ isZero(): boolean {
45
+ return this.x === 0 && this.y === 0
46
+ }
47
+
32
48
  /**
33
49
  * Returns the X coordinate.
34
50
  *
@@ -90,4 +106,27 @@ export class WindowClient {
90
106
 
91
107
  return this
92
108
  }
109
+
110
+ /**
111
+ * The method updates the current position.
112
+ *
113
+ * Метод обновляет текущее положение.
114
+ */
115
+ update(): this {
116
+ if (
117
+ this.is()
118
+ && this.isZero()
119
+ ) {
120
+ const rect = this.element.getControlRect()
121
+
122
+ if (rect) {
123
+ this.set(
124
+ rect.left + (rect.width / 2),
125
+ rect.top + (rect.height / 2)
126
+ )
127
+ }
128
+ }
129
+
130
+ return this
131
+ }
93
132
  }