@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,189 @@
1
+ import { computed } from 'vue'
2
+ import { toNumber } from '@dxtmisha/functional'
3
+
4
+ import { FieldValueInclude } from './FieldValueInclude'
5
+ import { FieldTypeInclude } from './FieldTypeInclude'
6
+
7
+ import type { FieldAllProps, FieldArrowProps } from '../../types/fieldTypes'
8
+
9
+ /**
10
+ * Class for working with input arrows.
11
+ *
12
+ * Класс для работы со стрелками ввода.
13
+ */
14
+ export class FieldArrowInclude {
15
+ /**
16
+ * Constructor
17
+ * @param props input data/ входные данные
18
+ * @param value object for working with values/ объект для работы со значениями
19
+ * @param type object for working with input type/ объект для работы с типом ввода
20
+ */
21
+ constructor(
22
+ protected readonly props: FieldAllProps,
23
+ protected readonly value: FieldValueInclude,
24
+ protected readonly type?: FieldTypeInclude
25
+ ) {
26
+ }
27
+
28
+ /**
29
+ * Indicates if arrows are enabled/ Указывает, включены ли стрелки
30
+ *
31
+ * @return true if arrows are enabled/ true, если стрелки включены
32
+ */
33
+ readonly is = computed<boolean>(() => {
34
+ return Boolean(this.props.arrow && this.props.arrow !== 'none')
35
+ })
36
+
37
+ /** Indicates if the previous button is disabled/ Указывает, отключена ли кнопка предыдущего */
38
+ readonly disabledPrevious = computed<boolean>(() => !this.isPrevious(this.value.number.value))
39
+
40
+ /** Indicates if the next button is disabled/ Указывает, отключена ли кнопка следующего */
41
+ readonly disabledNext = computed<boolean>(() => !this.isNext(this.value.number.value))
42
+
43
+ /** Returns the change step/ Возвращает шаг изменения */
44
+ protected readonly step = computed<number>(() => toNumber(this.props.arrowStep ?? this.props.step ?? 1))
45
+
46
+ /** Returns the minimum value/ Возвращает минимальное значение */
47
+ protected readonly min = computed<number | undefined>(() => toNumber(this.props.min) ?? undefined)
48
+
49
+ /** Returns the maximum value/ Возвращает максимальное значение */
50
+ protected readonly max = computed<number | undefined>(() => toNumber(this.props.max) || undefined)
51
+
52
+ /**
53
+ * Checks if the arrow type is carousel.
54
+ *
55
+ * Проверяет, является ли тип стрелок carousel.
56
+ */
57
+ isCarousel(): boolean {
58
+ return this.get() === 'carousel'
59
+ }
60
+
61
+ /**
62
+ * Checks if the arrow type is stepper.
63
+ *
64
+ * Проверяет, является ли тип стрелок stepper.
65
+ */
66
+ isStepper(): boolean {
67
+ return this.get() === 'stepper'
68
+ }
69
+
70
+ /**
71
+ * Checks if it is possible to decrease the value.
72
+ *
73
+ * Проверяет, можно ли уменьшить значение.
74
+ * @param value values for checking/ значения для проверки
75
+ */
76
+ isPrevious(value: number): boolean {
77
+ const min = this.min.value
78
+ return min === undefined || value > min
79
+ }
80
+
81
+ /**
82
+ * Checks if it is possible to increase the value.
83
+ *
84
+ * Проверяет, можно ли увеличить значение.
85
+ * @param value values for checking/ значения для проверки
86
+ */
87
+ isNext(value: number): boolean {
88
+ const max = this.max.value
89
+ return max === undefined || value < max
90
+ }
91
+
92
+ /**
93
+ * Returns arrow type.
94
+ *
95
+ * Возвращает тип стрелок.
96
+ */
97
+ get(): FieldArrowProps['arrow'] | undefined {
98
+ switch (this.props.arrow) {
99
+ case 'auto':
100
+ if (
101
+ this.type?.get() === 'number'
102
+ || this.type?.get() === 'number-format'
103
+ ) {
104
+ return 'stepper'
105
+ }
106
+
107
+ break
108
+ }
109
+
110
+ return this.props.arrow
111
+ }
112
+
113
+ /**
114
+ * Returns arrow alignment.
115
+ *
116
+ * Возвращает выравнивание стрелок.
117
+ */
118
+ align(): string | undefined {
119
+ return this.props.arrowAlign
120
+ }
121
+
122
+ /**
123
+ * Decreases the value.
124
+ *
125
+ * Уменьшает значение.
126
+ */
127
+ previous(): this {
128
+ const value = this.value.number.value - this.step.value
129
+
130
+ if (this.isPrevious(value)) {
131
+ this.value.set(value.toString())
132
+ } else {
133
+ this.toMin()
134
+ }
135
+
136
+ return this
137
+ }
138
+
139
+ /**
140
+ * Increases the value.
141
+ *
142
+ * Увеличивает значение.
143
+ */
144
+ next(): this {
145
+ const value = this.value.number.value + this.step.value
146
+
147
+ if (this.isNext(value)) {
148
+ this.value.set(value.toString())
149
+ } else {
150
+ this.toMax()
151
+ }
152
+
153
+ return this
154
+ }
155
+
156
+ /**
157
+ * Decreases to the minimum value.
158
+ *
159
+ * Уменьшает до минимального значения.
160
+ */
161
+ toMin(): this {
162
+ if (!this.disabledPrevious.value) {
163
+ const min = this.min.value
164
+
165
+ if (min !== undefined) {
166
+ this.value.set(min.toString())
167
+ }
168
+ }
169
+
170
+ return this
171
+ }
172
+
173
+ /**
174
+ * Increases to the maximum value.
175
+ * s
176
+ * Увеличивает до максимального значения.
177
+ */
178
+ toMax(): this {
179
+ if (!this.disabledNext.value) {
180
+ const max = this.max.value
181
+
182
+ if (max !== undefined) {
183
+ this.value.set(max.toString())
184
+ }
185
+ }
186
+
187
+ return this
188
+ }
189
+ }
@@ -1,7 +1,9 @@
1
1
  import { computed } from 'vue'
2
+ import { toBinds } from '@dxtmisha/functional'
2
3
 
3
4
  import { FieldTypeInclude } from './FieldTypeInclude'
4
5
  import { FieldPatternInclude } from './FieldPatternInclude'
6
+ import { FieldInputModeInclude } from './FieldInputModeInclude'
5
7
 
6
8
  import type { FieldAllProps } from '../../types/fieldTypes'
7
9
 
@@ -17,43 +19,19 @@ export class FieldAttributesInclude {
17
19
  * @param type object for working with input type/ объект для работы с типом ввода
18
20
  * @param pattern object for working with checks by regular expressions/
19
21
  * объект для работы с проверкой по регулярным выражениям
22
+ * @param inputMode object for working with the keyboard/ объект для работы с клавиатурой
20
23
  */
21
24
  constructor(
22
25
  protected readonly props: FieldAllProps,
23
26
  protected readonly type?: FieldTypeInclude,
24
- protected readonly pattern?: FieldPatternInclude
27
+ protected readonly pattern?: FieldPatternInclude,
28
+ protected readonly inputMode?: FieldInputModeInclude
25
29
  ) {
26
30
  }
27
31
 
28
32
  /** Returns data for verification/ Возвращает данные для проверки */
29
33
  readonly list = computed<Record<string, any>>(() => {
30
- const data: Record<string, any> = {}
31
-
32
- this.getAttributes().forEach((index) => {
33
- if (index in this.props) {
34
- switch (index) {
35
- case 'type':
36
- if (this.type) {
37
- data[index] = this.type.item.value
38
- } else {
39
- data[index] = this.props.type
40
- }
41
- break
42
- case 'pattern':
43
- if (this.pattern) {
44
- data.pattern = this.pattern.item.value
45
- }
46
- break
47
- default:
48
- data[index] = this.props[index]
49
- }
50
- }
51
- })
52
-
53
- return {
54
- ...data,
55
- ...this.props.inputAttrs
56
- }
34
+ return this.getData(this.getAttributes())
57
35
  })
58
36
 
59
37
  /** Returns data for verification/ Возвращает данные для проверки */
@@ -74,6 +52,11 @@ export class FieldAttributesInclude {
74
52
  return data
75
53
  })
76
54
 
55
+ /** Returns data for the input element/ Возвращает данные для элемента ввода */
56
+ readonly listForInput = computed<Record<string, any>>(() => {
57
+ return this.getData(this.getInputAttributes())
58
+ })
59
+
77
60
  /**
78
61
  * Returns the list of attributes to be set on the input element.
79
62
  *
@@ -97,4 +80,80 @@ export class FieldAttributesInclude {
97
80
  'pattern'
98
81
  ]
99
82
  }
83
+
84
+ /**
85
+ * Returns the list of attributes to be set on the input element.
86
+ *
87
+ * Возвращает список атрибутов, которые нужно установить на элемент ввода.
88
+ */
89
+ protected getInputAttributes(): (keyof typeof this.props)[] {
90
+ return [
91
+ ...this.getAttributes(),
92
+
93
+ // Input
94
+ 'list',
95
+
96
+ // Value
97
+ 'placeholder',
98
+
99
+ // Basic
100
+ 'readonly',
101
+ 'disabled',
102
+ 'autofocus',
103
+ 'tabindex',
104
+ 'form',
105
+
106
+ // UX
107
+ 'autocomplete',
108
+ 'autocapitalize',
109
+ 'inputMode',
110
+ 'enterKeyHint',
111
+ 'spellcheck',
112
+ 'autocorrect'
113
+ ]
114
+ }
115
+
116
+ /**
117
+ * Returns data for the specified attributes.
118
+ *
119
+ * Возвращает данные для указанных атрибутов.
120
+ * @param attributes list of attributes/ список атрибутов
121
+ */
122
+ protected getData(attributes: (keyof typeof this.props)[]): Record<string, any> {
123
+ const data: Record<string, any> = {}
124
+
125
+ attributes.forEach((index) => {
126
+ let value: any = undefined
127
+
128
+ if (index in this.props) {
129
+ switch (index) {
130
+ case 'type':
131
+ if (this.type) {
132
+ value = this.type.item.value
133
+ } else {
134
+ value = this.props.type
135
+ }
136
+ break
137
+ case 'pattern':
138
+ if (this.pattern) {
139
+ value = this.pattern.item.value
140
+ }
141
+ break
142
+ case 'inputMode':
143
+ if (this.inputMode) {
144
+ value = this.inputMode.item.value
145
+ }
146
+ break
147
+ default:
148
+ value = this.props[index]
149
+ }
150
+ }
151
+
152
+ if (value !== undefined) {
153
+ data[index] = value
154
+ }
155
+ })
156
+
157
+ return toBinds(data, this.props.inputAttrs)
158
+ }
100
159
  }
@@ -44,7 +44,7 @@ export class FieldChangeInclude {
44
44
  *
45
45
  * Принудительно помечает как изменённое
46
46
  */
47
- toChange() {
47
+ to() {
48
48
  if (!this.item.value) {
49
49
  this.set(true)
50
50
  }
@@ -1,4 +1,4 @@
1
- import type { Ref } from 'vue'
1
+ import { type Ref } from 'vue'
2
2
  import type { FieldAllProps, FieldElementInput } from '../../types/fieldTypes'
3
3
 
4
4
  /**
@@ -0,0 +1,253 @@
1
+ import { type ConstrEmit } from '@dxtmisha/functional'
2
+
3
+ import { ModelInclude } from '../ModelInclude'
4
+ import { FieldChangeInclude } from './FieldChangeInclude'
5
+ import { FieldValueInclude } from './FieldValueInclude'
6
+ import { FieldValidationInclude } from './FieldValidationInclude'
7
+
8
+ import type { FieldAllProps, FieldBasicEmits, FieldValidationItem } from '../../types/fieldTypes'
9
+
10
+ /**
11
+ * Class for working with events.
12
+ *
13
+ * Класс для работы с событиями.
14
+ */
15
+ export class FieldEventInclude {
16
+ protected readonly model: ModelInclude
17
+
18
+ /**
19
+ * Constructor
20
+ * @param props input data/ входные данные
21
+ * @param change object for working with data change label/ объект для работы с меткой об изменении данных
22
+ * @param value object for working with values/ объект для работы со значениями
23
+ * @param validation object for working with validity/ объект для работы с валидностью
24
+ * @param emits the function is called when an event is triggered/ функция вызывается, когда срабатывает событие
25
+ */
26
+
27
+ constructor(
28
+ protected readonly props: FieldAllProps,
29
+ protected readonly change: FieldChangeInclude,
30
+ protected readonly value: FieldValueInclude,
31
+ protected readonly validation?: FieldValidationInclude,
32
+ protected readonly emits?: ConstrEmit<FieldBasicEmits>
33
+ ) {
34
+ this.model = new ModelInclude(
35
+ 'value',
36
+ this.emits,
37
+ this.value.itemByFull
38
+ )
39
+ }
40
+
41
+ /**
42
+ * Events for losing focus.
43
+ *
44
+ * События для потери фокуса.
45
+ */
46
+ readonly onBlur = () => {
47
+ this.change.to()
48
+ }
49
+
50
+ /**
51
+ * Call of data change event.
52
+ *
53
+ * Вызов события изменения данных.
54
+ * @param event event object/ объект события
55
+ * @param data object with data/ объект с данными
56
+ */
57
+ readonly onInput = (
58
+ event: InputEvent,
59
+ data?: Record<string, any>
60
+ ): void => {
61
+ if (this.isEnabled()) {
62
+ const newData = data ?? event
63
+
64
+ if (
65
+ this.change.is()
66
+ || data
67
+ ) {
68
+ this.validation?.set(newData)
69
+ }
70
+
71
+ this.value.setByEvent(newData)
72
+ this.on(event)
73
+ }
74
+ }
75
+
76
+ /**
77
+ * Triggering the change event after losing focus.
78
+ *
79
+ * Вызов события изменения после потери фокуса.
80
+ * @param event event object/ объект события
81
+ */
82
+ readonly onChange = (event?: InputEvent | Event): void => {
83
+ if (this.isEnabled()) {
84
+ if (event) {
85
+ this.validation?.set(event)
86
+ }
87
+
88
+ this.change.to()
89
+ this.on(event, 'change')
90
+ }
91
+ }
92
+
93
+ /**
94
+ * Triggering the event for select change.
95
+ *
96
+ * Вызов события для изменения селект.
97
+ * @param event event object/ объект события
98
+ * @param data object with data/ объект с данными
99
+ */
100
+ readonly onSelect = (
101
+ event: Event,
102
+ data?: Record<string, any>
103
+ ): void => {
104
+ if (this.isEnabled()) {
105
+ this.value.setByEvent(data ?? event)
106
+ this.onAndChange(event)
107
+ }
108
+ }
109
+
110
+ /**
111
+ * Triggering the event for changes in the checkbox.
112
+ *
113
+ * Вызов события для изменения в checkbox.
114
+ * @param event event object/ объект события
115
+ */
116
+ readonly onChecked = (event: Event): void => {
117
+ if (this.isEnabled()) {
118
+ this.value.setByChecked(event)
119
+ this.onAndChange(event)
120
+ }
121
+ }
122
+
123
+ /**
124
+ * Triggering the event for changes in the radio.
125
+ *
126
+ * Вызов события для изменения в radio.
127
+ * @param event event object/ объект события
128
+ */
129
+ readonly onRadio = (event: Event): void => {
130
+ if (this.isEnabled()) {
131
+ this.value.setByRadio(event)
132
+ this.onAndChange(event)
133
+ }
134
+ }
135
+
136
+ /**
137
+ * Triggering the event to delete all values.<br>
138
+ * Вызов события для удаления всех значений.
139
+ * @param event event object/ объект события
140
+ */
141
+ readonly onClear = (event: MouseEvent): void => {
142
+ if (this.isEnabled()) {
143
+ this.value.clear()
144
+ this.onAndChange(event)
145
+ }
146
+ }
147
+
148
+ /**
149
+ * Triggering the event to set a specific value.
150
+ *
151
+ * Вызов события для установки конкретного значения.
152
+ * @param value new value/ новое значение
153
+ */
154
+ readonly onValue = (value: any): void => {
155
+ if (this.isEnabled()) {
156
+ this.value.set(value)
157
+ this.onAndChange()
158
+ }
159
+ }
160
+
161
+ /**
162
+ * Triggering the event.
163
+ *
164
+ * Вызов события.
165
+ * @param event event object/ объект события
166
+ * @param type event type/ тип события
167
+ */
168
+ readonly on = <E>(
169
+ event?: E,
170
+ type: string & keyof FieldBasicEmits = 'input'
171
+ ): this => {
172
+ if (type === 'input') {
173
+ this.model.emit(this.value.itemByFull.value)
174
+ }
175
+
176
+ this.emits?.(type as 'input', event as Event, {
177
+ ...this.getValidation(type),
178
+ ...this.getData()
179
+ })
180
+
181
+ return this
182
+ }
183
+
184
+ /**
185
+ * Checks whether additional data needs to be generated for the current event.
186
+ *
187
+ * Проверяет, надо ли генерировать дополнительные данные для текущего события.
188
+ * @param type event type/ тип события
189
+ */
190
+ protected isValue(
191
+ type: string & keyof FieldBasicEmits
192
+ ): boolean {
193
+ return Boolean(type && ['input', 'change'].indexOf(type) >= 0)
194
+ }
195
+
196
+ /**
197
+ * Checks if it is possible to change the value.
198
+ *
199
+ * Проверяет, возможно ли изменение значения.
200
+ */
201
+ protected isEnabled(): boolean {
202
+ return this.props.disabled !== true
203
+ }
204
+
205
+ /**
206
+ * Returns input data.
207
+ *
208
+ * Возвращает данные об вводе.
209
+ */
210
+ protected getData(): FieldValidationItem {
211
+ return {
212
+ value: this.value.itemByFull.value,
213
+ valueInput: this.value.item.value,
214
+ detail: this.props.detail
215
+ }
216
+ }
217
+
218
+ /**
219
+ * Returns validity data.
220
+ *
221
+ * Возвращает данные валидности.
222
+ * @param type event type/ тип события
223
+ */
224
+ protected getValidation(
225
+ type: string & keyof FieldBasicEmits
226
+ ): FieldValidationItem {
227
+ if (this.isValue(type)) {
228
+ if (this.validation) {
229
+ return this.validation.item.value
230
+ }
231
+
232
+ return {
233
+ group: 'check',
234
+ value: this.value.item.value
235
+ }
236
+ }
237
+
238
+ return {} as FieldValidationItem
239
+ }
240
+
241
+ /**
242
+ * Triggering the event and change event.
243
+ *
244
+ * Вызов события и события изменения.
245
+ * @param event event object/ объект события
246
+ */
247
+ protected onAndChange(event?: InputEvent | Event): this {
248
+ this.on(event)
249
+ .onChange(event)
250
+
251
+ return this
252
+ }
253
+ }
@@ -0,0 +1,48 @@
1
+ import { computed } from 'vue'
2
+ import { FieldTypeInclude } from './FieldTypeInclude'
3
+
4
+ import type { FieldAllProps } from '../../types/fieldTypes'
5
+
6
+ /**
7
+ * Class for getting the type of displayed keyboard.
8
+ *
9
+ * Класс для получения типа отображаемой клавиатуры.
10
+ */
11
+ export class FieldInputModeInclude {
12
+ /**
13
+ * Constructor
14
+ * @param props input data/ входные данные
15
+ * @param type object for working with input type/ объект для работы с типом ввода
16
+ */
17
+ constructor(
18
+ protected readonly props: FieldAllProps,
19
+ protected readonly type: FieldTypeInclude
20
+ ) {
21
+ }
22
+
23
+ /** Returns the keyboard name/ Возвращает название клавиатуры */
24
+ readonly item = computed<string | undefined>(() => {
25
+ if (this.props.inputMode) {
26
+ return this.props.inputMode
27
+ }
28
+
29
+ switch (this.type.item.value) {
30
+ case 'number':
31
+ case 'datetime':
32
+ case 'date':
33
+ case 'year-month':
34
+ case 'time':
35
+ case 'hour-minute':
36
+ return 'numeric'
37
+ case 'number-format':
38
+ case 'currency':
39
+ return 'decimal'
40
+ case 'tel':
41
+ return 'tel'
42
+ case 'email':
43
+ return 'email'
44
+ default:
45
+ return undefined
46
+ }
47
+ })
48
+ }
@@ -1,4 +1,6 @@
1
- import { anyToString, isObject, Translate } from '@dxtmisha/functional'
1
+ import { anyToString, isObject } from '@dxtmisha/functional'
2
+
3
+ import { TextInclude } from '../TextInclude'
2
4
 
3
5
  import { FieldElementInclude } from './FieldElementInclude'
4
6
  import { FieldValueInclude } from './FieldValueInclude'
@@ -17,11 +19,13 @@ export class FieldMatchInclude {
17
19
  * @param props input data/ входные данные
18
20
  * @param element object for working with input element/ объект для работы с элементом ввода
19
21
  * @param value object for working with value/ объект для работы со значениями
22
+ * @param text object for working with texts/ объект для работы с текстами
20
23
  */
21
24
  constructor(
22
25
  protected readonly props: FieldAllProps,
23
26
  protected readonly element: FieldElementInclude,
24
- protected readonly value: FieldValueInclude
27
+ protected readonly value: FieldValueInclude,
28
+ protected readonly text?: TextInclude
25
29
  ) {
26
30
  }
27
31
 
@@ -65,7 +69,9 @@ export class FieldMatchInclude {
65
69
  return this.props.match.validationMessage
66
70
  }
67
71
 
68
- return Translate.getSync('Your entries must match.')
72
+ if (this.text) {
73
+ return this.text.entriesMatch.value ?? ''
74
+ }
69
75
  }
70
76
 
71
77
  return ''