@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.
- package/LICENSE +21 -0
- package/README.md +136 -0
- package/package.json +124 -0
- package/src/classes/CaptionInclude.ts +71 -0
- package/src/classes/DescriptionInclude.ts +70 -0
- package/src/classes/EnabledInclude.ts +56 -0
- package/src/classes/EventClickInclude.ts +138 -0
- package/src/classes/LabelHighlightInclude.ts +90 -0
- package/src/classes/LabelInclude.ts +171 -0
- package/src/classes/LabelNumberInclude.ts +70 -0
- package/src/classes/ModelInclude.ts +49 -0
- package/src/classes/PrefixInclude.ts +71 -0
- package/src/classes/SuffixInclude.ts +71 -0
- package/src/classes/field/FieldAttributesInclude.ts +100 -0
- package/src/classes/field/FieldChangeInclude.ts +52 -0
- package/src/classes/field/FieldCodeInclude.ts +69 -0
- package/src/classes/field/FieldElementInclude.ts +97 -0
- package/src/classes/field/FieldInputCheckInclude.ts +128 -0
- package/src/classes/field/FieldMatchInclude.ts +101 -0
- package/src/classes/field/FieldPatternInclude.ts +42 -0
- package/src/classes/field/FieldTypeInclude.ts +42 -0
- package/src/classes/field/FieldValidationInclude.ts +196 -0
- package/src/classes/field/FieldValueInclude.ts +318 -0
- package/src/classes/field/FieldVisibilityInclude.ts +21 -0
- package/src/constructors/Badge/Badge.ts +73 -0
- package/src/constructors/Badge/BadgeDesign.tsx +127 -0
- package/src/constructors/Badge/BadgeInclude.ts +78 -0
- package/src/constructors/Badge/basicTypes.ts +15 -0
- package/src/constructors/Badge/index.ts +5 -0
- package/src/constructors/Badge/properties.json +36 -0
- package/src/constructors/Badge/props.ts +43 -0
- package/src/constructors/Badge/style.scss +83 -0
- package/src/constructors/Badge/types.ts +47 -0
- package/src/constructors/Bars/Bars.ts +188 -0
- package/src/constructors/Bars/BarsAction.ts +57 -0
- package/src/constructors/Bars/BarsDesign.tsx +229 -0
- package/src/constructors/Bars/BarsInclude.ts +116 -0
- package/src/constructors/Bars/basicTypes.ts +40 -0
- package/src/constructors/Bars/index.ts +6 -0
- package/src/constructors/Bars/properties.json +6 -0
- package/src/constructors/Bars/props.ts +63 -0
- package/src/constructors/Bars/style.scss +18 -0
- package/src/constructors/Bars/types.ts +58 -0
- package/src/constructors/Button/Button.ts +88 -0
- package/src/constructors/Button/ButtonDesign.tsx +136 -0
- package/src/constructors/Button/ButtonInclude.ts +80 -0
- package/src/constructors/Button/basicTypes.ts +12 -0
- package/src/constructors/Button/index.ts +5 -0
- package/src/constructors/Button/properties.json +84 -0
- package/src/constructors/Button/props.ts +55 -0
- package/src/constructors/Button/style.scss +96 -0
- package/src/constructors/Button/types.ts +56 -0
- package/src/constructors/Cell/Cell.ts +127 -0
- package/src/constructors/Cell/CellDesign.tsx +203 -0
- package/src/constructors/Cell/basicTypes.ts +6 -0
- package/src/constructors/Cell/index.ts +5 -0
- package/src/constructors/Cell/properties.json +52 -0
- package/src/constructors/Cell/props.ts +61 -0
- package/src/constructors/Cell/style.scss +80 -0
- package/src/constructors/Cell/types.ts +68 -0
- package/src/constructors/Chip/Chip.ts +33 -0
- package/src/constructors/Chip/ChipDesign.tsx +26 -0
- package/src/constructors/Chip/basicTypes.ts +0 -0
- package/src/constructors/Chip/index.ts +4 -0
- package/src/constructors/Chip/properties.json +3 -0
- package/src/constructors/Chip/props.ts +44 -0
- package/src/constructors/Chip/style.scss +6 -0
- package/src/constructors/Chip/types.ts +53 -0
- package/src/constructors/Field/Field.ts +147 -0
- package/src/constructors/Field/FieldDesign.tsx +372 -0
- package/src/constructors/Field/FieldIcons.ts +99 -0
- package/src/constructors/Field/FieldInclude.ts +72 -0
- package/src/constructors/Field/FieldSize.ts +93 -0
- package/src/constructors/Field/basicTypes.ts +90 -0
- package/src/constructors/Field/index.ts +5 -0
- package/src/constructors/Field/properties.json +86 -0
- package/src/constructors/Field/props.ts +88 -0
- package/src/constructors/Field/style.scss +556 -0
- package/src/constructors/Field/types.ts +78 -0
- package/src/constructors/FieldCounter/FieldCounter.ts +75 -0
- package/src/constructors/FieldCounter/FieldCounterDesign.tsx +122 -0
- package/src/constructors/FieldCounter/FieldCounterInclude.ts +98 -0
- package/src/constructors/FieldCounter/basicTypes.ts +25 -0
- package/src/constructors/FieldCounter/index.ts +6 -0
- package/src/constructors/FieldCounter/properties.json +3 -0
- package/src/constructors/FieldCounter/props.ts +32 -0
- package/src/constructors/FieldCounter/style.scss +4 -0
- package/src/constructors/FieldCounter/types.ts +42 -0
- package/src/constructors/FieldLabel/FieldLabel.ts +93 -0
- package/src/constructors/FieldLabel/FieldLabelDesign.tsx +156 -0
- package/src/constructors/FieldLabel/FieldLabelInclude.ts +91 -0
- package/src/constructors/FieldLabel/basicTypes.ts +34 -0
- package/src/constructors/FieldLabel/index.ts +6 -0
- package/src/constructors/FieldLabel/properties.json +4 -0
- package/src/constructors/FieldLabel/props.ts +40 -0
- package/src/constructors/FieldLabel/style.scss +10 -0
- package/src/constructors/FieldLabel/types.ts +49 -0
- package/src/constructors/FieldMessage/FieldMessage.ts +79 -0
- package/src/constructors/FieldMessage/FieldMessageDesign.tsx +159 -0
- package/src/constructors/FieldMessage/FieldMessageInclude.ts +105 -0
- package/src/constructors/FieldMessage/FieldMessageMessage.ts +54 -0
- package/src/constructors/FieldMessage/basicTypes.ts +27 -0
- package/src/constructors/FieldMessage/index.ts +6 -0
- package/src/constructors/FieldMessage/properties.json +9 -0
- package/src/constructors/FieldMessage/props.ts +40 -0
- package/src/constructors/FieldMessage/style.scss +13 -0
- package/src/constructors/FieldMessage/types.ts +49 -0
- package/src/constructors/Icon/Icon.ts +105 -0
- package/src/constructors/Icon/IconDesign.tsx +157 -0
- package/src/constructors/Icon/IconInclude.ts +64 -0
- package/src/constructors/Icon/IconLiteInclude.ts +121 -0
- package/src/constructors/Icon/IconTrailingInclude.ts +106 -0
- package/src/constructors/Icon/basicTypes.ts +50 -0
- package/src/constructors/Icon/index.ts +8 -0
- package/src/constructors/Icon/properties.json +25 -0
- package/src/constructors/Icon/props.ts +54 -0
- package/src/constructors/Icon/style.scss +106 -0
- package/src/constructors/Icon/types.ts +46 -0
- package/src/constructors/Image/Image.ts +184 -0
- package/src/constructors/Image/ImageAdaptiveGroup.ts +230 -0
- package/src/constructors/Image/ImageAdaptiveItem.ts +295 -0
- package/src/constructors/Image/ImageBackground.ts +127 -0
- package/src/constructors/Image/ImageCalculation.ts +184 -0
- package/src/constructors/Image/ImageCalculationList.ts +61 -0
- package/src/constructors/Image/ImageCoordinator.ts +104 -0
- package/src/constructors/Image/ImageData.ts +99 -0
- package/src/constructors/Image/ImageDesign.tsx +137 -0
- package/src/constructors/Image/ImageFile.ts +137 -0
- package/src/constructors/Image/ImageInclude.ts +53 -0
- package/src/constructors/Image/ImagePdf.ts +44 -0
- package/src/constructors/Image/ImagePosition.ts +49 -0
- package/src/constructors/Image/ImageType.ts +83 -0
- package/src/constructors/Image/basicTypes.ts +70 -0
- package/src/constructors/Image/index.ts +5 -0
- package/src/constructors/Image/properties.json +17 -0
- package/src/constructors/Image/props.ts +66 -0
- package/src/constructors/Image/style.scss +77 -0
- package/src/constructors/Image/types.ts +49 -0
- package/src/constructors/List/List.ts +267 -0
- package/src/constructors/List/ListControl.ts +194 -0
- package/src/constructors/List/ListDesign.tsx +382 -0
- package/src/constructors/List/ListFocus.ts +196 -0
- package/src/constructors/List/ListGo.ts +283 -0
- package/src/constructors/List/ListSearch.ts +113 -0
- package/src/constructors/List/basicTypes.ts +3 -0
- package/src/constructors/List/index.ts +5 -0
- package/src/constructors/List/properties.json +16 -0
- package/src/constructors/List/props.ts +76 -0
- package/src/constructors/List/style.scss +36 -0
- package/src/constructors/List/types.ts +66 -0
- package/src/constructors/ListGroup/ListGroup.ts +53 -0
- package/src/constructors/ListGroup/ListGroupDesign.tsx +180 -0
- package/src/constructors/ListGroup/ListGroupOpen.ts +56 -0
- package/src/constructors/ListGroup/basicTypes.ts +3 -0
- package/src/constructors/ListGroup/index.ts +5 -0
- package/src/constructors/ListGroup/properties.json +15 -0
- package/src/constructors/ListGroup/props.ts +30 -0
- package/src/constructors/ListGroup/style.scss +18 -0
- package/src/constructors/ListGroup/types.ts +51 -0
- package/src/constructors/ListItem/ListItem.ts +115 -0
- package/src/constructors/ListItem/ListItemDesign.tsx +196 -0
- package/src/constructors/ListItem/basicTypes.ts +3 -0
- package/src/constructors/ListItem/index.ts +5 -0
- package/src/constructors/ListItem/properties.json +52 -0
- package/src/constructors/ListItem/props.ts +78 -0
- package/src/constructors/ListItem/style.scss +152 -0
- package/src/constructors/ListItem/types.ts +78 -0
- package/src/constructors/ListMenu/ListMenu.ts +52 -0
- package/src/constructors/ListMenu/ListMenuDesign.tsx +127 -0
- package/src/constructors/ListMenu/basicTypes.ts +3 -0
- package/src/constructors/ListMenu/index.ts +5 -0
- package/src/constructors/ListMenu/properties.json +19 -0
- package/src/constructors/ListMenu/props.ts +34 -0
- package/src/constructors/ListMenu/style.scss +5 -0
- package/src/constructors/ListMenu/types.ts +54 -0
- package/src/constructors/Mask/Mask.ts +321 -0
- package/src/constructors/Mask/MaskBuffer.ts +89 -0
- package/src/constructors/Mask/MaskCharacter.ts +192 -0
- package/src/constructors/Mask/MaskCharacterLength.ts +40 -0
- package/src/constructors/Mask/MaskData.ts +287 -0
- package/src/constructors/Mask/MaskDate.ts +157 -0
- package/src/constructors/Mask/MaskDesign.tsx +217 -0
- package/src/constructors/Mask/MaskEmit.ts +140 -0
- package/src/constructors/Mask/MaskEvent.ts +347 -0
- package/src/constructors/Mask/MaskFocus.ts +49 -0
- package/src/constructors/Mask/MaskFormat.ts +216 -0
- package/src/constructors/Mask/MaskItem.ts +218 -0
- package/src/constructors/Mask/MaskMatch.ts +73 -0
- package/src/constructors/Mask/MaskPattern.ts +123 -0
- package/src/constructors/Mask/MaskRight.ts +43 -0
- package/src/constructors/Mask/MaskRubber.ts +156 -0
- package/src/constructors/Mask/MaskRubberItem.ts +96 -0
- package/src/constructors/Mask/MaskRubberTransition.ts +50 -0
- package/src/constructors/Mask/MaskSelection.ts +208 -0
- package/src/constructors/Mask/MaskSpecial.ts +179 -0
- package/src/constructors/Mask/MaskType.ts +103 -0
- package/src/constructors/Mask/MaskValidation.ts +102 -0
- package/src/constructors/Mask/MaskValue.ts +225 -0
- package/src/constructors/Mask/MaskValueBasic.ts +87 -0
- package/src/constructors/Mask/MaskView.ts +169 -0
- package/src/constructors/Mask/basicTypes.ts +49 -0
- package/src/constructors/Mask/index.ts +5 -0
- package/src/constructors/Mask/properties.json +29 -0
- package/src/constructors/Mask/props.ts +70 -0
- package/src/constructors/Mask/style.scss +104 -0
- package/src/constructors/Mask/types.ts +71 -0
- package/src/constructors/Menu/Menu.ts +179 -0
- package/src/constructors/Menu/MenuDesign.tsx +244 -0
- package/src/constructors/Menu/MenuInclude.ts +110 -0
- package/src/constructors/Menu/MenuRequest.ts +101 -0
- package/src/constructors/Menu/MenuSearch.ts +49 -0
- package/src/constructors/Menu/MenuValue.ts +73 -0
- package/src/constructors/Menu/MenuWindow.ts +89 -0
- package/src/constructors/Menu/basicTypes.ts +41 -0
- package/src/constructors/Menu/index.ts +6 -0
- package/src/constructors/Menu/properties.json +17 -0
- package/src/constructors/Menu/props.ts +79 -0
- package/src/constructors/Menu/style.scss +17 -0
- package/src/constructors/Menu/types.ts +79 -0
- package/src/constructors/MotionTransform/MotionTransform.ts +87 -0
- package/src/constructors/MotionTransform/MotionTransformClassesInclude.ts +38 -0
- package/src/constructors/MotionTransform/MotionTransformDesign.tsx +242 -0
- package/src/constructors/MotionTransform/MotionTransformElement.ts +220 -0
- package/src/constructors/MotionTransform/MotionTransformEvent.ts +118 -0
- package/src/constructors/MotionTransform/MotionTransformGo.ts +47 -0
- package/src/constructors/MotionTransform/MotionTransformInclude.ts +123 -0
- package/src/constructors/MotionTransform/MotionTransformSize.ts +97 -0
- package/src/constructors/MotionTransform/MotionTransformState.ts +250 -0
- package/src/constructors/MotionTransform/basicTypes.ts +121 -0
- package/src/constructors/MotionTransform/index.ts +7 -0
- package/src/constructors/MotionTransform/properties.json +35 -0
- package/src/constructors/MotionTransform/props.ts +50 -0
- package/src/constructors/MotionTransform/style.scss +180 -0
- package/src/constructors/MotionTransform/types.ts +86 -0
- package/src/constructors/Progress/Progress.ts +184 -0
- package/src/constructors/Progress/ProgressDesign.tsx +175 -0
- package/src/constructors/Progress/ProgressInclude.ts +67 -0
- package/src/constructors/Progress/basicTypes.ts +12 -0
- package/src/constructors/Progress/index.ts +6 -0
- package/src/constructors/Progress/properties.json +47 -0
- package/src/constructors/Progress/props.ts +54 -0
- package/src/constructors/Progress/style.scss +374 -0
- package/src/constructors/Progress/types.ts +43 -0
- package/src/constructors/Ripple/Ripple.ts +46 -0
- package/src/constructors/Ripple/RippleDesign.tsx +112 -0
- package/src/constructors/Ripple/RippleInclude.ts +39 -0
- package/src/constructors/Ripple/RippleItem.ts +62 -0
- package/src/constructors/Ripple/basicTypes.ts +3 -0
- package/src/constructors/Ripple/index.ts +6 -0
- package/src/constructors/Ripple/properties.json +9 -0
- package/src/constructors/Ripple/props.ts +28 -0
- package/src/constructors/Ripple/style.scss +62 -0
- package/src/constructors/Ripple/types.ts +41 -0
- package/src/constructors/Scrollbar/Scrollbar.ts +66 -0
- package/src/constructors/Scrollbar/ScrollbarBorder.ts +243 -0
- package/src/constructors/Scrollbar/ScrollbarDesign.tsx +126 -0
- package/src/constructors/Scrollbar/ScrollbarInclude.ts +80 -0
- package/src/constructors/Scrollbar/basicTypes.ts +42 -0
- package/src/constructors/Scrollbar/index.ts +5 -0
- package/src/constructors/Scrollbar/properties.json +33 -0
- package/src/constructors/Scrollbar/props.ts +37 -0
- package/src/constructors/Scrollbar/style.scss +117 -0
- package/src/constructors/Scrollbar/types.ts +52 -0
- package/src/constructors/Skeleton/Skeleton.ts +86 -0
- package/src/constructors/Skeleton/SkeletonDesign.tsx +117 -0
- package/src/constructors/Skeleton/SkeletonInclude.ts +61 -0
- package/src/constructors/Skeleton/basicTypes.ts +16 -0
- package/src/constructors/Skeleton/const.ts +1 -0
- package/src/constructors/Skeleton/index.ts +6 -0
- package/src/constructors/Skeleton/properties.json +24 -0
- package/src/constructors/Skeleton/props.ts +28 -0
- package/src/constructors/Skeleton/style.scss +112 -0
- package/src/constructors/Skeleton/types.ts +46 -0
- package/src/constructors/Window/Window.ts +212 -0
- package/src/constructors/Window/WindowClasses.ts +180 -0
- package/src/constructors/Window/WindowClassesInclude.ts +39 -0
- package/src/constructors/Window/WindowClient.ts +93 -0
- package/src/constructors/Window/WindowCoordinates.ts +257 -0
- package/src/constructors/Window/WindowDesign.tsx +278 -0
- package/src/constructors/Window/WindowElement.ts +84 -0
- package/src/constructors/Window/WindowEmit.ts +52 -0
- package/src/constructors/Window/WindowEvent.ts +157 -0
- package/src/constructors/Window/WindowFlash.ts +70 -0
- package/src/constructors/Window/WindowHook.ts +110 -0
- package/src/constructors/Window/WindowInclude.ts +134 -0
- package/src/constructors/Window/WindowOpen.ts +292 -0
- package/src/constructors/Window/WindowOrigin.ts +85 -0
- package/src/constructors/Window/WindowPersistent.ts +89 -0
- package/src/constructors/Window/WindowPosition.ts +358 -0
- package/src/constructors/Window/WindowStatic.ts +102 -0
- package/src/constructors/Window/WindowStatus.ts +138 -0
- package/src/constructors/Window/WindowStyles.ts +78 -0
- package/src/constructors/Window/WindowVerification.ts +287 -0
- package/src/constructors/Window/basicTypes.ts +186 -0
- package/src/constructors/Window/index.ts +7 -0
- package/src/constructors/Window/properties.json +236 -0
- package/src/constructors/Window/props.ts +88 -0
- package/src/constructors/Window/style.scss +262 -0
- package/src/constructors/Window/types.ts +124 -0
- package/src/functions/getClassTegAStatic.ts +8 -0
- package/src/library.ts +36 -0
- package/src/types/captionTypes.ts +15 -0
- package/src/types/descriptionTypes.ts +15 -0
- package/src/types/enabledTypes.ts +9 -0
- package/src/types/eventClickTypes.ts +51 -0
- package/src/types/fieldTypes.ts +282 -0
- package/src/types/labelTypes.ts +30 -0
- package/src/types/modelTypes.ts +23 -0
- package/src/types/prefixTypes.ts +15 -0
- package/src/types/suffixTypes.ts +15 -0
- package/src/vite-env.d.ts +1 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"barsDisplay": {
|
|
3
|
+
"_type": "var"
|
|
4
|
+
},
|
|
5
|
+
"#bars": {},
|
|
6
|
+
"#list": {},
|
|
7
|
+
"~hideList": {},
|
|
8
|
+
"~barsAdaptive": {
|
|
9
|
+
"showAlways": {
|
|
10
|
+
"barsDisplay": "flex"
|
|
11
|
+
},
|
|
12
|
+
"group|show": {
|
|
13
|
+
"link|barsAdaptive-show": "{??barsAdaptive.showAlways}",
|
|
14
|
+
"_type": "media-group"
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
ApiFetch,
|
|
3
|
+
ConstrBind,
|
|
4
|
+
ListRecord,
|
|
5
|
+
ListSelectedList,
|
|
6
|
+
NormalOrPromise
|
|
7
|
+
} from '@dxtmisha/functional'
|
|
8
|
+
|
|
9
|
+
import type { ListPropsBasic } from '../List'
|
|
10
|
+
import type { ListItemProps, ListItemPropsBasic } from '../ListItem'
|
|
11
|
+
import type { BarsPropsBasic, BarsPropsInclude } from '../Bars'
|
|
12
|
+
import type { WindowPropsBasic, WindowPropsInclude } from '../Window'
|
|
13
|
+
import type { ModelProps } from '../../types/modelTypes'
|
|
14
|
+
|
|
15
|
+
interface MenuPropsToken {
|
|
16
|
+
// :type [!] System label / Системная метка
|
|
17
|
+
hideList?: boolean
|
|
18
|
+
barsAdaptive?: 'showAlways'
|
|
19
|
+
// :type [!] System label / Системная метка
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface MenuPropsBasic<
|
|
23
|
+
List extends ListPropsBasic = ListPropsBasic,
|
|
24
|
+
ListItem extends ListItemPropsBasic = ListItemPropsBasic,
|
|
25
|
+
Bars extends BarsPropsBasic = BarsPropsBasic,
|
|
26
|
+
Window extends WindowPropsBasic = WindowPropsBasic
|
|
27
|
+
> extends BarsPropsInclude<Bars>,
|
|
28
|
+
WindowPropsInclude<Window>,
|
|
29
|
+
ModelProps {
|
|
30
|
+
// Status
|
|
31
|
+
selected?: ListSelectedList
|
|
32
|
+
highlightLengthStart?: number
|
|
33
|
+
hideList?: boolean
|
|
34
|
+
|
|
35
|
+
// Value
|
|
36
|
+
list?: ListRecord<ListItem>
|
|
37
|
+
liteThreshold?: number
|
|
38
|
+
|
|
39
|
+
ajax?: string | (() => NormalOrPromise<ListRecord<ListItem>>)
|
|
40
|
+
request?: ApiFetch
|
|
41
|
+
cache?: boolean
|
|
42
|
+
|
|
43
|
+
keyLabel?: string
|
|
44
|
+
keyValue?: string
|
|
45
|
+
|
|
46
|
+
// Style
|
|
47
|
+
tag?: ListItemProps['tag']
|
|
48
|
+
|
|
49
|
+
listAttrs?: ConstrBind<List>
|
|
50
|
+
itemAttrs?: ConstrBind<ListItem>
|
|
51
|
+
|
|
52
|
+
// Technical
|
|
53
|
+
isSelectedByValue?: boolean
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Type describing incoming properties.
|
|
58
|
+
*
|
|
59
|
+
* Тип, описывающий входящие свойства.
|
|
60
|
+
*/
|
|
61
|
+
export interface MenuProps extends MenuPropsBasic, MenuPropsToken {
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Default value for property.
|
|
66
|
+
*
|
|
67
|
+
* Значение по умолчанию для свойства.
|
|
68
|
+
*/
|
|
69
|
+
export const defaultsMenu = {
|
|
70
|
+
liteThreshold: 40,
|
|
71
|
+
barsHide: true,
|
|
72
|
+
barsBackHide: true,
|
|
73
|
+
tag: 'a',
|
|
74
|
+
autoClose: true,
|
|
75
|
+
...{
|
|
76
|
+
// :default [!] System label / Системная метка
|
|
77
|
+
// :default [!] System label / Системная метка
|
|
78
|
+
}
|
|
79
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
@use "@dxtmisha/styles/properties" as ui;
|
|
2
|
+
|
|
3
|
+
@mixin mixinMenu {
|
|
4
|
+
&__bars {
|
|
5
|
+
display: ui.v('??barsDisplay', none) !important;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
&__list {
|
|
9
|
+
overflow: hidden;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
&--hideList {
|
|
13
|
+
@include ui.subclass('list') {
|
|
14
|
+
display: none;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import type { ConstrClass } from '@dxtmisha/functional'
|
|
2
|
+
|
|
3
|
+
import type { EventClickEmits } from '../../types/eventClickTypes'
|
|
4
|
+
|
|
5
|
+
import type { ListComponentInclude, ListSlots } from '../List'
|
|
6
|
+
import type { BarsComponentInclude, BarsEmitsInclude } from '../Bars'
|
|
7
|
+
import type { WindowComponentInclude, WindowEmitsInclude, WindowExposeInclude } from '../Window'
|
|
8
|
+
import type { ModelEmits } from '../../types/modelTypes'
|
|
9
|
+
|
|
10
|
+
import type { MenuControlBasic, MenuControlItem } from './basicTypes'
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Interface for describing which components need to be connected for work.
|
|
14
|
+
*
|
|
15
|
+
* Интерфейс для описания, какие компоненты надо подключить для работы.
|
|
16
|
+
*/
|
|
17
|
+
export type MenuComponents
|
|
18
|
+
= ListComponentInclude
|
|
19
|
+
& BarsComponentInclude
|
|
20
|
+
& WindowComponentInclude
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Type describing available events.
|
|
24
|
+
*
|
|
25
|
+
* Тип, описывающий доступные события.
|
|
26
|
+
*/
|
|
27
|
+
export type MenuEmits
|
|
28
|
+
= BarsEmitsInclude
|
|
29
|
+
& EventClickEmits
|
|
30
|
+
& WindowEmitsInclude
|
|
31
|
+
& ModelEmits
|
|
32
|
+
& {
|
|
33
|
+
clickSlot: [value?: string]
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Type describing available properties.
|
|
38
|
+
*
|
|
39
|
+
* Тип, описывающий доступные свойства.
|
|
40
|
+
*/
|
|
41
|
+
export interface MenuExpose extends WindowExposeInclude, MenuControlBasic {
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Type describing available slots.
|
|
46
|
+
*
|
|
47
|
+
* Тип, описывающий доступные слоты.
|
|
48
|
+
*/
|
|
49
|
+
export type MenuSlots
|
|
50
|
+
= ListSlots
|
|
51
|
+
& {
|
|
52
|
+
/** Control slot for window management / Слот управления для управления окном */
|
|
53
|
+
control?(props: MenuControlItem): any
|
|
54
|
+
|
|
55
|
+
/** Footer slot for window bottom / Слот подвала для низа окна */
|
|
56
|
+
title?(props: MenuControlItem): any
|
|
57
|
+
|
|
58
|
+
/** Footer slot for window bottom/ Слот подвала для низа окна */
|
|
59
|
+
footer?(props: MenuControlItem): any
|
|
60
|
+
|
|
61
|
+
/** Context slot for top area / Слот контекстной области сверху */
|
|
62
|
+
contextTop?(props: MenuControlItem): any
|
|
63
|
+
|
|
64
|
+
/** Context slot for bottom area / Слот контекстной области снизу */
|
|
65
|
+
contextBottom?(props: MenuControlItem): any
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Type describing subclasses.
|
|
70
|
+
*
|
|
71
|
+
* Тип, описывающий подклассы.
|
|
72
|
+
*/
|
|
73
|
+
export type MenuClasses = {
|
|
74
|
+
main: ConstrClass
|
|
75
|
+
// :classes [!] System label / Системная метка
|
|
76
|
+
bars: string
|
|
77
|
+
list: string
|
|
78
|
+
// :classes [!] System label / Системная метка
|
|
79
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { onUnmounted, type Ref, type ToRefs, watch } from 'vue'
|
|
2
|
+
import { type ConstrEmit, DesignComp } from '@dxtmisha/functional'
|
|
3
|
+
|
|
4
|
+
import { MotionTransformElement } from './MotionTransformElement'
|
|
5
|
+
import { MotionTransformSize } from './MotionTransformSize'
|
|
6
|
+
import { MotionTransformState } from './MotionTransformState'
|
|
7
|
+
import { MotionTransformEvent } from './MotionTransformEvent'
|
|
8
|
+
import { MotionTransformGo } from './MotionTransformGo'
|
|
9
|
+
|
|
10
|
+
import type { MotionTransformComponents, MotionTransformEmits, MotionTransformSlots } from './types'
|
|
11
|
+
import type { MotionTransformProps } from './props'
|
|
12
|
+
import type { MotionTransformControlItem } from './basicTypes'
|
|
13
|
+
import { ModelInclude } from '../../classes/ModelInclude'
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* MotionTransform
|
|
17
|
+
*/
|
|
18
|
+
export class MotionTransform {
|
|
19
|
+
/** Reference helper for element interactions/ Вспомогательный класс для работы с элементами */
|
|
20
|
+
readonly element: MotionTransformElement
|
|
21
|
+
|
|
22
|
+
/** Size calculation manager/ Менеджер расчёта размеров */
|
|
23
|
+
readonly size: MotionTransformSize
|
|
24
|
+
/** State manager/ Менеджер состояния */
|
|
25
|
+
readonly state: MotionTransformState
|
|
26
|
+
|
|
27
|
+
/** Event manager/ Менеджер событий */
|
|
28
|
+
readonly event: MotionTransformEvent
|
|
29
|
+
/** Control actions manager/ Менеджер действий управления */
|
|
30
|
+
readonly go: MotionTransformGo
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Constructor
|
|
34
|
+
* @param props input data/ входные данные
|
|
35
|
+
* @param refs input data in the form of reactive elements/ входные данные в виде реактивных элементов
|
|
36
|
+
* @param element input element/ элемент ввода
|
|
37
|
+
* @param elementContext substrate element / элемент подложка
|
|
38
|
+
* @param classDesign design name/ название дизайна
|
|
39
|
+
* @param className class name/ название класса
|
|
40
|
+
* @param components object for working with components/ объект для работы с компонентами
|
|
41
|
+
* @param slots object for working with slots/ объект для работы со слотами
|
|
42
|
+
* @param emits the function is called when an event is triggered/ функция вызывается, когда срабатывает событие
|
|
43
|
+
*/
|
|
44
|
+
constructor(
|
|
45
|
+
protected readonly props: MotionTransformProps,
|
|
46
|
+
protected readonly refs: ToRefs<MotionTransformProps>,
|
|
47
|
+
element: Ref<HTMLDivElement | undefined>,
|
|
48
|
+
elementContext: Ref<HTMLDivElement | undefined>,
|
|
49
|
+
protected readonly classDesign: string,
|
|
50
|
+
protected readonly className: string,
|
|
51
|
+
protected readonly components?: DesignComp<MotionTransformComponents, MotionTransformProps>,
|
|
52
|
+
protected readonly slots?: MotionTransformSlots,
|
|
53
|
+
protected readonly emits?: ConstrEmit<MotionTransformEmits>
|
|
54
|
+
) {
|
|
55
|
+
this.element = new MotionTransformElement(
|
|
56
|
+
props,
|
|
57
|
+
element,
|
|
58
|
+
elementContext,
|
|
59
|
+
className
|
|
60
|
+
)
|
|
61
|
+
|
|
62
|
+
this.size = new MotionTransformSize(this.element)
|
|
63
|
+
this.state = new MotionTransformState(props, this.element, this.size)
|
|
64
|
+
|
|
65
|
+
this.event = new MotionTransformEvent(props, this.element, this.state, emits)
|
|
66
|
+
this.go = new MotionTransformGo(this.state)
|
|
67
|
+
|
|
68
|
+
new ModelInclude('open', this.emits, this.state.open)
|
|
69
|
+
|
|
70
|
+
watch([refs.open], () => this.state.set(Boolean(props.open)))
|
|
71
|
+
|
|
72
|
+
onUnmounted(() => this.event.stop())
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Returns data for managing slot data.
|
|
77
|
+
*
|
|
78
|
+
* Возвращает данные для управления данными слотами.
|
|
79
|
+
*/
|
|
80
|
+
getSlotData(): MotionTransformControlItem {
|
|
81
|
+
return {
|
|
82
|
+
isOpen: this.state.isOpen,
|
|
83
|
+
isShow: this.state.isShow,
|
|
84
|
+
classes: MotionTransformElement.getClassesList(this.className)
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { MotionTransformElement } from './MotionTransformElement'
|
|
2
|
+
|
|
3
|
+
import type { MotionTransformClassList } from './basicTypes'
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Helper class to access MotionTransform CSS classes by design.
|
|
7
|
+
*
|
|
8
|
+
* Вспомогательный класс для доступа к CSS-классам MotionTransform по дизайну.
|
|
9
|
+
*/
|
|
10
|
+
export class MotionTransformClassesInclude {
|
|
11
|
+
/**
|
|
12
|
+
* Constructor
|
|
13
|
+
* @param design design name/ название дизайна
|
|
14
|
+
*/
|
|
15
|
+
constructor(
|
|
16
|
+
protected readonly design: string
|
|
17
|
+
) {}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Returns list of MotionTransform classes for the specified design.
|
|
21
|
+
*
|
|
22
|
+
* Возвращает список классов MotionTransform для указанного дизайна.
|
|
23
|
+
*/
|
|
24
|
+
get(): MotionTransformClassList {
|
|
25
|
+
return MotionTransformElement.getClassesListByDesign(this.design)
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Returns an object with MotionTransform classes under classesMotionTransform key.
|
|
30
|
+
*
|
|
31
|
+
* Возвращает объект с классами MotionTransform под ключом classesMotionTransform.
|
|
32
|
+
*/
|
|
33
|
+
getObject() {
|
|
34
|
+
return {
|
|
35
|
+
classesMotionTransform: this.get()
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
import { h, ref, Teleport, type VNode } from 'vue'
|
|
2
|
+
import {
|
|
3
|
+
type ConstrOptions,
|
|
4
|
+
type ConstrStyles,
|
|
5
|
+
DesignConstructorAbstract
|
|
6
|
+
} from '@dxtmisha/functional'
|
|
7
|
+
|
|
8
|
+
import { MotionTransform } from './MotionTransform'
|
|
9
|
+
|
|
10
|
+
import {
|
|
11
|
+
type MotionTransformPropsBasic
|
|
12
|
+
} from './props'
|
|
13
|
+
import {
|
|
14
|
+
type MotionTransformClasses,
|
|
15
|
+
type MotionTransformComponents,
|
|
16
|
+
type MotionTransformEmits,
|
|
17
|
+
type MotionTransformExpose,
|
|
18
|
+
type MotionTransformSlots
|
|
19
|
+
} from './types'
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* MotionTransformDesign
|
|
23
|
+
*/
|
|
24
|
+
export class MotionTransformDesign<
|
|
25
|
+
COMP extends MotionTransformComponents,
|
|
26
|
+
EXPOSE extends MotionTransformExpose,
|
|
27
|
+
CLASSES extends MotionTransformClasses,
|
|
28
|
+
P extends MotionTransformPropsBasic
|
|
29
|
+
> extends DesignConstructorAbstract<
|
|
30
|
+
HTMLDivElement,
|
|
31
|
+
COMP,
|
|
32
|
+
MotionTransformEmits,
|
|
33
|
+
EXPOSE,
|
|
34
|
+
MotionTransformSlots,
|
|
35
|
+
CLASSES,
|
|
36
|
+
P
|
|
37
|
+
> {
|
|
38
|
+
protected elementContext = ref<HTMLDivElement>()
|
|
39
|
+
protected readonly item: MotionTransform
|
|
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, MotionTransformEmits, P>
|
|
51
|
+
) {
|
|
52
|
+
super(
|
|
53
|
+
name,
|
|
54
|
+
props,
|
|
55
|
+
options
|
|
56
|
+
)
|
|
57
|
+
|
|
58
|
+
this.item = new MotionTransform(
|
|
59
|
+
this.props,
|
|
60
|
+
this.refs,
|
|
61
|
+
this.element,
|
|
62
|
+
this.elementContext,
|
|
63
|
+
this.getDesign(),
|
|
64
|
+
this.getName(),
|
|
65
|
+
this.components,
|
|
66
|
+
this.slots,
|
|
67
|
+
this.emits
|
|
68
|
+
)
|
|
69
|
+
|
|
70
|
+
this.init()
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Initialization of all the necessary properties for work
|
|
75
|
+
*
|
|
76
|
+
* Инициализация всех необходимых свойств для работы.
|
|
77
|
+
*/
|
|
78
|
+
protected initExpose(): EXPOSE {
|
|
79
|
+
return {
|
|
80
|
+
open: this.item.state.open,
|
|
81
|
+
isShow: this.item.state.isShow,
|
|
82
|
+
|
|
83
|
+
setOpen: this.item.go.to,
|
|
84
|
+
toOpen: this.item.go.open,
|
|
85
|
+
toClose: this.item.go.close,
|
|
86
|
+
toggle: this.item.go.toggle
|
|
87
|
+
} as EXPOSE
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Improvement of the obtained list of classes.
|
|
92
|
+
*
|
|
93
|
+
* Доработка полученного списка классов.
|
|
94
|
+
*/
|
|
95
|
+
protected initClasses(): Partial<CLASSES> {
|
|
96
|
+
return {
|
|
97
|
+
main: {},
|
|
98
|
+
...{
|
|
99
|
+
// :classes [!] System label / Системная метка
|
|
100
|
+
context: this.getSubClass('context'),
|
|
101
|
+
head: this.getSubClass('head'),
|
|
102
|
+
body: this.getSubClass('body'),
|
|
103
|
+
backdrop: this.getSubClass('backdrop'),
|
|
104
|
+
scrim: this.getSubClass('scrim'),
|
|
105
|
+
clickNone: this.getSubClass('clickNone')
|
|
106
|
+
// :classes [!] System label / Системная метка
|
|
107
|
+
}
|
|
108
|
+
} as Partial<CLASSES>
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Refinement of the received list of styles.
|
|
113
|
+
*
|
|
114
|
+
* Доработка полученного списка стилей.
|
|
115
|
+
*/
|
|
116
|
+
protected initStyles(): ConstrStyles {
|
|
117
|
+
return {}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* A method for rendering.
|
|
122
|
+
*
|
|
123
|
+
* Метод для рендеринга.
|
|
124
|
+
*/
|
|
125
|
+
protected initRender(): VNode {
|
|
126
|
+
const children: any[] = [
|
|
127
|
+
...this.renderMain(),
|
|
128
|
+
...this.renderScrim()
|
|
129
|
+
]
|
|
130
|
+
|
|
131
|
+
return h(
|
|
132
|
+
'div',
|
|
133
|
+
{
|
|
134
|
+
ref: this.elementContext,
|
|
135
|
+
class: this.classes?.value.context
|
|
136
|
+
},
|
|
137
|
+
h(
|
|
138
|
+
Teleport,
|
|
139
|
+
{
|
|
140
|
+
key: 'teleport',
|
|
141
|
+
disabled: !this.item.state.teleport.value,
|
|
142
|
+
to: 'body'
|
|
143
|
+
},
|
|
144
|
+
children
|
|
145
|
+
)
|
|
146
|
+
)
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Rendering the main element.
|
|
151
|
+
*
|
|
152
|
+
* Рендеринг главного элемента.
|
|
153
|
+
*/
|
|
154
|
+
readonly renderMain = (): VNode[] => {
|
|
155
|
+
return [
|
|
156
|
+
h(
|
|
157
|
+
'div',
|
|
158
|
+
{
|
|
159
|
+
...this.getAttrs(),
|
|
160
|
+
ref: this.element,
|
|
161
|
+
key: 'main',
|
|
162
|
+
class: this.classes?.value.main,
|
|
163
|
+
onTransitionend: this.item.event.onTransitionend
|
|
164
|
+
},
|
|
165
|
+
[
|
|
166
|
+
...this.renderHead(),
|
|
167
|
+
...this.renderBody()
|
|
168
|
+
]
|
|
169
|
+
)
|
|
170
|
+
]
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* Rendering the title.
|
|
175
|
+
*
|
|
176
|
+
* Рендеринг заголовка.
|
|
177
|
+
*/
|
|
178
|
+
readonly renderHead = (): VNode[] => {
|
|
179
|
+
return [
|
|
180
|
+
h(
|
|
181
|
+
'div',
|
|
182
|
+
{
|
|
183
|
+
key: 'head',
|
|
184
|
+
class: this.classes?.value.head,
|
|
185
|
+
onClick: this.item.event.onClick
|
|
186
|
+
},
|
|
187
|
+
this.initSlot(
|
|
188
|
+
'head',
|
|
189
|
+
undefined,
|
|
190
|
+
this.item.getSlotData()
|
|
191
|
+
)
|
|
192
|
+
)
|
|
193
|
+
]
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* Rendering the content.
|
|
198
|
+
*
|
|
199
|
+
* Рендеринг содержимого.
|
|
200
|
+
*/
|
|
201
|
+
readonly renderBody = (): VNode[] => {
|
|
202
|
+
if (this.item.state.isShow.value) {
|
|
203
|
+
return [
|
|
204
|
+
h(
|
|
205
|
+
'div',
|
|
206
|
+
{
|
|
207
|
+
key: 'body',
|
|
208
|
+
class: this.classes?.value.body
|
|
209
|
+
},
|
|
210
|
+
this.initSlot(
|
|
211
|
+
'body',
|
|
212
|
+
undefined,
|
|
213
|
+
this.item.getSlotData()
|
|
214
|
+
)
|
|
215
|
+
)
|
|
216
|
+
]
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
return []
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
/**
|
|
223
|
+
* Rendering the background.
|
|
224
|
+
*
|
|
225
|
+
* Рендеринг задника.
|
|
226
|
+
*/
|
|
227
|
+
readonly renderScrim = (): VNode[] => {
|
|
228
|
+
if (this.item.state.teleport.value) {
|
|
229
|
+
return [
|
|
230
|
+
h(
|
|
231
|
+
'div',
|
|
232
|
+
{
|
|
233
|
+
key: 'scrim',
|
|
234
|
+
class: this.classes?.value.scrim
|
|
235
|
+
}
|
|
236
|
+
)
|
|
237
|
+
]
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
return []
|
|
241
|
+
}
|
|
242
|
+
}
|