@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,127 @@
1
+ import { type VNode } from 'vue'
2
+ import {
3
+ type ConstrOptions,
4
+ type ConstrStyles,
5
+ DesignConstructorAbstract
6
+ } from '@dxtmisha/functional'
7
+
8
+ import { ListMenu } from './ListMenu'
9
+
10
+ import type { WindowControlItem } from '../Window'
11
+ import {
12
+ type ListMenuPropsBasic
13
+ } from './props'
14
+ import {
15
+ type ListMenuClasses,
16
+ type ListMenuComponents,
17
+ type ListMenuEmits,
18
+ type ListMenuExpose,
19
+ type ListMenuSlots
20
+ } from './types'
21
+
22
+ /**
23
+ * ListMenuDesign
24
+ */
25
+ export class ListMenuDesign<
26
+ COMP extends ListMenuComponents,
27
+ EXPOSE extends ListMenuExpose,
28
+ CLASSES extends ListMenuClasses,
29
+ P extends ListMenuPropsBasic
30
+ > extends DesignConstructorAbstract<
31
+ HTMLDivElement,
32
+ COMP,
33
+ ListMenuEmits,
34
+ EXPOSE,
35
+ ListMenuSlots,
36
+ CLASSES,
37
+ P
38
+ > {
39
+ protected readonly item: ListMenu
40
+
41
+ /**
42
+ * Constructor
43
+ * @param name class name/ название класса
44
+ * @param props properties/ свойства
45
+ * @param options list of additional parameters/ список дополнительных параметров
46
+ */
47
+ constructor(
48
+ name: string,
49
+ props: Readonly<P>,
50
+ options?: ConstrOptions<COMP, ListMenuEmits, P>
51
+ ) {
52
+ super(
53
+ name,
54
+ props,
55
+ options
56
+ )
57
+
58
+ this.item = new ListMenu(
59
+ this.props,
60
+ this.refs,
61
+ this.element,
62
+ this.getDesign(),
63
+ this.getName(),
64
+ this.components,
65
+ this.slots,
66
+ this.emits
67
+ )
68
+
69
+ this.init()
70
+ }
71
+
72
+ /**
73
+ * Initialization of all the necessary properties for work
74
+ *
75
+ * Инициализация всех необходимых свойств для работы.
76
+ */
77
+ protected initExpose(): EXPOSE {
78
+ return {
79
+ ...this.item.window.expose
80
+ } as EXPOSE
81
+ }
82
+
83
+ /**
84
+ * Improvement of the obtained list of classes.
85
+ *
86
+ * Доработка полученного списка классов.
87
+ */
88
+ protected initClasses(): Partial<CLASSES> {
89
+ return {
90
+ main: {},
91
+ ...{
92
+ // :classes [!] System label / Системная метка
93
+ head: this.getSubClass('head'),
94
+ list: this.getSubClass('list')
95
+ // :classes [!] System label / Системная метка
96
+ }
97
+ } as Partial<CLASSES>
98
+ }
99
+
100
+ /**
101
+ * Refinement of the received list of styles.
102
+ *
103
+ * Доработка полученного списка стилей.
104
+ */
105
+ protected initStyles(): ConstrStyles {
106
+ return {}
107
+ }
108
+
109
+ /**
110
+ * A method for rendering.
111
+ *
112
+ * Метод для рендеринга.
113
+ */
114
+ protected initRender(): VNode[] {
115
+ return this.item.window.render(
116
+ {
117
+ control: (props: WindowControlItem) => this.initSlot('head', undefined, props),
118
+ default: () => this.initSlot('list')
119
+ },
120
+ {
121
+ ...this.getAttrs(),
122
+ open: this.item.open.is.value,
123
+ class: this.classes?.value.main
124
+ }
125
+ )
126
+ }
127
+ }
@@ -0,0 +1,3 @@
1
+ export type ListMenuComponentInclude = {
2
+ listMenu?: object
3
+ }
@@ -0,0 +1,5 @@
1
+ export * from './ListMenu'
2
+ export * from './ListMenuDesign'
3
+ export * from './props'
4
+ export * from './types'
5
+ export * from './basicTypes'
@@ -0,0 +1,19 @@
1
+ {
2
+ "border-width": {
3
+ "_type": "var"
4
+ },
5
+ "border-color": {
6
+ "_type": "var"
7
+ },
8
+ "border-opacity": {
9
+ "_type": "var"
10
+ },
11
+ "#head": {},
12
+ "#list": {},
13
+ "~open": {},
14
+ "~axis": {
15
+ "x": {},
16
+ "y": {}
17
+ },
18
+ "~divider": {}
19
+ }
@@ -0,0 +1,34 @@
1
+ import type { WindowPropsBasic, WindowPropsInclude } from '../Window'
2
+
3
+ interface ListMenuPropsToken {
4
+ // :type [!] System label / Системная метка
5
+ open?: boolean
6
+ axis?: 'x' | 'y'
7
+ divider?: boolean
8
+ // :type [!] System label / Системная метка
9
+ }
10
+
11
+ export interface ListMenuPropsBasic<
12
+ Window extends WindowPropsBasic = WindowPropsBasic
13
+ >extends WindowPropsInclude<Window> {
14
+ }
15
+
16
+ /**
17
+ * Type describing incoming properties.
18
+ *
19
+ * Тип, описывающий входящие свойства.
20
+ */
21
+ export interface ListMenuProps extends ListMenuPropsBasic, ListMenuPropsToken {
22
+ }
23
+
24
+ /**
25
+ * Default value for property.
26
+ *
27
+ * Значение по умолчанию для свойства.
28
+ */
29
+ export const defaultsListMenu = {
30
+ ...{
31
+ // :default [!] System label / Системная метка
32
+ // :default [!] System label / Системная метка
33
+ }
34
+ }
@@ -0,0 +1,5 @@
1
+ @use "@dxtmisha/styles/properties" as ui;
2
+
3
+ @mixin mixinListMenu {
4
+
5
+ }
@@ -0,0 +1,54 @@
1
+ import type { ConstrClass } from '@dxtmisha/functional'
2
+ import type {
3
+ WindowComponentInclude,
4
+ WindowControlItem,
5
+ WindowEmitsInclude,
6
+ WindowExposeInclude
7
+ } from '../Window'
8
+
9
+ /**
10
+ * Interface for describing which components need to be connected for work.
11
+ *
12
+ * Интерфейс для описания, какие компоненты надо подключить для работы.
13
+ */
14
+ export type ListMenuComponents
15
+ = WindowComponentInclude
16
+
17
+ /**
18
+ * Type describing available events.
19
+ *
20
+ * Тип, описывающий доступные события.
21
+ */
22
+ export type ListMenuEmits
23
+ = WindowEmitsInclude
24
+
25
+ /**
26
+ * Type describing available properties.
27
+ *
28
+ * Тип, описывающий доступные свойства.
29
+ */
30
+ export interface ListMenuExpose extends WindowExposeInclude {
31
+ }
32
+
33
+ /**
34
+ * Type describing available slots.
35
+ *
36
+ * Тип, описывающий доступные слоты.
37
+ */
38
+ export interface ListMenuSlots {
39
+ head?(props: WindowControlItem): any
40
+ list?(props: any): any
41
+ }
42
+
43
+ /**
44
+ * Type describing subclasses.
45
+ *
46
+ * Тип, описывающий подклассы.
47
+ */
48
+ export type ListMenuClasses = {
49
+ main: ConstrClass
50
+ // :classes [!] System label / Системная метка
51
+ head: string
52
+ list: string
53
+ // :classes [!] System label / Системная метка
54
+ }
@@ -0,0 +1,321 @@
1
+ import { computed, type Ref, type ToRefs, watch } from 'vue'
2
+ import {
3
+ anyToString,
4
+ type ConstrClassObject,
5
+ type ConstrEmit,
6
+ DesignComp,
7
+ GeoRef,
8
+ isFloat
9
+ } from '@dxtmisha/functional'
10
+
11
+ import { MaskType } from './MaskType'
12
+ import { MaskBuffer } from './MaskBuffer'
13
+ import { MaskFocus } from './MaskFocus'
14
+ import { MaskCharacterLength } from './MaskCharacterLength'
15
+ import { MaskRubberItem } from './MaskRubberItem'
16
+ import { MaskRubberTransition } from './MaskRubberTransition'
17
+ import { MaskDate } from './MaskDate'
18
+ import { MaskFormat } from './MaskFormat'
19
+ import { MaskSpecial } from './MaskSpecial'
20
+ import { MaskMatch } from './MaskMatch'
21
+ import { MaskPattern } from './MaskPattern'
22
+ import { MaskRight } from './MaskRight'
23
+ import { MaskRubber } from './MaskRubber'
24
+ import { MaskItem } from './MaskItem'
25
+ import { MaskSelection } from './MaskSelection'
26
+ import { MaskCharacter } from './MaskCharacter'
27
+ import { MaskValueBasic } from './MaskValueBasic'
28
+ import { MaskValue } from './MaskValue'
29
+ import { MaskValidation } from './MaskValidation'
30
+ import { MaskView } from './MaskView'
31
+ import { MaskEmit } from './MaskEmit'
32
+ import { MaskData } from './MaskData'
33
+ import { MaskEvent } from './MaskEvent'
34
+
35
+ import type { MaskElementInput } from './basicTypes'
36
+ import type { MaskComponents, MaskEmits, MaskSlots } from './types'
37
+ import type { MaskProps } from './props'
38
+
39
+ /**
40
+ * Class for working with input masking.
41
+ *
42
+ * Класс для работы с маской ввода.
43
+ */
44
+ export class Mask {
45
+ /** Type helper/ Объект для работы с типом */
46
+ readonly type: MaskType
47
+ /** Buffer helper/ Объект для буферизации ввода */
48
+ readonly buffer: MaskBuffer
49
+ /** Focus helper/ Объект для работы с фокусом */
50
+ readonly focus: MaskFocus
51
+ /** Entered characters length helper/ Объект длины введённых символов */
52
+ readonly characterLength: MaskCharacterLength
53
+ /** Rubber groups length helper/ Объект длины резиновых групп */
54
+ readonly rubberItem: MaskRubberItem
55
+ /** Rubber transition symbol helper/ Объект символа перехода резины */
56
+ readonly rubberTransition: MaskRubberTransition
57
+
58
+ /** Date/time mask helper/ Объект для работы с датой/временем */
59
+ readonly date: MaskDate
60
+ /** Number/currency format mask helper/ Объект форматирования числа/валюты */
61
+ readonly format: MaskFormat
62
+
63
+ /** Special symbols/groups helper/ Объект для спецсимволов и групп */
64
+ readonly special: MaskSpecial
65
+ /** Match helper/ Объект проверки символов */
66
+ readonly match: MaskMatch
67
+ /** Pattern helper/ Объект паттернов валидации */
68
+ readonly pattern: MaskPattern
69
+ /** Alignment helper/ Объект выравнивания */
70
+ readonly right: MaskRight
71
+
72
+ /** Rubber groups helper/ Объект для работы с резиновыми группами */
73
+ readonly rubber: MaskRubber
74
+ /** Mask item helper/ Объект для работы с маской */
75
+ readonly item: MaskItem
76
+ /** Selection helper/ Объект для работы с выделением */
77
+ readonly selection: MaskSelection
78
+ /** Characters helper/ Объект для работы с введёнными символами */
79
+ readonly character: MaskCharacter
80
+ /** Basic value helper/ Объект для работы с базовыми значениями */
81
+ readonly valueBasic: MaskValueBasic
82
+ /** Value helper/ Объект для работы с итоговым значением */
83
+ readonly value: MaskValue
84
+ /** Validation helper/ Объект для работы с валидацией */
85
+ readonly validation: MaskValidation
86
+ /** View helper/ Объект для работы с отображением */
87
+ readonly view: MaskView
88
+ /** Emit helper/ Объект для работы с событиями */
89
+ readonly emit: MaskEmit
90
+ /** Data helper/ Объект для работы с вводом */
91
+ readonly data: MaskData
92
+ /** Event helper/ Объект для работы с DOM-событиями */
93
+ readonly event: MaskEvent
94
+
95
+ /**
96
+ * Constructor
97
+ * @param props input data/ входные данные
98
+ * @param refs input data in the form of reactive elements/ входные данные в виде реактивных элементов
99
+ * @param element input element/ элемент ввода
100
+ * @param classDesign design name/ название дизайна
101
+ * @param className class name/ название класса
102
+ * @param components object for working with components/ объект для работы с компонентами
103
+ * @param slots object for working with slots/ объект для работы со слотами
104
+ * @param emits the function is called when an event is triggered/ функция вызывается, когда срабатывает событие
105
+ */
106
+ constructor(
107
+ protected readonly props: MaskProps,
108
+ protected readonly refs: ToRefs<MaskProps>,
109
+ protected readonly element: Ref<MaskElementInput>,
110
+ protected readonly classDesign: string,
111
+ protected readonly className: string,
112
+ protected readonly components?: DesignComp<MaskComponents, MaskProps>,
113
+ protected readonly slots?: MaskSlots,
114
+ protected readonly emits?: ConstrEmit<MaskEmits>
115
+ ) {
116
+ this.type = new MaskType(this.props)
117
+ this.buffer = new MaskBuffer()
118
+ this.focus = new MaskFocus(this.buffer)
119
+ this.characterLength = new MaskCharacterLength()
120
+ this.rubberItem = new MaskRubberItem()
121
+ this.rubberTransition = new MaskRubberTransition()
122
+
123
+ this.date = new MaskDate(this.props, this.type)
124
+ this.format = new MaskFormat(this.props, this.type, this.rubberItem)
125
+
126
+ this.special = new MaskSpecial(
127
+ this.props,
128
+ this.type,
129
+ this.date,
130
+ this.format
131
+ )
132
+
133
+ this.match = new MaskMatch(this.props, this.special)
134
+ this.pattern = new MaskPattern(
135
+ this.props,
136
+ this.type,
137
+ this.date,
138
+ this.special
139
+ )
140
+
141
+ this.right = new MaskRight(this.props, this.type)
142
+
143
+ this.rubber = new MaskRubber(
144
+ this.props,
145
+ this.type,
146
+ this.rubberItem,
147
+ this.rubberTransition,
148
+ this.special,
149
+ this.match,
150
+ this.format
151
+ )
152
+
153
+ this.item = new MaskItem(
154
+ this.props,
155
+ this.type,
156
+ this.rubberItem,
157
+ this.characterLength,
158
+ this.date,
159
+ this.format,
160
+ this.special
161
+ )
162
+
163
+ this.selection = new MaskSelection(
164
+ this.special,
165
+ this.item
166
+ )
167
+
168
+ this.character = new MaskCharacter(
169
+ this.props,
170
+ this.rubberItem,
171
+ this.characterLength,
172
+ this.special,
173
+ this.item,
174
+ this.selection
175
+ )
176
+
177
+ this.valueBasic = new MaskValueBasic(
178
+ this.rubberTransition,
179
+ this.item,
180
+ this.special,
181
+ this.character
182
+ )
183
+
184
+ this.value = new MaskValue(
185
+ this.props,
186
+ this.type,
187
+ this.date,
188
+ this.format,
189
+ this.item,
190
+ this.special,
191
+ this.valueBasic
192
+ )
193
+
194
+ this.validation = new MaskValidation(
195
+ this.pattern,
196
+ this.value
197
+ )
198
+
199
+ this.view = new MaskView(
200
+ this.props,
201
+ this.type,
202
+ this.date,
203
+ this.format,
204
+ this.special,
205
+ this.rubber,
206
+ this.item,
207
+ this.valueBasic,
208
+ this.validation,
209
+ this.className
210
+ )
211
+
212
+ this.emit = new MaskEmit(
213
+ this.validation,
214
+ this.emits
215
+ )
216
+
217
+ this.data = new MaskData(
218
+ this.type,
219
+ this.buffer,
220
+ this.focus,
221
+ this.rubberTransition,
222
+ this.date,
223
+ this.special,
224
+ this.match,
225
+ this.rubber,
226
+ this.item,
227
+ this.selection,
228
+ this.character,
229
+ this.valueBasic,
230
+ this.value,
231
+ this.emit,
232
+ this.element
233
+ )
234
+
235
+ this.event = new MaskEvent(
236
+ this.buffer,
237
+ this.focus,
238
+ this.characterLength,
239
+ this.right,
240
+ this.selection,
241
+ this.valueBasic,
242
+ this.emit,
243
+ this.data
244
+ )
245
+
246
+ watch([refs.value], () => this.reset(props.value))
247
+ watch(this.basic, () => this.data.goSelection(false))
248
+
249
+ watch([GeoRef.getStandard(), refs.language], () => this.reset(this.value.getValueCache()))
250
+
251
+ if (props.value) {
252
+ this.data.reset(anyToString(props.value))
253
+ }
254
+ }
255
+
256
+ /** Receiving basic standard values/ Получение базовых стандартных значений */
257
+ readonly basic = computed<string>(() => {
258
+ if (this.right.isRight()) {
259
+ let data = ''
260
+
261
+ this.view.item.value.forEach((item) => {
262
+ data += item.value
263
+ })
264
+
265
+ return data
266
+ }
267
+
268
+ return this.view.input.value
269
+ })
270
+
271
+ /** Values for CSS class/ Значения для CSS-класса */
272
+ readonly classes = computed<ConstrClassObject>(() => ({
273
+ [`${this.className}--value`]: this.characterLength.is(),
274
+ [`${this.className}--end`]: this.right.isEnd()
275
+ }))
276
+
277
+ /**
278
+ * Sets new value and reinitializes mask.
279
+ *
280
+ * Устанавливает новое значение и переинициализирует маску.
281
+ * @param value new value/ новое значение
282
+ */
283
+ readonly set = (value: string) => this.reset(value)
284
+
285
+ /**
286
+ * Resets all values or updates to the new one.
287
+ *
288
+ * Сбрасывает все значения или обновляется до нового.
289
+ * @param value new values/ новые значения
290
+ */
291
+ reset(value?: string | number): boolean {
292
+ const newValue = anyToString(value)
293
+
294
+ if (newValue !== this.props.valueDefault) {
295
+ if (
296
+ this.value.item.value !== newValue
297
+ || (
298
+ this.valueBasic.item.value !== newValue
299
+ && !isFloat(newValue)
300
+ )
301
+ ) {
302
+ this.data.reset(newValue)
303
+ this.emit.set('reset', {} as Event).go()
304
+ return true
305
+ }
306
+ }
307
+
308
+ return false
309
+ }
310
+
311
+ /**
312
+ * Clears value to default and focuses input.
313
+ *
314
+ * Очищает значение до значения по умолчанию и фокусирует поле ввода.
315
+ */
316
+ readonly clear = () => {
317
+ this.data.reset((this.props.valueDefault ?? '').toString())
318
+ this.emit.set('reset', {} as Event).go()
319
+ this.element.value?.focus()
320
+ }
321
+ }
@@ -0,0 +1,89 @@
1
+ /**
2
+ * Class for temporary storage of entered symbols to keep input position during fast typing.
3
+ *
4
+ * Класс для временного хранения вводимых символов, чтобы не терять позицию ввода при быстром наборе.
5
+ */
6
+ export class MaskBuffer {
7
+ /** Stored characters/ Сохранённые символы */
8
+ protected chars: string[] = []
9
+ /** Flag: buffering started/ Флаг: буферизация запущена */
10
+ protected start: boolean = false
11
+
12
+ /**
13
+ * Checks if buffer has records.
14
+ *
15
+ * Проверяет, есть ли записи в буфере.
16
+ */
17
+ is(): boolean {
18
+ return this.chars.length > 0
19
+ }
20
+
21
+ /**
22
+ * Returns list of all buffered chars.
23
+ *
24
+ * Возвращает список всех символов в буфере.
25
+ */
26
+ get(): string[] {
27
+ return this.chars
28
+ }
29
+
30
+ /**
31
+ * Adds new symbol to buffer.
32
+ *
33
+ * Добавляет новый символ в буфер.
34
+ * @param key symbol to add / символ для добавления
35
+ */
36
+ add(key: string): this {
37
+ this.chars.push(key)
38
+ return this
39
+ }
40
+
41
+ /**
42
+ * Handles fast input: if buffering active — adds symbol, else starts buffering.
43
+ *
44
+ * Обрабатывает быстрый ввод: если буфер активен — добавляет символ, иначе запускает буферизацию.
45
+ * @param key symbol to process / символ для обработки
46
+ * @returns true if processing should continue outside buffer / true если ввод продолжается вне буфера
47
+ */
48
+ go(key: string): boolean {
49
+ if (this.start) {
50
+ this.add(key)
51
+ return false
52
+ }
53
+
54
+ this.goStart()
55
+ return true
56
+ }
57
+
58
+ /**
59
+ * Starts buffering.
60
+ *
61
+ * Запускает буферизацию.
62
+ */
63
+ goStart(): this {
64
+ this.start = true
65
+ return this
66
+ }
67
+
68
+ /**
69
+ * Resets all data (chars + start flag).
70
+ *
71
+ * Сбрасывает все данные (символы и флаг запуска).
72
+ */
73
+ reset(): this {
74
+ this.resetChars()
75
+ this.start = false
76
+
77
+ return this
78
+ }
79
+
80
+ /**
81
+ * Clears stored characters only.
82
+ *
83
+ * Очищает только сохранённые символы.
84
+ */
85
+ resetChars(): this {
86
+ this.chars = []
87
+ return this
88
+ }
89
+ }