@dxtmisha/constructor 0.23.0

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 (311) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +136 -0
  3. package/package.json +124 -0
  4. package/src/classes/CaptionInclude.ts +71 -0
  5. package/src/classes/DescriptionInclude.ts +70 -0
  6. package/src/classes/EnabledInclude.ts +56 -0
  7. package/src/classes/EventClickInclude.ts +138 -0
  8. package/src/classes/LabelHighlightInclude.ts +90 -0
  9. package/src/classes/LabelInclude.ts +171 -0
  10. package/src/classes/LabelNumberInclude.ts +70 -0
  11. package/src/classes/ModelInclude.ts +49 -0
  12. package/src/classes/PrefixInclude.ts +71 -0
  13. package/src/classes/SuffixInclude.ts +71 -0
  14. package/src/classes/field/FieldAttributesInclude.ts +100 -0
  15. package/src/classes/field/FieldChangeInclude.ts +52 -0
  16. package/src/classes/field/FieldCodeInclude.ts +69 -0
  17. package/src/classes/field/FieldElementInclude.ts +97 -0
  18. package/src/classes/field/FieldInputCheckInclude.ts +128 -0
  19. package/src/classes/field/FieldMatchInclude.ts +101 -0
  20. package/src/classes/field/FieldPatternInclude.ts +42 -0
  21. package/src/classes/field/FieldTypeInclude.ts +42 -0
  22. package/src/classes/field/FieldValidationInclude.ts +196 -0
  23. package/src/classes/field/FieldValueInclude.ts +318 -0
  24. package/src/classes/field/FieldVisibilityInclude.ts +21 -0
  25. package/src/constructors/Badge/Badge.ts +73 -0
  26. package/src/constructors/Badge/BadgeDesign.tsx +127 -0
  27. package/src/constructors/Badge/BadgeInclude.ts +78 -0
  28. package/src/constructors/Badge/basicTypes.ts +15 -0
  29. package/src/constructors/Badge/index.ts +5 -0
  30. package/src/constructors/Badge/properties.json +36 -0
  31. package/src/constructors/Badge/props.ts +43 -0
  32. package/src/constructors/Badge/style.scss +83 -0
  33. package/src/constructors/Badge/types.ts +47 -0
  34. package/src/constructors/Bars/Bars.ts +188 -0
  35. package/src/constructors/Bars/BarsAction.ts +57 -0
  36. package/src/constructors/Bars/BarsDesign.tsx +229 -0
  37. package/src/constructors/Bars/BarsInclude.ts +116 -0
  38. package/src/constructors/Bars/basicTypes.ts +40 -0
  39. package/src/constructors/Bars/index.ts +6 -0
  40. package/src/constructors/Bars/properties.json +6 -0
  41. package/src/constructors/Bars/props.ts +63 -0
  42. package/src/constructors/Bars/style.scss +18 -0
  43. package/src/constructors/Bars/types.ts +58 -0
  44. package/src/constructors/Button/Button.ts +88 -0
  45. package/src/constructors/Button/ButtonDesign.tsx +136 -0
  46. package/src/constructors/Button/ButtonInclude.ts +80 -0
  47. package/src/constructors/Button/basicTypes.ts +12 -0
  48. package/src/constructors/Button/index.ts +5 -0
  49. package/src/constructors/Button/properties.json +84 -0
  50. package/src/constructors/Button/props.ts +55 -0
  51. package/src/constructors/Button/style.scss +96 -0
  52. package/src/constructors/Button/types.ts +56 -0
  53. package/src/constructors/Cell/Cell.ts +127 -0
  54. package/src/constructors/Cell/CellDesign.tsx +203 -0
  55. package/src/constructors/Cell/basicTypes.ts +6 -0
  56. package/src/constructors/Cell/index.ts +5 -0
  57. package/src/constructors/Cell/properties.json +52 -0
  58. package/src/constructors/Cell/props.ts +61 -0
  59. package/src/constructors/Cell/style.scss +80 -0
  60. package/src/constructors/Cell/types.ts +68 -0
  61. package/src/constructors/Chip/Chip.ts +33 -0
  62. package/src/constructors/Chip/ChipDesign.tsx +26 -0
  63. package/src/constructors/Chip/basicTypes.ts +0 -0
  64. package/src/constructors/Chip/index.ts +4 -0
  65. package/src/constructors/Chip/properties.json +3 -0
  66. package/src/constructors/Chip/props.ts +44 -0
  67. package/src/constructors/Chip/style.scss +6 -0
  68. package/src/constructors/Chip/types.ts +53 -0
  69. package/src/constructors/Field/Field.ts +147 -0
  70. package/src/constructors/Field/FieldDesign.tsx +372 -0
  71. package/src/constructors/Field/FieldIcons.ts +99 -0
  72. package/src/constructors/Field/FieldInclude.ts +72 -0
  73. package/src/constructors/Field/FieldSize.ts +93 -0
  74. package/src/constructors/Field/basicTypes.ts +90 -0
  75. package/src/constructors/Field/index.ts +5 -0
  76. package/src/constructors/Field/properties.json +86 -0
  77. package/src/constructors/Field/props.ts +88 -0
  78. package/src/constructors/Field/style.scss +556 -0
  79. package/src/constructors/Field/types.ts +78 -0
  80. package/src/constructors/FieldCounter/FieldCounter.ts +75 -0
  81. package/src/constructors/FieldCounter/FieldCounterDesign.tsx +122 -0
  82. package/src/constructors/FieldCounter/FieldCounterInclude.ts +98 -0
  83. package/src/constructors/FieldCounter/basicTypes.ts +25 -0
  84. package/src/constructors/FieldCounter/index.ts +6 -0
  85. package/src/constructors/FieldCounter/properties.json +3 -0
  86. package/src/constructors/FieldCounter/props.ts +32 -0
  87. package/src/constructors/FieldCounter/style.scss +4 -0
  88. package/src/constructors/FieldCounter/types.ts +42 -0
  89. package/src/constructors/FieldLabel/FieldLabel.ts +93 -0
  90. package/src/constructors/FieldLabel/FieldLabelDesign.tsx +156 -0
  91. package/src/constructors/FieldLabel/FieldLabelInclude.ts +91 -0
  92. package/src/constructors/FieldLabel/basicTypes.ts +34 -0
  93. package/src/constructors/FieldLabel/index.ts +6 -0
  94. package/src/constructors/FieldLabel/properties.json +4 -0
  95. package/src/constructors/FieldLabel/props.ts +40 -0
  96. package/src/constructors/FieldLabel/style.scss +10 -0
  97. package/src/constructors/FieldLabel/types.ts +49 -0
  98. package/src/constructors/FieldMessage/FieldMessage.ts +79 -0
  99. package/src/constructors/FieldMessage/FieldMessageDesign.tsx +159 -0
  100. package/src/constructors/FieldMessage/FieldMessageInclude.ts +105 -0
  101. package/src/constructors/FieldMessage/FieldMessageMessage.ts +54 -0
  102. package/src/constructors/FieldMessage/basicTypes.ts +27 -0
  103. package/src/constructors/FieldMessage/index.ts +6 -0
  104. package/src/constructors/FieldMessage/properties.json +9 -0
  105. package/src/constructors/FieldMessage/props.ts +40 -0
  106. package/src/constructors/FieldMessage/style.scss +13 -0
  107. package/src/constructors/FieldMessage/types.ts +49 -0
  108. package/src/constructors/Icon/Icon.ts +105 -0
  109. package/src/constructors/Icon/IconDesign.tsx +157 -0
  110. package/src/constructors/Icon/IconInclude.ts +64 -0
  111. package/src/constructors/Icon/IconLiteInclude.ts +121 -0
  112. package/src/constructors/Icon/IconTrailingInclude.ts +106 -0
  113. package/src/constructors/Icon/basicTypes.ts +50 -0
  114. package/src/constructors/Icon/index.ts +8 -0
  115. package/src/constructors/Icon/properties.json +25 -0
  116. package/src/constructors/Icon/props.ts +54 -0
  117. package/src/constructors/Icon/style.scss +106 -0
  118. package/src/constructors/Icon/types.ts +46 -0
  119. package/src/constructors/Image/Image.ts +184 -0
  120. package/src/constructors/Image/ImageAdaptiveGroup.ts +230 -0
  121. package/src/constructors/Image/ImageAdaptiveItem.ts +295 -0
  122. package/src/constructors/Image/ImageBackground.ts +127 -0
  123. package/src/constructors/Image/ImageCalculation.ts +184 -0
  124. package/src/constructors/Image/ImageCalculationList.ts +61 -0
  125. package/src/constructors/Image/ImageCoordinator.ts +104 -0
  126. package/src/constructors/Image/ImageData.ts +99 -0
  127. package/src/constructors/Image/ImageDesign.tsx +137 -0
  128. package/src/constructors/Image/ImageFile.ts +137 -0
  129. package/src/constructors/Image/ImageInclude.ts +53 -0
  130. package/src/constructors/Image/ImagePdf.ts +44 -0
  131. package/src/constructors/Image/ImagePosition.ts +49 -0
  132. package/src/constructors/Image/ImageType.ts +83 -0
  133. package/src/constructors/Image/basicTypes.ts +70 -0
  134. package/src/constructors/Image/index.ts +5 -0
  135. package/src/constructors/Image/properties.json +17 -0
  136. package/src/constructors/Image/props.ts +66 -0
  137. package/src/constructors/Image/style.scss +77 -0
  138. package/src/constructors/Image/types.ts +49 -0
  139. package/src/constructors/List/List.ts +267 -0
  140. package/src/constructors/List/ListControl.ts +194 -0
  141. package/src/constructors/List/ListDesign.tsx +382 -0
  142. package/src/constructors/List/ListFocus.ts +196 -0
  143. package/src/constructors/List/ListGo.ts +283 -0
  144. package/src/constructors/List/ListSearch.ts +113 -0
  145. package/src/constructors/List/basicTypes.ts +3 -0
  146. package/src/constructors/List/index.ts +5 -0
  147. package/src/constructors/List/properties.json +16 -0
  148. package/src/constructors/List/props.ts +76 -0
  149. package/src/constructors/List/style.scss +36 -0
  150. package/src/constructors/List/types.ts +66 -0
  151. package/src/constructors/ListGroup/ListGroup.ts +53 -0
  152. package/src/constructors/ListGroup/ListGroupDesign.tsx +180 -0
  153. package/src/constructors/ListGroup/ListGroupOpen.ts +56 -0
  154. package/src/constructors/ListGroup/basicTypes.ts +3 -0
  155. package/src/constructors/ListGroup/index.ts +5 -0
  156. package/src/constructors/ListGroup/properties.json +15 -0
  157. package/src/constructors/ListGroup/props.ts +30 -0
  158. package/src/constructors/ListGroup/style.scss +18 -0
  159. package/src/constructors/ListGroup/types.ts +51 -0
  160. package/src/constructors/ListItem/ListItem.ts +115 -0
  161. package/src/constructors/ListItem/ListItemDesign.tsx +196 -0
  162. package/src/constructors/ListItem/basicTypes.ts +3 -0
  163. package/src/constructors/ListItem/index.ts +5 -0
  164. package/src/constructors/ListItem/properties.json +52 -0
  165. package/src/constructors/ListItem/props.ts +78 -0
  166. package/src/constructors/ListItem/style.scss +152 -0
  167. package/src/constructors/ListItem/types.ts +78 -0
  168. package/src/constructors/ListMenu/ListMenu.ts +52 -0
  169. package/src/constructors/ListMenu/ListMenuDesign.tsx +127 -0
  170. package/src/constructors/ListMenu/basicTypes.ts +3 -0
  171. package/src/constructors/ListMenu/index.ts +5 -0
  172. package/src/constructors/ListMenu/properties.json +19 -0
  173. package/src/constructors/ListMenu/props.ts +34 -0
  174. package/src/constructors/ListMenu/style.scss +5 -0
  175. package/src/constructors/ListMenu/types.ts +54 -0
  176. package/src/constructors/Mask/Mask.ts +321 -0
  177. package/src/constructors/Mask/MaskBuffer.ts +89 -0
  178. package/src/constructors/Mask/MaskCharacter.ts +192 -0
  179. package/src/constructors/Mask/MaskCharacterLength.ts +40 -0
  180. package/src/constructors/Mask/MaskData.ts +287 -0
  181. package/src/constructors/Mask/MaskDate.ts +157 -0
  182. package/src/constructors/Mask/MaskDesign.tsx +217 -0
  183. package/src/constructors/Mask/MaskEmit.ts +140 -0
  184. package/src/constructors/Mask/MaskEvent.ts +347 -0
  185. package/src/constructors/Mask/MaskFocus.ts +49 -0
  186. package/src/constructors/Mask/MaskFormat.ts +216 -0
  187. package/src/constructors/Mask/MaskItem.ts +218 -0
  188. package/src/constructors/Mask/MaskMatch.ts +73 -0
  189. package/src/constructors/Mask/MaskPattern.ts +123 -0
  190. package/src/constructors/Mask/MaskRight.ts +43 -0
  191. package/src/constructors/Mask/MaskRubber.ts +156 -0
  192. package/src/constructors/Mask/MaskRubberItem.ts +96 -0
  193. package/src/constructors/Mask/MaskRubberTransition.ts +50 -0
  194. package/src/constructors/Mask/MaskSelection.ts +208 -0
  195. package/src/constructors/Mask/MaskSpecial.ts +179 -0
  196. package/src/constructors/Mask/MaskType.ts +103 -0
  197. package/src/constructors/Mask/MaskValidation.ts +102 -0
  198. package/src/constructors/Mask/MaskValue.ts +225 -0
  199. package/src/constructors/Mask/MaskValueBasic.ts +87 -0
  200. package/src/constructors/Mask/MaskView.ts +169 -0
  201. package/src/constructors/Mask/basicTypes.ts +49 -0
  202. package/src/constructors/Mask/index.ts +5 -0
  203. package/src/constructors/Mask/properties.json +29 -0
  204. package/src/constructors/Mask/props.ts +70 -0
  205. package/src/constructors/Mask/style.scss +104 -0
  206. package/src/constructors/Mask/types.ts +71 -0
  207. package/src/constructors/Menu/Menu.ts +179 -0
  208. package/src/constructors/Menu/MenuDesign.tsx +244 -0
  209. package/src/constructors/Menu/MenuInclude.ts +110 -0
  210. package/src/constructors/Menu/MenuRequest.ts +101 -0
  211. package/src/constructors/Menu/MenuSearch.ts +49 -0
  212. package/src/constructors/Menu/MenuValue.ts +73 -0
  213. package/src/constructors/Menu/MenuWindow.ts +89 -0
  214. package/src/constructors/Menu/basicTypes.ts +41 -0
  215. package/src/constructors/Menu/index.ts +6 -0
  216. package/src/constructors/Menu/properties.json +17 -0
  217. package/src/constructors/Menu/props.ts +79 -0
  218. package/src/constructors/Menu/style.scss +17 -0
  219. package/src/constructors/Menu/types.ts +79 -0
  220. package/src/constructors/MotionTransform/MotionTransform.ts +87 -0
  221. package/src/constructors/MotionTransform/MotionTransformClassesInclude.ts +38 -0
  222. package/src/constructors/MotionTransform/MotionTransformDesign.tsx +242 -0
  223. package/src/constructors/MotionTransform/MotionTransformElement.ts +220 -0
  224. package/src/constructors/MotionTransform/MotionTransformEvent.ts +118 -0
  225. package/src/constructors/MotionTransform/MotionTransformGo.ts +47 -0
  226. package/src/constructors/MotionTransform/MotionTransformInclude.ts +123 -0
  227. package/src/constructors/MotionTransform/MotionTransformSize.ts +97 -0
  228. package/src/constructors/MotionTransform/MotionTransformState.ts +250 -0
  229. package/src/constructors/MotionTransform/basicTypes.ts +121 -0
  230. package/src/constructors/MotionTransform/index.ts +7 -0
  231. package/src/constructors/MotionTransform/properties.json +35 -0
  232. package/src/constructors/MotionTransform/props.ts +50 -0
  233. package/src/constructors/MotionTransform/style.scss +180 -0
  234. package/src/constructors/MotionTransform/types.ts +86 -0
  235. package/src/constructors/Progress/Progress.ts +184 -0
  236. package/src/constructors/Progress/ProgressDesign.tsx +175 -0
  237. package/src/constructors/Progress/ProgressInclude.ts +67 -0
  238. package/src/constructors/Progress/basicTypes.ts +12 -0
  239. package/src/constructors/Progress/index.ts +6 -0
  240. package/src/constructors/Progress/properties.json +47 -0
  241. package/src/constructors/Progress/props.ts +54 -0
  242. package/src/constructors/Progress/style.scss +374 -0
  243. package/src/constructors/Progress/types.ts +43 -0
  244. package/src/constructors/Ripple/Ripple.ts +46 -0
  245. package/src/constructors/Ripple/RippleDesign.tsx +112 -0
  246. package/src/constructors/Ripple/RippleInclude.ts +39 -0
  247. package/src/constructors/Ripple/RippleItem.ts +62 -0
  248. package/src/constructors/Ripple/basicTypes.ts +3 -0
  249. package/src/constructors/Ripple/index.ts +6 -0
  250. package/src/constructors/Ripple/properties.json +9 -0
  251. package/src/constructors/Ripple/props.ts +28 -0
  252. package/src/constructors/Ripple/style.scss +62 -0
  253. package/src/constructors/Ripple/types.ts +41 -0
  254. package/src/constructors/Scrollbar/Scrollbar.ts +66 -0
  255. package/src/constructors/Scrollbar/ScrollbarBorder.ts +243 -0
  256. package/src/constructors/Scrollbar/ScrollbarDesign.tsx +126 -0
  257. package/src/constructors/Scrollbar/ScrollbarInclude.ts +80 -0
  258. package/src/constructors/Scrollbar/basicTypes.ts +42 -0
  259. package/src/constructors/Scrollbar/index.ts +5 -0
  260. package/src/constructors/Scrollbar/properties.json +33 -0
  261. package/src/constructors/Scrollbar/props.ts +37 -0
  262. package/src/constructors/Scrollbar/style.scss +117 -0
  263. package/src/constructors/Scrollbar/types.ts +52 -0
  264. package/src/constructors/Skeleton/Skeleton.ts +86 -0
  265. package/src/constructors/Skeleton/SkeletonDesign.tsx +117 -0
  266. package/src/constructors/Skeleton/SkeletonInclude.ts +61 -0
  267. package/src/constructors/Skeleton/basicTypes.ts +16 -0
  268. package/src/constructors/Skeleton/const.ts +1 -0
  269. package/src/constructors/Skeleton/index.ts +6 -0
  270. package/src/constructors/Skeleton/properties.json +24 -0
  271. package/src/constructors/Skeleton/props.ts +28 -0
  272. package/src/constructors/Skeleton/style.scss +112 -0
  273. package/src/constructors/Skeleton/types.ts +46 -0
  274. package/src/constructors/Window/Window.ts +212 -0
  275. package/src/constructors/Window/WindowClasses.ts +180 -0
  276. package/src/constructors/Window/WindowClassesInclude.ts +39 -0
  277. package/src/constructors/Window/WindowClient.ts +93 -0
  278. package/src/constructors/Window/WindowCoordinates.ts +257 -0
  279. package/src/constructors/Window/WindowDesign.tsx +278 -0
  280. package/src/constructors/Window/WindowElement.ts +84 -0
  281. package/src/constructors/Window/WindowEmit.ts +52 -0
  282. package/src/constructors/Window/WindowEvent.ts +157 -0
  283. package/src/constructors/Window/WindowFlash.ts +70 -0
  284. package/src/constructors/Window/WindowHook.ts +110 -0
  285. package/src/constructors/Window/WindowInclude.ts +134 -0
  286. package/src/constructors/Window/WindowOpen.ts +292 -0
  287. package/src/constructors/Window/WindowOrigin.ts +85 -0
  288. package/src/constructors/Window/WindowPersistent.ts +89 -0
  289. package/src/constructors/Window/WindowPosition.ts +358 -0
  290. package/src/constructors/Window/WindowStatic.ts +102 -0
  291. package/src/constructors/Window/WindowStatus.ts +138 -0
  292. package/src/constructors/Window/WindowStyles.ts +78 -0
  293. package/src/constructors/Window/WindowVerification.ts +287 -0
  294. package/src/constructors/Window/basicTypes.ts +186 -0
  295. package/src/constructors/Window/index.ts +7 -0
  296. package/src/constructors/Window/properties.json +236 -0
  297. package/src/constructors/Window/props.ts +88 -0
  298. package/src/constructors/Window/style.scss +262 -0
  299. package/src/constructors/Window/types.ts +124 -0
  300. package/src/functions/getClassTegAStatic.ts +8 -0
  301. package/src/library.ts +36 -0
  302. package/src/types/captionTypes.ts +15 -0
  303. package/src/types/descriptionTypes.ts +15 -0
  304. package/src/types/enabledTypes.ts +9 -0
  305. package/src/types/eventClickTypes.ts +51 -0
  306. package/src/types/fieldTypes.ts +282 -0
  307. package/src/types/labelTypes.ts +30 -0
  308. package/src/types/modelTypes.ts +23 -0
  309. package/src/types/prefixTypes.ts +15 -0
  310. package/src/types/suffixTypes.ts +15 -0
  311. package/src/vite-env.d.ts +1 -0
@@ -0,0 +1,46 @@
1
+ import type { ComputedRef } from 'vue'
2
+ import type { ConstrClass } from '@dxtmisha/functional'
3
+ import type { SkeletonClassesList } from './basicTypes'
4
+
5
+ /**
6
+ * Interface for describing which components need to be connected for work.
7
+ *
8
+ * Интерфейс для описания, какие компоненты надо подключить для работы.
9
+ */
10
+ export type SkeletonComponents = {}
11
+
12
+ /**
13
+ * Type describing available events.
14
+ *
15
+ * Тип, описывающий доступные события.
16
+ */
17
+ export type SkeletonEmits = {}
18
+
19
+ /**
20
+ * Type describing available properties.
21
+ *
22
+ * Тип, описывающий доступные свойства.
23
+ */
24
+ export interface SkeletonExpose {
25
+ isActive: ComputedRef<boolean>
26
+ }
27
+
28
+ /**
29
+ * Type describing available slots.
30
+ *
31
+ * Тип, описывающий доступные слоты.
32
+ */
33
+ export interface SkeletonSlots {
34
+ default?(props: SkeletonClassesList): any
35
+ }
36
+
37
+ /**
38
+ * Type describing subclasses.
39
+ *
40
+ * Тип, описывающий подклассы.
41
+ */
42
+ export type SkeletonClasses = {
43
+ main: ConstrClass
44
+ // :classes [!] System label / Системная метка
45
+ // :classes [!] System label / Системная метка
46
+ }
@@ -0,0 +1,212 @@
1
+ import { computed, onMounted, onUnmounted, type Ref, type ToRefs, watch } from 'vue'
2
+ import { type ConstrClassObject, type ConstrEmit, DesignComp } from '@dxtmisha/functional'
3
+
4
+ import { ScrollbarInclude } from '../Scrollbar/ScrollbarInclude'
5
+ import { ImageInclude } from '../Image/ImageInclude'
6
+ import { ModelInclude } from '../../classes/ModelInclude'
7
+
8
+ import { WindowClient } from './WindowClient'
9
+ import { WindowHook } from './WindowHook'
10
+
11
+ import { WindowClasses } from './WindowClasses'
12
+ import { WindowElement } from './WindowElement'
13
+
14
+ import { WindowStatus } from './WindowStatus'
15
+ import { WindowPersistent } from './WindowPersistent'
16
+ import { WindowFlash } from './WindowFlash'
17
+ import { WindowCoordinates } from './WindowCoordinates'
18
+ import { WindowPosition } from './WindowPosition'
19
+ import { WindowOrigin } from './WindowOrigin'
20
+ import { WindowStatic } from './WindowStatic'
21
+ import { WindowEmit } from './WindowEmit'
22
+
23
+ import { WindowStyles } from './WindowStyles'
24
+ import { WindowOpen } from './WindowOpen'
25
+ import { WindowVerification } from './WindowVerification'
26
+ import { WindowEvent } from './WindowEvent'
27
+
28
+ import type { WindowControlItem } from './basicTypes'
29
+ import type { WindowComponents, WindowEmits, WindowSlots } from './types'
30
+ import type { WindowPropsBasic } from './props'
31
+
32
+ /**
33
+ * Main Window class that manages all window-related functionality including positioning,
34
+ * events, styles, animations, and component integrations. This class serves as the central
35
+ * coordinator for window operations in the design system.
36
+ *
37
+ * Основной класс Window, который управляет всей функциональностью окон, включая позиционирование,
38
+ * события, стили, анимации и интеграции компонентов. Этот класс служит центральным координатором
39
+ * для операций с окнами в дизайн-системе.
40
+ */
41
+ export class Window {
42
+ /** Client instance for window management/ Экземпляр клиента для управления окном */
43
+ readonly client: WindowClient
44
+ /** Hook instance for window events/ Экземпляр хука для событий окна */
45
+ readonly hook: WindowHook
46
+
47
+ /** Class manager for window styles/ Менеджер классов для стилей окна */
48
+ readonly classes: WindowClasses
49
+ /** Element manager for window DOM element/ Менеджер элементов для DOM элемента окна */
50
+ readonly element: WindowElement
51
+
52
+ /** Status manager for window state/ Менеджер статуса для состояния окна */
53
+ readonly status: WindowStatus
54
+ /** Persistent manager for window data/ Менеджер постоянных данных для окна */
55
+ readonly persistent: WindowPersistent
56
+ /** Flash manager for window animations/ Менеджер анимаций для окна */
57
+ readonly flash: WindowFlash
58
+ /** Coordinates manager for window positioning/ Менеджер координат для позиционирования окна */
59
+ readonly coordinates: WindowCoordinates
60
+ /** Position manager for window placement/ Менеджер позиции для размещения окна */
61
+ readonly position: WindowPosition
62
+ /** Origin manager for window transformations/ Менеджер начальной точки для трансформаций окна */
63
+ readonly origin: WindowOrigin
64
+ /** Static mode manager for window behavior/ Менеджер статического режима для поведения окна */
65
+ readonly staticMode: WindowStatic
66
+ /** Emit manager for window events/ Менеджер событий для окна */
67
+ readonly emit: WindowEmit
68
+
69
+ /** Styles manager for window appearance/ Менеджер стилей для внешнего вида окна */
70
+ readonly styles: WindowStyles
71
+ /** Open manager for window visibility/ Менеджер открытия для видимости окна */
72
+ readonly open: WindowOpen
73
+ /** Verification manager for window state validation/ Менеджер проверки для валидации состояния окна */
74
+ readonly verification: WindowVerification
75
+ /** Event manager for window interactions/ Менеджер событий для взаимодействий с окном */
76
+ readonly event: WindowEvent
77
+
78
+ /** Scrollbar manager for window content/ Менеджер скроллбара для содержимого окна */
79
+ readonly scrollbar: ScrollbarInclude
80
+ /** Image manager for window content/ Менеджер изображений для содержимого окна */
81
+ readonly image: ImageInclude
82
+
83
+ /** Returns data for managing slot data/ Возвращает данные для управления данными слотами */
84
+ readonly slotData: WindowControlItem
85
+
86
+ /**
87
+ * Constructor
88
+ * @param props input data/ входные данные
89
+ * @param refs input data in the form of reactive elements/ входные данные в виде реактивных элементов
90
+ * @param element input element/ элемент ввода
91
+ * @param classDesign design name/ название дизайна
92
+ * @param className class name/ название класса
93
+ * @param components object for working with components/ объект для работы с компонентами
94
+ * @param slots object for working with slots/ объект для работы со слотами
95
+ * @param emits the function is called when an event is triggered/ функция вызывается, когда срабатывает событие
96
+ */
97
+ constructor(
98
+ protected readonly props: WindowPropsBasic,
99
+ protected readonly refs: ToRefs<WindowPropsBasic>,
100
+ element: Ref<HTMLDivElement | undefined>,
101
+ protected readonly classDesign: string,
102
+ protected readonly className: string,
103
+ protected readonly components?: DesignComp<WindowComponents, WindowPropsBasic>,
104
+ protected readonly slots?: WindowSlots,
105
+ protected readonly emits?: ConstrEmit<WindowEmits>
106
+ ) {
107
+ this.client = new WindowClient()
108
+ this.hook = new WindowHook(props)
109
+
110
+ this.classes = new WindowClasses(className)
111
+ this.element = new WindowElement(this.classes, element)
112
+
113
+ this.status = new WindowStatus(this.element)
114
+ this.persistent = new WindowPersistent(props, this.classes, this.element)
115
+ this.flash = new WindowFlash(props, this.classes)
116
+ this.coordinates = new WindowCoordinates(this.classes, this.element)
117
+ this.position = new WindowPosition(props, this.client, this.element, this.coordinates)
118
+ this.origin = new WindowOrigin(this.client, this.element, this.position)
119
+ this.staticMode = new WindowStatic(props, refs, this.element)
120
+ this.emit = new WindowEmit(this.classes, this.element, emits)
121
+
122
+ this.styles = new WindowStyles(
123
+ this.element,
124
+ this.coordinates,
125
+ this.position,
126
+ this.origin,
127
+ className
128
+ )
129
+ this.open = new WindowOpen(
130
+ props,
131
+ this.client,
132
+ this.hook,
133
+ this.element,
134
+ this.status,
135
+ this.flash,
136
+ this.coordinates,
137
+ this.position,
138
+ this.origin,
139
+ this.emit,
140
+ this.styles
141
+ )
142
+
143
+ this.verification = new WindowVerification(
144
+ props,
145
+ this.persistent,
146
+ this.classes,
147
+ this.element,
148
+ this.staticMode,
149
+ this.open
150
+ )
151
+ this.event = new WindowEvent(
152
+ props,
153
+ this.status,
154
+ this.client,
155
+ this.flash,
156
+ this.open,
157
+ this.verification
158
+ )
159
+
160
+ this.scrollbar = new ScrollbarInclude(
161
+ props,
162
+ className,
163
+ components,
164
+ emits
165
+ )
166
+ this.image = new ImageInclude(
167
+ props,
168
+ components,
169
+ emits
170
+ )
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
+ }
184
+
185
+ new ModelInclude<boolean>('open', this.emits, this.open.item)
186
+
187
+ onMounted(() => {
188
+ watch([refs.open], () => this.open.set(props.open), { immediate: true })
189
+ })
190
+ onUnmounted(this.stop)
191
+ }
192
+
193
+ /**
194
+ * Returns the list of available classes.
195
+ *
196
+ * Возвращает список доступных классов.
197
+ */
198
+ readonly classesList = computed<ConstrClassObject>(() => ({
199
+ [this.classes.getId()]: true,
200
+ [`${this.className}--staticMode`]: this.staticMode.item.value
201
+ }))
202
+
203
+ /**
204
+ * Restores the data to its previous state.
205
+ *
206
+ * Восстанавливает данные в прежнее состояние.
207
+ */
208
+ protected readonly stop = (): void => {
209
+ this.event.stop()
210
+ this.staticMode.stop()
211
+ }
212
+ }
@@ -0,0 +1,180 @@
1
+ import { domQuerySelector, getElementId } from '@dxtmisha/functional'
2
+ import { type WindowClassesList, WindowStatusControlItem, WindowStatusItem } from './basicTypes'
3
+
4
+ /**
5
+ * Class for working with class names.
6
+ *
7
+ * Класс для работы с названиями классов.
8
+ */
9
+ export class WindowClasses {
10
+ /**
11
+ * Identification of the current window. Used to search for the current component and its control.
12
+ *
13
+ * Идентификация текущего окна. Используется для поиска текущего компонента и его контроля.
14
+ */
15
+ protected readonly id = `window--${getElementId()}`
16
+
17
+ readonly list: WindowClassesList
18
+
19
+ /**
20
+ * Constructor
21
+ * @param className class name/ название класса
22
+ */
23
+ constructor(
24
+ protected readonly className: string
25
+ ) {
26
+ this.list = WindowClasses.getClassesList(className, this.id)
27
+ }
28
+
29
+ /**
30
+ * Checks if the selected element is a window.
31
+ *
32
+ * Проверяет, является ли выбранный элемент окном.
33
+ * @param target selected item/ выбранный элемент
34
+ */
35
+ isWindow(target?: HTMLElement): boolean {
36
+ return Boolean(
37
+ target
38
+ && target.classList.contains(this.className)
39
+ )
40
+ }
41
+
42
+ /**
43
+ * Returns the identifier of the current window.
44
+ *
45
+ * Возвращает идентификатор текущего окна.
46
+ */
47
+ getId(): string {
48
+ return this.id
49
+ }
50
+
51
+ /**
52
+ * Returns the full name of the class for the status.
53
+ *
54
+ * Возвращает полное название класса для статуса.
55
+ * @param status названия статуса
56
+ */
57
+ getClassStatus(status: WindowStatusItem): string {
58
+ return `${this.className}[data-status="${status}"]`
59
+ }
60
+
61
+ /**
62
+ * Returns the class selector for control.
63
+ *
64
+ * Возвращает селектор класса для управления.
65
+ */
66
+ getSelectorControl(): string {
67
+ return `.${this.list.control}.${this.id}`
68
+ }
69
+
70
+ /**
71
+ * Search and return the window element at the selected item.
72
+ *
73
+ * Поиск и возврат элемента окна у выбранного элемента.
74
+ * @param target selected item/ выбранный элемент
75
+ */
76
+ findMain<T extends HTMLElement>(target: HTMLElement): T | undefined {
77
+ return target?.closest<T>(`.${this.className}`) ?? undefined
78
+ }
79
+
80
+ /**
81
+ * Search and return of the control element of the current component.
82
+ *
83
+ * Поиск и возврат элемента управления текущего компонента.
84
+ */
85
+ findControl(): HTMLElement | undefined {
86
+ return domQuerySelector<HTMLElement>(`.${this.list.control}.${this.id}`)
87
+ }
88
+
89
+ /**
90
+ * Find the control at the selected window.
91
+ *
92
+ * Найди элемент управления у выбранного окна.
93
+ * @param element window element/ элемент окна
94
+ */
95
+ findControlByElement(element?: HTMLElement): HTMLElement | undefined {
96
+ if (element) {
97
+ return domQuerySelector<HTMLElement>(`.${this.list.control}.${element.dataset?.window}`)
98
+ }
99
+
100
+ return undefined
101
+ }
102
+
103
+ /**
104
+ * Search and return of the window body element for the current component.
105
+ *
106
+ * Поиск и возврат элемента тела окна для текущего компонента.
107
+ */
108
+ findBody(): HTMLDivElement | undefined {
109
+ return domQuerySelector<HTMLDivElement>(`.${this.className}.${this.id} .${this.className}__body`)
110
+ }
111
+
112
+ /**
113
+ * Search and return of the context body element of the window for the current component.
114
+ *
115
+ * Поиск и возврат элемента контекста тела окна для текущего компонента.
116
+ */
117
+ findBodyContext(): HTMLDivElement | undefined {
118
+ return domQuerySelector<HTMLDivElement>(`.${this.className}.${this.id} .${this.className}__body__context`)
119
+ }
120
+
121
+ /**
122
+ * Search and return of the window body element for other components (not current)
123
+ * with additional selectors.
124
+ *
125
+ * Поиск и возврат элемента тела окна для других компонентов (не текущего)
126
+ * с дополнительными селекторами.
127
+ * @param selectors additional CSS selectors/ дополнительные CSS селекторы
128
+ * @param status status of the window/ статус окна
129
+ */
130
+ findBodyOther(selectors: string, status: WindowStatusItem = WindowStatusItem.open): HTMLDivElement | undefined {
131
+ if (status === WindowStatusItem.open) {
132
+ const element = domQuerySelector<HTMLDivElement>(
133
+ `.${this.className}:not(.${this.id})[data-status="${WindowStatusItem.flash}"] .${this.className}__body ${selectors}`
134
+ )
135
+
136
+ if (element) {
137
+ return element
138
+ }
139
+ }
140
+
141
+ return domQuerySelector<HTMLDivElement>(
142
+ `.${this.className}:not(.${this.id})[data-status="${status}"] .${this.className}__body ${selectors}`
143
+ )
144
+ }
145
+
146
+ /**
147
+ * Returns the list of available classes.
148
+ *
149
+ * Возвращает список доступных классов.
150
+ * @param className class name/ название класса
151
+ * @param id identification of the current window/ идентификация текущего окна
152
+ */
153
+ static getClassesList(className: string, id: string = 'id'): WindowClassesList {
154
+ return {
155
+ block: `${className}--${WindowStatusControlItem.block}`,
156
+ blockChildren: `${className}--${WindowStatusControlItem.blockChildren}`,
157
+ blockOther: `${className}--${WindowStatusControlItem.blockOther}`,
158
+ close: `${className}--${WindowStatusControlItem.close}`,
159
+ static: `${className}--${WindowStatusControlItem.static}`,
160
+
161
+ control: `${className}__control`,
162
+ controlId: `${className}__control window__control ${id}`,
163
+ controlStatic: `${className}--${WindowStatusControlItem.controlStatic}`,
164
+ controlOpenOnly: `${className}--${WindowStatusControlItem.controlOpenOnly}`,
165
+ controlActive: `${className}--${WindowStatusControlItem.controlActive}`,
166
+
167
+ persistent: `${className}--${WindowStatusControlItem.persistent}`
168
+ }
169
+ }
170
+
171
+ /**
172
+ * Returns a list of available classes by design name.
173
+ *
174
+ * Возвращает список доступных классов по названию дизайна.
175
+ * @param design design name/ названия дизайна
176
+ */
177
+ static getClassesListByDesign(design: string) {
178
+ return this.getClassesList(`${design}-window`)
179
+ }
180
+ }
@@ -0,0 +1,39 @@
1
+ import { WindowClasses } from './WindowClasses'
2
+
3
+ import type { WindowClassesList } from './basicTypes'
4
+
5
+ /**
6
+ * Helper class to access window CSS classes by design.
7
+ *
8
+ * Вспомогательный класс для доступа к CSS-классам окна по дизайну.
9
+ */
10
+ export class WindowClassesInclude {
11
+ /**
12
+ * Constructor
13
+ * @param design design name/ название дизайна
14
+ */
15
+ constructor(
16
+ protected readonly design: string
17
+ ) {
18
+ }
19
+
20
+ /**
21
+ * Returns list of window classes for the specified design.
22
+ *
23
+ * Возвращает список классов окна для указанного дизайна.
24
+ */
25
+ get(): WindowClassesList {
26
+ return WindowClasses.getClassesListByDesign(this.design)
27
+ }
28
+
29
+ /**
30
+ * Returns an object with window classes under classesWindow key.
31
+ *
32
+ * Возвращает объект с классами окна под ключом classesWindow.
33
+ */
34
+ getObject() {
35
+ return {
36
+ classesWindow: this.get()
37
+ }
38
+ }
39
+ }
@@ -0,0 +1,93 @@
1
+ /**
2
+ * Sentinel value for an "unset" client coordinate.
3
+ * Used to distinguish the absence of data from a valid point (including 0,0).
4
+ * -1 is chosen as a value that cannot occur for clientX/clientY within the visible viewport.
5
+ *
6
+ * Маркерное значение для «не заданных» координат клика пользователя.
7
+ * Используется, чтобы отличать отсутствие данных от валидной точки (включая 0,0).
8
+ * -1 выбран как значение, невозможное для clientX/clientY в видимой области.
9
+ */
10
+ const WINDOW_NULL_VALUE = -1
11
+
12
+ /**
13
+ * The class stores the coordinates of the mouse click. It is used for the opening
14
+ * animation, when the element appears from the point of click. And also for the contextmenu event.
15
+ *
16
+ * Класс хранит координаты нажатия мыши. Используется для анимации открытия,
17
+ * когда элемент появляется от точки нажатия. А также для события contextmenu.
18
+ */
19
+ export class WindowClient {
20
+ protected x: number = WINDOW_NULL_VALUE
21
+ protected y: number = WINDOW_NULL_VALUE
22
+
23
+ /**
24
+ * Checks if the button was pressed.
25
+ *
26
+ * Проверяет, было ли нажатие на кнопку.
27
+ */
28
+ is(): boolean {
29
+ return this.x !== WINDOW_NULL_VALUE && this.y !== WINDOW_NULL_VALUE
30
+ }
31
+
32
+ /**
33
+ * Returns the X coordinate.
34
+ *
35
+ * Возвращает координату X.
36
+ */
37
+ getX(): number {
38
+ return this.x
39
+ }
40
+
41
+ /**
42
+ * Returns the Y coordinate.
43
+ *
44
+ * Возвращает координату Y.
45
+ */
46
+ getY(): number {
47
+ return this.y
48
+ }
49
+
50
+ /**
51
+ * Returns the shift along the X coordinate.
52
+ *
53
+ * Возвращает сдвиг по координате X.
54
+ */
55
+ getShiftX(value: number): number {
56
+ return this.x - value
57
+ }
58
+
59
+ /**
60
+ * Returns the shift along the Y coordinate.
61
+ *
62
+ * Возвращает сдвиг по координате Y.
63
+ */
64
+ getShiftY(value: number): number {
65
+ return this.y - value
66
+ }
67
+
68
+ /**
69
+ * Changes the coordinates.
70
+ *
71
+ * Изменяет координаты.
72
+ * @param x value of X/ значение X
73
+ * @param y value of Y/ значение Y
74
+ */
75
+ set(x: number, y: number): this {
76
+ this.x = x
77
+ this.y = y
78
+
79
+ return this
80
+ }
81
+
82
+ /**
83
+ * Resets all data to initial values.
84
+ *
85
+ * Сбрасывает все данные к начальным значениям.
86
+ */
87
+ reset(): this {
88
+ this.x = WINDOW_NULL_VALUE
89
+ this.y = WINDOW_NULL_VALUE
90
+
91
+ return this
92
+ }
93
+ }