@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,43 @@
1
+ import type { IconPropsBasic, IconPropsInclude } from '../Icon'
2
+ import type { LabelNumberProps } from '../../types/labelTypes'
3
+
4
+ interface BadgePropsToken {
5
+ // :type [!] System label / Системная метка
6
+ selected?: boolean
7
+ hide?: boolean
8
+ dot?: boolean
9
+ overlap?: 'rectangular' | 'circular' | 'static'
10
+ vertical?: 'top' | 'center' | 'bottom'
11
+ horizontal?: 'right' | 'center' | 'left'
12
+ // :type [!] System label / Системная метка
13
+ }
14
+
15
+ export interface BadgePropsBasic<
16
+ Icon extends IconPropsBasic = IconPropsBasic
17
+ > extends IconPropsInclude<Icon>,
18
+ LabelNumberProps {
19
+ dot?: boolean
20
+ }
21
+
22
+ /**
23
+ * Type describing incoming properties.
24
+ *
25
+ * Тип, описывающий входящие свойства.
26
+ */
27
+ export interface BadgeProps extends BadgePropsBasic, BadgePropsToken {
28
+ }
29
+
30
+ /**
31
+ * Default value for property.
32
+ *
33
+ * Значение по умолчанию для свойства.
34
+ */
35
+ export const defaultsBadge = {
36
+ ...{
37
+ // :default [!] System label / Системная метка
38
+ overlap: 'rectangular',
39
+ vertical: 'top',
40
+ horizontal: 'right'
41
+ // :default [!] System label / Системная метка
42
+ }
43
+ }
@@ -0,0 +1,83 @@
1
+ @use "@dxtmisha/styles/properties" as ui;
2
+ @use "../Button/style" as button;
3
+
4
+ @mixin mixinBadge {
5
+ @include button.mixinButton;
6
+
7
+ & {
8
+ @include ui.initByCustom('_shift', ui.v('??shift', var(--sys-height, 0)) / 2);
9
+ @include ui.initByCustom('_shiftOverlap', 0px);
10
+
11
+ position: absolute;
12
+ z-index: 4;
13
+ opacity: 1;
14
+
15
+ mask-repeat: no-repeat;
16
+ mask-position: center;
17
+ mask-image: none;
18
+ mask-size: 100%;
19
+
20
+ cursor: unset;
21
+
22
+ @include ui.scale(1);
23
+
24
+ &--hide,
25
+ &--hideAuto {
26
+ opacity: 0;
27
+
28
+ mask-image: radial-gradient(circle at center, transparent 10%, white 20%);
29
+ mask-size: 1000%;
30
+
31
+ @include ui.scale(1.12);
32
+ }
33
+
34
+ &--dot {
35
+ @include ui.aspectRatio(#{1/1});
36
+ @include ui.height(#{ui.v('??dotSize', ui.v('??dotFactor', calc(100% / 3))) !important});
37
+
38
+ @include ui.subclass('label') {
39
+ display: none;
40
+ }
41
+ }
42
+
43
+ &--overlap {
44
+ &--circular {
45
+ @include ui.initByCustom('_shiftOverlap', -16%);
46
+ }
47
+
48
+ &--static {
49
+ position: static;
50
+ }
51
+ }
52
+
53
+ &--vertical {
54
+ &--top {
55
+ top: calc(0% - #{ui.v('??_shiftOverlap')} - #{ui.v('??_shift')});
56
+ }
57
+
58
+ &--center {
59
+ top: 50%;
60
+ @include ui.translateY(-50%);
61
+ }
62
+
63
+ &--bottom {
64
+ bottom: calc(0% - #{ui.v('??_shiftOverlap')} - #{ ui.v('??_shift')});
65
+ }
66
+ }
67
+
68
+ &--horizontal {
69
+ &--right {
70
+ @include ui.left(calc(100% + #{ui.v('??_shiftOverlap')} - #{ui.v('??_shift')}));
71
+ }
72
+
73
+ &--center {
74
+ left: 50%;
75
+ @include ui.translateX(-50%);
76
+ }
77
+
78
+ &--left {
79
+ @include ui.right(calc(100% + #{ui.v('??_shiftOverlap')} - #{ui.v('??_shift')}));
80
+ }
81
+ }
82
+ }
83
+ }
@@ -0,0 +1,47 @@
1
+ import type { ConstrClass } from '@dxtmisha/functional'
2
+
3
+ import type { IconComponentInclude } from '../Icon'
4
+ import type { LabelNumberSlots } from '../../types/labelTypes'
5
+
6
+ /**
7
+ * Interface for describing which components need to be connected for work.
8
+ *
9
+ * Интерфейс для описания, какие компоненты надо подключить для работы.
10
+ */
11
+ export type BadgeComponents = IconComponentInclude
12
+
13
+ /**
14
+ * Type describing available events.
15
+ *
16
+ * Тип, описывающий доступные события.
17
+ */
18
+ export type BadgeEmits = {}
19
+
20
+ /**
21
+ * Type describing available properties.
22
+ *
23
+ * Тип, описывающий доступные свойства.
24
+ */
25
+ export interface BadgeExpose {
26
+ }
27
+
28
+ /**
29
+ * Type describing available slots.
30
+ *
31
+ * Тип, описывающий доступные слоты.
32
+ */
33
+ export interface BadgeSlots extends LabelNumberSlots {
34
+ }
35
+
36
+ /**
37
+ * Type describing subclasses.
38
+ *
39
+ * Тип, описывающий подклассы.
40
+ */
41
+ export type BadgeClasses = {
42
+ main: ConstrClass
43
+ // :classes [!] System label / Системная метка
44
+ label: string
45
+ icon: string
46
+ // :classes [!] System label / Системная метка
47
+ }
@@ -0,0 +1,188 @@
1
+ import { computed, reactive, type Ref, type ToRefs } from 'vue'
2
+ import { type ConstrEmit, DesignComp, forEach, getBind, toBind } from '@dxtmisha/functional'
3
+
4
+ import { LabelInclude } from '../../classes/LabelInclude'
5
+ import { DescriptionInclude } from '../../classes/DescriptionInclude'
6
+ import { EventClickInclude } from '../../classes/EventClickInclude'
7
+ import { ModelInclude } from '../../classes/ModelInclude'
8
+
9
+ import { WindowClassesInclude } from '../Window'
10
+ import { MotionTransformClassesInclude } from '../MotionTransform'
11
+ import { SkeletonInclude } from '../Skeleton'
12
+ import { BarsAction } from './BarsAction'
13
+
14
+ import type { BarsComponents, BarsEmits, BarsSlots } from './types'
15
+ import type { BarsProps } from './props'
16
+ import type { EventClickValue } from '../../types/eventClickTypes'
17
+
18
+ /**
19
+ * Bars
20
+ */
21
+ export class Bars {
22
+ /** Управление action‑режимом */
23
+ readonly action: BarsAction
24
+
25
+ readonly label: LabelInclude
26
+ readonly description: DescriptionInclude
27
+
28
+ readonly event: EventClickInclude
29
+
30
+ /** Helper for Window CSS classes/ Вспомогательный класс для CSS‑классов Window */
31
+ readonly windowClasses: WindowClassesInclude
32
+ /** Helper for MotionTransform CSS classes/ Вспомогательный класс для CSS‑классов MotionTransform */
33
+ readonly motionTransformClasses: MotionTransformClassesInclude
34
+ /** Подключение скелетона для текста/описания */
35
+ readonly skeleton: SkeletonInclude
36
+
37
+ /**
38
+ * Constructor
39
+ * @param props input data/ входные данные
40
+ * @param refs input data in the form of reactive elements/ входные данные в виде реактивных элементов
41
+ * @param element input element/ элемент ввода
42
+ * @param classDesign design name/ название дизайна
43
+ * @param className class name/ название класса
44
+ * @param components object for working with components/ объект для работы с компонентами
45
+ * @param slots object for working with slots/ объект для работы со слотами
46
+ * @param emits the function is called when an event is triggered/ функция вызывается, когда срабатывает событие
47
+ */
48
+ constructor(
49
+ protected readonly props: BarsProps,
50
+ protected readonly refs: ToRefs<BarsProps>,
51
+ protected readonly element: Ref<HTMLElement | undefined>,
52
+ protected readonly classDesign: string,
53
+ protected readonly className: string,
54
+ protected readonly components?: DesignComp<BarsComponents, BarsProps>,
55
+ protected readonly slots?: BarsSlots,
56
+ protected readonly emits?: ConstrEmit<BarsEmits>
57
+ ) {
58
+ const skeleton = new SkeletonInclude(this.props, this.classDesign, ['classTextVariant'])
59
+
60
+ this.action = new BarsAction(this.props, this.refs)
61
+
62
+ this.label = new LabelInclude(this.labelBinds,
63
+ className,
64
+ undefined,
65
+ slots,
66
+ undefined,
67
+ undefined,
68
+ undefined,
69
+ skeleton
70
+ )
71
+ this.description = new DescriptionInclude(this.descriptionBinds, className, slots, skeleton)
72
+
73
+ this.event = new EventClickInclude(undefined, undefined, emits)
74
+
75
+ this.windowClasses = new WindowClassesInclude(classDesign)
76
+ this.motionTransformClasses = new MotionTransformClassesInclude(classDesign)
77
+ this.skeleton = skeleton
78
+
79
+ new ModelInclude('action', this.emits, this.action.action)
80
+ }
81
+
82
+ /** Returns the button data/ Возвращает данные кнопки */
83
+ readonly backBinds = computed<BarsProps['buttonAttrs']>(
84
+ () => this.initItem(
85
+ toBind(
86
+ {
87
+ icon: {
88
+ icon: this.props.iconBack,
89
+ iconActive: this.props.iconClose
90
+ },
91
+ iconDir: true,
92
+ value: 'back',
93
+ class: [
94
+ this.windowClasses.get().close,
95
+ this.motionTransformClasses.get().close
96
+ ],
97
+ onClick: this.onClickBack
98
+ },
99
+ this.props.backButton ?? {}
100
+ ),
101
+ 'main-back'
102
+ )
103
+ )
104
+
105
+ /** Returns the list of control buttons/ Возвращает список кнопок управления */
106
+ readonly barsBinds = computed<BarsProps['bars']>(() => this.initList(this.props.bars))
107
+
108
+ /**
109
+ * Returns the list of active control buttons/
110
+ * Возвращает список активных кнопок управления
111
+ */
112
+ readonly actionBarsBinds = computed<BarsProps['bars']>(() => this.initList(this.props.actionBars, true))
113
+
114
+ /** Returns the button name/ Возвращает название кнопки */
115
+ readonly backLabel = computed<string | number | undefined>(() => this.action.is.value ? undefined : this.backBinds.value?.label)
116
+
117
+ /** Binds for label text/ Привязки для текста метки */
118
+ protected readonly labelBinds = reactive({
119
+ label: computed(() => this.action.is.value ? this.props.actionLabel : this.props.label)
120
+ })
121
+
122
+ /** Binds for description text/ Привязки для текста описания */
123
+ protected readonly descriptionBinds = reactive({
124
+ description: computed(() => this.action.is.value ? this.props.actionDescription : this.props.description)
125
+ })
126
+
127
+ /**
128
+ * Prepares all parameters for the button.
129
+ *
130
+ * Подготавливает все параметры для кнопки.
131
+ * @param item list of buttons/ список параметры
132
+ * @param key button identifier/ идентификатор кнопки
133
+ * @param isAction is action button/ является ли кнопка действия
134
+ */
135
+ protected initItem(
136
+ item: BarsProps['buttonAttrs'],
137
+ key: string | number,
138
+ isAction: boolean = false
139
+ ): BarsProps['buttonAttrs'] {
140
+ return {
141
+ isSkeleton: this.props.isSkeleton,
142
+ onClick: this.event.onClick,
143
+ ...toBind(
144
+ this.props.buttonAttrs ?? {},
145
+ item ?? {}
146
+ ),
147
+ key: `${isAction ? 'action' : ''}Bar-${item?.value ?? key}`,
148
+ icon: getBind(item?.icon, { animationShow: isAction }, 'icon')
149
+ }
150
+ }
151
+
152
+ /**
153
+ * Prepares all parameters for the button.
154
+ *
155
+ * Подготавливает список параметры для кнопки.
156
+ * @param bars list of buttons/ >список кнопок
157
+ * @param isAction is action button/ является ли кнопка действия
158
+ */
159
+ protected initList(
160
+ bars?: BarsProps['bars'],
161
+ isAction: boolean = false
162
+ ): BarsProps['bars'] {
163
+ if (bars) {
164
+ return forEach(
165
+ bars,
166
+ (item, key) => this.initItem(item, key, isAction)
167
+ ) as BarsProps['bars']
168
+ }
169
+
170
+ return undefined
171
+ }
172
+
173
+ /**
174
+ * Back button click handler: closes action mode and proxies click event.
175
+ *
176
+ * Обработчик кл��ка по кнопке «назад»: закрывает action‑режим и проксирует событие.
177
+ */
178
+ protected readonly onClickBack = (
179
+ event: MouseEvent,
180
+ options?: EventClickValue
181
+ ) => {
182
+ if (options?.value === 'back') {
183
+ this.action.close()
184
+ }
185
+
186
+ this.event.onClick(event, options)
187
+ }
188
+ }
@@ -0,0 +1,57 @@
1
+ import { computed, ref, type ToRefs, watch } from 'vue'
2
+ import type { BarsProps } from './props'
3
+
4
+ /**
5
+ * Управление action‑режимом для Bars.
6
+ *
7
+ * Controls Bars action mode.
8
+ */
9
+ export class BarsAction {
10
+ /** Текущее состояние action‑режима / Current action mode state */
11
+ readonly action = ref<boolean>(false)
12
+
13
+ /**
14
+ * Constructor
15
+ * @param props input data/ входные данные
16
+ * @param refs input data in the form of reactive elements/ входные данные в виде реактивных элементов
17
+ */
18
+ constructor(
19
+ protected readonly props: BarsProps,
20
+ protected readonly refs: ToRefs<BarsProps>
21
+ ) {
22
+ if (refs.action) {
23
+ watch(
24
+ refs.action,
25
+ (action) => {
26
+ this.action.value = Boolean(action)
27
+ },
28
+ { immediate: true }
29
+ )
30
+ }
31
+ }
32
+
33
+ /** Вычисляемый флаг активности action / Computed active flag */
34
+ readonly is = computed<boolean>(() => this.props.action || this.action.value)
35
+
36
+ /**
37
+ * Включить action‑режим.
38
+ *
39
+ * Enable action mode.
40
+ */
41
+ open() {
42
+ if (!this.action.value) {
43
+ this.action.value = true
44
+ }
45
+ }
46
+
47
+ /**
48
+ * Выключить action‑режим.
49
+ *
50
+ * Disable action mode.
51
+ */
52
+ close() {
53
+ if (this.action.value) {
54
+ this.action.value = false
55
+ }
56
+ }
57
+ }
@@ -0,0 +1,229 @@
1
+ import { h, type VNode } from 'vue'
2
+ import {
3
+ type ConstrOptions,
4
+ type ConstrStyles,
5
+ DesignConstructorAbstract
6
+ } from '@dxtmisha/functional'
7
+
8
+ import { Bars } from './Bars'
9
+
10
+ import {
11
+ type BarsPropsBasic
12
+ } from './props'
13
+ import {
14
+ type BarsClasses,
15
+ type BarsComponents,
16
+ type BarsEmits,
17
+ type BarsExpose,
18
+ type BarsSlots
19
+ } from './types'
20
+
21
+ /**
22
+ * BarsDesign
23
+ */
24
+ export class BarsDesign<
25
+ COMP extends BarsComponents,
26
+ EXPOSE extends BarsExpose,
27
+ CLASSES extends BarsClasses,
28
+ P extends BarsPropsBasic
29
+ > extends DesignConstructorAbstract<
30
+ HTMLDivElement,
31
+ COMP,
32
+ BarsEmits,
33
+ EXPOSE,
34
+ BarsSlots,
35
+ CLASSES,
36
+ P
37
+ > {
38
+ protected readonly item: Bars
39
+
40
+ /**
41
+ * Constructor
42
+ * @param name class name/ название класса
43
+ * @param props properties/ свойства
44
+ * @param options list of additional parameters/ список дополнительных параметров
45
+ */
46
+ constructor(
47
+ name: string,
48
+ props: Readonly<P>,
49
+ options?: ConstrOptions<COMP, BarsEmits, P>
50
+ ) {
51
+ super(
52
+ name,
53
+ props,
54
+ options
55
+ )
56
+
57
+ this.item = new Bars(
58
+ this.props,
59
+ this.refs,
60
+ this.element,
61
+ this.getDesign(),
62
+ this.getName(),
63
+ this.components,
64
+ this.slots,
65
+ this.emits
66
+ )
67
+
68
+ this.init()
69
+ }
70
+
71
+ /**
72
+ * Initialization of all the necessary properties for work
73
+ *
74
+ * Инициализация всех необходимых свойств для работы.
75
+ */
76
+ protected initExpose(): EXPOSE {
77
+ return {} as EXPOSE
78
+ }
79
+
80
+ /**
81
+ * Improvement of the obtained list of classes.
82
+ *
83
+ * Доработка полученного списка классов.
84
+ */
85
+ protected initClasses(): Partial<CLASSES> {
86
+ return {
87
+ main: {},
88
+ ...{
89
+ // :classes [!] System label / Системная метка
90
+ context: this.getSubClass('context'),
91
+ label: this.getSubClass('label'),
92
+ description: this.getSubClass('description')
93
+ // :classes [!] System label / Системная метка
94
+ }
95
+ } as Partial<CLASSES>
96
+ }
97
+
98
+ /**
99
+ * Refinement of the received list of styles.
100
+ *
101
+ * Доработка полученного списка стилей.
102
+ */
103
+ protected initStyles(): ConstrStyles {
104
+ return {}
105
+ }
106
+
107
+ /**
108
+ * A method for rendering.
109
+ *
110
+ * Метод для рендеринга.
111
+ */
112
+ protected initRender(): VNode {
113
+ return h(
114
+ 'div',
115
+ {
116
+ ...this.getAttrs(),
117
+ class: this.classes?.value.main
118
+ },
119
+ [
120
+ ...this.renderBackButton(),
121
+ ...this.renderContext(),
122
+ ...this.renderBars(),
123
+ ...this.renderActionBars()
124
+ ]
125
+ )
126
+ }
127
+
128
+ /**
129
+ * Rendering the close button.
130
+ *
131
+ * Рендеринг кнопки закрытия.
132
+ */
133
+ readonly renderBackButton = (): VNode[] => {
134
+ if (
135
+ this.props.backHide
136
+ && (
137
+ !this.item.action.is.value
138
+ || this.props.backActionHide
139
+ )
140
+ ) {
141
+ return []
142
+ }
143
+
144
+ return [
145
+ this.components.renderOne(
146
+ 'button',
147
+ {
148
+ label: this.item.backLabel.value,
149
+ selected: this.item.action.is.value,
150
+ ...this.item.backBinds.value
151
+ }
152
+ ) as VNode
153
+ ]
154
+ }
155
+
156
+ /**
157
+ * Rendering the content.
158
+ *
159
+ * Рендеринг контента.
160
+ */
161
+ readonly renderContext = (): VNode[] => {
162
+ return [
163
+ h(
164
+ 'div',
165
+ {
166
+ class: this.classes?.value.context
167
+ },
168
+ [
169
+ ...this.item.label.render(),
170
+ ...this.item.description.render()
171
+ ]
172
+ )
173
+ ]
174
+ }
175
+
176
+ /**
177
+ * Rendering the control button.
178
+ *
179
+ * Рендеринг кнопки управления.
180
+ */
181
+ readonly renderBars = (): VNode[] => {
182
+ const children: any[] = []
183
+
184
+ if (this.item.action.is.value) {
185
+ return children
186
+ }
187
+
188
+ children.push(...this.renderList(this.item.barsBinds.value))
189
+ this.initSlot('bars', children)
190
+
191
+ return children
192
+ }
193
+
194
+ /**
195
+ * Rendering the control button.
196
+ *
197
+ * Рендеринг кнопки управления.
198
+ */
199
+ readonly renderActionBars = (): VNode[] => {
200
+ const children: any[] = []
201
+
202
+ if (this.item.action.is.value) {
203
+ children.push(...this.renderList(this.item.actionBarsBinds.value))
204
+ this.initSlot('actionBars', children)
205
+ }
206
+
207
+ return children
208
+ }
209
+
210
+ /**
211
+ * Rendering a list of buttons from the list.
212
+ *
213
+ * Рендеринг списка кнопок по списку.
214
+ * @param list list of data for the button/ список данных для кнопки
215
+ */
216
+ readonly renderList = (
217
+ list: BarsPropsBasic['bars']
218
+ ): VNode[] => {
219
+ const children: VNode[] = []
220
+
221
+ if (list) {
222
+ list.forEach(
223
+ item => this.components.renderAdd(children, 'button', item)
224
+ )
225
+ }
226
+
227
+ return children
228
+ }
229
+ }