@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.
- package/package.json +36 -6
- package/src/classes/AriaStaticInclude.ts +269 -0
- package/src/classes/DescriptionInclude.ts +19 -2
- package/src/classes/EnabledInclude.ts +11 -0
- package/src/classes/EventClickInclude.ts +2 -2
- package/src/classes/LabelHighlightInclude.ts +35 -0
- package/src/classes/LabelInclude.ts +40 -5
- package/src/classes/ModelInclude.ts +50 -1
- package/src/classes/ModelValueInclude.ts +73 -0
- package/src/classes/TabIndexInclude.ts +260 -0
- package/src/classes/TextInclude.ts +102 -0
- package/src/classes/TouchEventInclude.ts +284 -0
- package/src/classes/field/FieldArrowInclude.ts +189 -0
- package/src/classes/field/FieldAttributesInclude.ts +87 -28
- package/src/classes/field/FieldChangeInclude.ts +1 -1
- package/src/classes/field/FieldElementInclude.ts +1 -1
- package/src/classes/field/FieldEventInclude.ts +253 -0
- package/src/classes/field/FieldInputModeInclude.ts +48 -0
- package/src/classes/field/FieldMatchInclude.ts +9 -3
- package/src/classes/field/FieldTypeInclude.ts +11 -6
- package/src/classes/field/FieldValidationInclude.ts +1 -4
- package/src/classes/field/FieldValueInclude.ts +10 -0
- package/src/constructors/Accordion/Accordion.ts +68 -0
- package/src/constructors/Accordion/AccordionDesign.tsx +192 -0
- package/src/constructors/Accordion/basicTypes.ts +0 -0
- package/src/constructors/Accordion/index.ts +5 -0
- package/src/constructors/Accordion/properties.json +16 -0
- package/src/constructors/Accordion/props.ts +55 -0
- package/src/constructors/Accordion/style.scss +12 -0
- package/src/constructors/Accordion/types.ts +63 -0
- package/src/constructors/ActionSheet/ActionSheet.ts +78 -0
- package/src/constructors/ActionSheet/ActionSheetDesign.tsx +125 -0
- package/src/constructors/ActionSheet/basicTypes.ts +0 -0
- package/src/constructors/ActionSheet/index.ts +5 -0
- package/src/constructors/ActionSheet/properties.json +14 -0
- package/src/constructors/ActionSheet/props.ts +44 -0
- package/src/constructors/ActionSheet/style.scss +25 -0
- package/src/constructors/ActionSheet/types.ts +54 -0
- package/src/constructors/Actions/Actions.ts +60 -0
- package/src/constructors/Actions/ActionsDesign.tsx +212 -0
- package/src/constructors/Actions/ActionsInclude.ts +109 -0
- package/src/constructors/Actions/basicTypes.ts +40 -0
- package/src/constructors/Actions/index.ts +6 -0
- package/src/constructors/Actions/properties.json +63 -0
- package/src/constructors/Actions/props.ts +42 -0
- package/src/constructors/Actions/style.scss +11 -0
- package/src/constructors/Actions/types.ts +52 -0
- package/src/constructors/Anchor/Anchor.ts +113 -0
- package/src/constructors/Anchor/AnchorDesign.tsx +242 -0
- package/src/constructors/Anchor/AnchorEvent.ts +76 -0
- package/src/constructors/Anchor/AnchorHref.ts +54 -0
- package/src/constructors/Anchor/AnchorIcon.ts +54 -0
- package/src/constructors/Anchor/AnchorTo.ts +46 -0
- package/src/constructors/Anchor/basicTypes.ts +9 -0
- package/src/constructors/Anchor/index.ts +5 -0
- package/src/constructors/Anchor/properties.json +3 -0
- package/src/constructors/Anchor/props.ts +54 -0
- package/src/constructors/Anchor/style.scss +10 -0
- package/src/constructors/Anchor/types.ts +47 -0
- package/src/constructors/Arrow/Arrow.ts +134 -0
- package/src/constructors/Arrow/ArrowDesign.tsx +226 -0
- package/src/constructors/Arrow/ArrowElement.ts +139 -0
- package/src/constructors/Arrow/ArrowElementTarget.ts +72 -0
- package/src/constructors/Arrow/ArrowEvent.ts +126 -0
- package/src/constructors/Arrow/ArrowInclude.ts +85 -0
- package/src/constructors/Arrow/ArrowParent.ts +100 -0
- package/src/constructors/Arrow/ArrowPosition.ts +231 -0
- package/src/constructors/Arrow/basicTypes.ts +50 -0
- package/src/constructors/Arrow/index.ts +6 -0
- package/src/constructors/Arrow/properties.json +23 -0
- package/src/constructors/Arrow/props.ts +31 -0
- package/src/constructors/Arrow/style.scss +133 -0
- package/src/constructors/Arrow/types.ts +54 -0
- package/src/constructors/Badge/BadgeDesign.tsx +4 -1
- package/src/constructors/Badge/properties.json +36 -36
- package/src/constructors/Badge/props.ts +3 -1
- package/src/constructors/Badge/types.ts +3 -3
- package/src/constructors/Bars/Bars.ts +10 -4
- package/src/constructors/Bars/BarsDesign.tsx +17 -11
- package/src/constructors/Bars/BarsInclude.ts +5 -2
- package/src/constructors/Bars/properties.json +6 -6
- package/src/constructors/Bars/props.ts +3 -1
- package/src/constructors/Bars/style.scss +4 -0
- package/src/constructors/Bars/types.ts +3 -3
- package/src/constructors/Block/Block.ts +105 -0
- package/src/constructors/Block/BlockDesign.tsx +219 -0
- package/src/constructors/Block/basicTypes.ts +0 -0
- package/src/constructors/Block/index.ts +5 -0
- package/src/constructors/Block/properties.json +10 -0
- package/src/constructors/Block/props.ts +46 -0
- package/src/constructors/Block/style.scss +11 -0
- package/src/constructors/Block/types.ts +64 -0
- package/src/constructors/Button/Button.ts +26 -2
- package/src/constructors/Button/ButtonDesign.tsx +11 -6
- package/src/constructors/Button/ButtonInclude.ts +8 -5
- package/src/constructors/Button/index.ts +1 -0
- package/src/constructors/Button/properties.json +84 -84
- package/src/constructors/Button/props.ts +5 -1
- package/src/constructors/Button/style.scss +1 -1
- package/src/constructors/Button/types.ts +2 -2
- package/src/constructors/Cell/Cell.ts +23 -6
- package/src/constructors/Cell/CellDesign.tsx +53 -22
- package/src/constructors/Cell/basicTypes.ts +33 -0
- package/src/constructors/Cell/properties.json +52 -52
- package/src/constructors/Cell/props.ts +16 -13
- package/src/constructors/Cell/style.scss +1 -1
- package/src/constructors/Cell/types.ts +3 -3
- package/src/constructors/Chip/ChipDesign.tsx +5 -5
- package/src/constructors/Chip/ChipInclude.ts +83 -0
- package/src/constructors/Chip/basicTypes.ts +12 -0
- package/src/constructors/Chip/index.ts +2 -0
- package/src/constructors/Chip/properties.json +3 -3
- package/src/constructors/Chip/types.ts +5 -5
- package/src/constructors/ChipGroup/ChipGroup.ts +74 -0
- package/src/constructors/ChipGroup/ChipGroupDesign.tsx +162 -0
- package/src/constructors/ChipGroup/basicTypes.ts +6 -0
- package/src/constructors/ChipGroup/index.ts +5 -0
- package/src/constructors/ChipGroup/properties.json +3 -0
- package/src/constructors/ChipGroup/props.ts +50 -0
- package/src/constructors/ChipGroup/style.scss +6 -0
- package/src/constructors/ChipGroup/types.ts +47 -0
- package/src/constructors/Dialog/Dialog.ts +145 -0
- package/src/constructors/Dialog/DialogDesign.tsx +135 -0
- package/src/constructors/Dialog/basicTypes.ts +0 -0
- package/src/constructors/Dialog/index.ts +5 -0
- package/src/constructors/Dialog/properties.json +23 -0
- package/src/constructors/Dialog/props.ts +76 -0
- package/src/constructors/Dialog/style.scss +18 -0
- package/src/constructors/Dialog/types.ts +67 -0
- package/src/constructors/Field/Field.ts +58 -19
- package/src/constructors/Field/FieldDesign.tsx +35 -17
- package/src/constructors/Field/FieldInclude.ts +141 -11
- package/src/constructors/Field/basicTypes.ts +35 -19
- package/src/constructors/Field/properties.json +92 -86
- package/src/constructors/Field/props.ts +6 -3
- package/src/constructors/Field/style.scss +36 -20
- package/src/constructors/Field/types.ts +13 -13
- package/src/constructors/FieldCounter/FieldCounterDesign.tsx +1 -0
- package/src/constructors/FieldCounter/FieldCounterInclude.ts +3 -1
- package/src/constructors/FieldCounter/basicTypes.ts +1 -0
- package/src/constructors/FieldCounter/properties.json +3 -3
- package/src/constructors/FieldCounter/props.ts +5 -2
- package/src/constructors/FieldCounter/types.ts +1 -1
- package/src/constructors/FieldLabel/FieldLabelDesign.tsx +6 -2
- package/src/constructors/FieldLabel/FieldLabelInclude.ts +13 -4
- package/src/constructors/FieldLabel/properties.json +4 -4
- package/src/constructors/FieldLabel/props.ts +2 -2
- package/src/constructors/FieldLabel/types.ts +2 -2
- package/src/constructors/FieldMessage/FieldMessage.ts +19 -0
- package/src/constructors/FieldMessage/FieldMessageDesign.tsx +36 -4
- package/src/constructors/FieldMessage/FieldMessageInclude.ts +11 -1
- package/src/constructors/FieldMessage/basicTypes.ts +15 -1
- package/src/constructors/FieldMessage/properties.json +10 -9
- package/src/constructors/FieldMessage/props.ts +4 -0
- package/src/constructors/FieldMessage/style.scss +16 -1
- package/src/constructors/FieldMessage/types.ts +4 -2
- package/src/constructors/Icon/Icon.ts +37 -2
- package/src/constructors/Icon/IconDesign.tsx +46 -39
- package/src/constructors/Icon/properties.json +25 -25
- package/src/constructors/Icon/props.ts +22 -16
- package/src/constructors/Icon/types.ts +1 -1
- package/src/constructors/Image/Image.ts +68 -10
- package/src/constructors/Image/ImageBackground.ts +15 -2
- package/src/constructors/Image/ImageCoordinator.ts +4 -2
- package/src/constructors/Image/ImageData.ts +4 -0
- package/src/constructors/Image/ImageDesign.tsx +81 -15
- package/src/constructors/Image/ImageFile.ts +2 -13
- package/src/constructors/Image/ImageImg.ts +218 -0
- package/src/constructors/Image/ImagePdf.ts +2 -2
- package/src/constructors/Image/basicTypes.ts +5 -0
- package/src/constructors/Image/properties.json +17 -17
- package/src/constructors/Image/props.ts +34 -7
- package/src/constructors/Image/style.scss +42 -0
- package/src/constructors/Image/types.ts +1 -1
- package/src/constructors/Input/Input.ts +146 -0
- package/src/constructors/Input/InputDesign.tsx +174 -0
- package/src/constructors/Input/InputPassword.ts +54 -0
- package/src/constructors/Input/basicTypes.ts +3 -0
- package/src/constructors/Input/index.ts +5 -0
- package/src/constructors/Input/properties.json +2 -0
- package/src/constructors/Input/props.ts +53 -0
- package/src/constructors/Input/style.scss +5 -0
- package/src/constructors/Input/types.ts +48 -0
- package/src/constructors/List/List.ts +36 -11
- package/src/constructors/List/ListControl.ts +2 -2
- package/src/constructors/List/ListDesign.tsx +59 -38
- package/src/constructors/List/ListGo.ts +5 -3
- package/src/constructors/List/properties.json +16 -16
- package/src/constructors/List/props.ts +7 -0
- package/src/constructors/List/style.scss +14 -0
- package/src/constructors/List/types.ts +9 -9
- package/src/constructors/ListGroup/ListGroupDesign.tsx +8 -3
- package/src/constructors/ListGroup/basicTypes.ts +7 -0
- package/src/constructors/ListGroup/properties.json +15 -15
- package/src/constructors/ListGroup/props.ts +4 -4
- package/src/constructors/ListGroup/types.ts +2 -1
- package/src/constructors/ListItem/ListItem.ts +67 -7
- package/src/constructors/ListItem/ListItemDesign.tsx +13 -10
- package/src/constructors/ListItem/properties.json +52 -52
- package/src/constructors/ListItem/props.ts +24 -15
- package/src/constructors/ListItem/types.ts +12 -12
- package/src/constructors/ListMenu/ListMenu.ts +2 -1
- package/src/constructors/ListMenu/ListMenuDesign.tsx +3 -3
- package/src/constructors/ListMenu/properties.json +19 -19
- package/src/constructors/ListMenu/types.ts +3 -3
- package/src/constructors/Mask/MaskDesign.tsx +33 -28
- package/src/constructors/Mask/MaskEvent.ts +41 -2
- package/src/constructors/Mask/MaskInclude.ts +147 -0
- package/src/constructors/Mask/basicTypes.ts +19 -1
- package/src/constructors/Mask/properties.json +30 -29
- package/src/constructors/Mask/props.ts +1 -1
- package/src/constructors/Mask/style.scss +2 -4
- package/src/constructors/Mask/types.ts +4 -4
- package/src/constructors/Menu/Menu.ts +17 -5
- package/src/constructors/Menu/MenuDesign.tsx +11 -11
- package/src/constructors/Menu/MenuGo.ts +72 -0
- package/src/constructors/Menu/MenuInclude.ts +20 -10
- package/src/constructors/Menu/MenuSearch.ts +20 -1
- package/src/constructors/Menu/MenuValue.ts +7 -3
- package/src/constructors/Menu/MenuWindow.ts +2 -1
- package/src/constructors/Menu/basicTypes.ts +21 -4
- package/src/constructors/Menu/properties.json +17 -17
- package/src/constructors/Menu/props.ts +15 -3
- package/src/constructors/Menu/types.ts +6 -16
- package/src/constructors/Modal/Modal.ts +53 -0
- package/src/constructors/Modal/ModalAbstract.ts +74 -0
- package/src/constructors/Modal/ModalDesign.tsx +63 -0
- package/src/constructors/Modal/ModalDesignAbstract.tsx +226 -0
- package/src/constructors/Modal/basicTypes.ts +0 -0
- package/src/constructors/Modal/index.ts +5 -0
- package/src/constructors/Modal/properties.json +17 -0
- package/src/constructors/Modal/props.ts +45 -0
- package/src/constructors/Modal/style.scss +20 -0
- package/src/constructors/Modal/types.ts +62 -0
- package/src/constructors/MotionTransform/MotionTransform.ts +65 -8
- package/src/constructors/MotionTransform/MotionTransformDesign.tsx +55 -21
- package/src/constructors/MotionTransform/MotionTransformElement.ts +7 -2
- package/src/constructors/MotionTransform/MotionTransformInclude.ts +2 -1
- package/src/constructors/MotionTransform/MotionTransformState.ts +5 -0
- package/src/constructors/MotionTransform/basicTypes.ts +18 -2
- package/src/constructors/MotionTransform/properties.json +35 -35
- package/src/constructors/MotionTransform/props.ts +13 -7
- package/src/constructors/MotionTransform/style.scss +24 -2
- package/src/constructors/MotionTransform/types.ts +7 -7
- package/src/constructors/Progress/Progress.ts +12 -2
- package/src/constructors/Progress/ProgressDesign.tsx +75 -53
- package/src/constructors/Progress/ProgressInclude.ts +13 -1
- package/src/constructors/Progress/properties.json +47 -47
- package/src/constructors/Progress/props.ts +5 -1
- package/src/constructors/Progress/style.scss +2 -2
- package/src/constructors/Progress/types.ts +4 -4
- package/src/constructors/Ripple/Ripple.ts +1 -1
- package/src/constructors/Ripple/RippleDesign.tsx +7 -4
- package/src/constructors/Ripple/RippleItem.ts +1 -1
- package/src/constructors/Ripple/style.scss +4 -0
- package/src/constructors/Ripple/types.ts +2 -2
- package/src/constructors/Scrollbar/Scrollbar.ts +3 -3
- package/src/constructors/Scrollbar/ScrollbarDesign.tsx +1 -1
- package/src/constructors/Scrollbar/properties.json +33 -33
- package/src/constructors/Scrollbar/types.ts +1 -1
- package/src/constructors/Section/Section.ts +33 -0
- package/src/constructors/Section/SectionDesign.tsx +127 -0
- package/src/constructors/Section/basicTypes.ts +0 -0
- package/src/constructors/Section/index.ts +5 -0
- package/src/constructors/Section/properties.json +2 -0
- package/src/constructors/Section/props.ts +29 -0
- package/src/constructors/Section/style.scss +5 -0
- package/src/constructors/Section/types.ts +47 -0
- package/src/constructors/Select/Select.ts +172 -0
- package/src/constructors/Select/SelectDesign.tsx +288 -0
- package/src/constructors/Select/SelectFilter.ts +43 -0
- package/src/constructors/Select/SelectInput.ts +68 -0
- package/src/constructors/Select/basicTypes.ts +0 -0
- package/src/constructors/Select/index.ts +5 -0
- package/src/constructors/Select/properties.json +3 -0
- package/src/constructors/Select/props.ts +63 -0
- package/src/constructors/Select/style.scss +5 -0
- package/src/constructors/Select/types.ts +53 -0
- package/src/constructors/SelectValue/SelectValue.ts +95 -0
- package/src/constructors/SelectValue/SelectValueDesign.tsx +198 -0
- package/src/constructors/SelectValue/SelectValueInclude.ts +92 -0
- package/src/constructors/SelectValue/basicTypes.ts +17 -0
- package/src/constructors/SelectValue/index.ts +6 -0
- package/src/constructors/SelectValue/properties.json +7 -0
- package/src/constructors/SelectValue/props.ts +48 -0
- package/src/constructors/SelectValue/style.scss +14 -0
- package/src/constructors/SelectValue/types.ts +47 -0
- package/src/constructors/Skeleton/Skeleton.ts +1 -3
- package/src/constructors/Skeleton/SkeletonDesign.tsx +7 -1
- package/src/constructors/Skeleton/SkeletonInclude.ts +5 -0
- package/src/constructors/Skeleton/properties.json +24 -24
- package/src/constructors/Skeleton/types.ts +1 -1
- package/src/constructors/TextareaAutosize/TextareaAutosize.ts +41 -0
- package/src/constructors/TextareaAutosize/TextareaAutosizeDesign.tsx +147 -0
- package/src/constructors/TextareaAutosize/TextareaAutosizeResize.ts +109 -0
- package/src/constructors/TextareaAutosize/TextareaAutosizeValue.ts +69 -0
- package/src/constructors/TextareaAutosize/basicTypes.ts +0 -0
- package/src/constructors/TextareaAutosize/index.ts +5 -0
- package/src/constructors/TextareaAutosize/properties.json +6 -0
- package/src/constructors/TextareaAutosize/props.ts +34 -0
- package/src/constructors/TextareaAutosize/style.scss +31 -0
- package/src/constructors/TextareaAutosize/types.ts +50 -0
- package/src/constructors/Tooltip/Tooltip.ts +138 -0
- package/src/constructors/Tooltip/TooltipClasses.ts +90 -0
- package/src/constructors/Tooltip/TooltipDesign.tsx +198 -0
- package/src/constructors/Tooltip/TooltipEvent.ts +103 -0
- package/src/constructors/Tooltip/TooltipInclude.ts +114 -0
- package/src/constructors/Tooltip/TooltipOpen.ts +128 -0
- package/src/constructors/Tooltip/TooltipPosition.ts +92 -0
- package/src/constructors/Tooltip/TooltipStatus.ts +97 -0
- package/src/constructors/Tooltip/TooltipStyle.ts +123 -0
- package/src/constructors/Tooltip/basicTypes.ts +39 -0
- package/src/constructors/Tooltip/index.ts +6 -0
- package/src/constructors/Tooltip/properties.json +14 -0
- package/src/constructors/Tooltip/props.ts +49 -0
- package/src/constructors/Tooltip/style.scss +43 -0
- package/src/constructors/Tooltip/types.ts +58 -0
- package/src/constructors/Window/Window.ts +52 -16
- package/src/constructors/Window/WindowClasses.ts +33 -0
- package/src/constructors/Window/WindowClient.ts +39 -0
- package/src/constructors/Window/WindowDesign.tsx +31 -14
- package/src/constructors/Window/WindowEsc.ts +114 -0
- package/src/constructors/Window/WindowHidden.ts +120 -0
- package/src/constructors/Window/WindowInclude.ts +2 -2
- package/src/constructors/Window/WindowOpen.ts +10 -1
- package/src/constructors/Window/WindowOrigin.ts +5 -1
- package/src/constructors/Window/WindowStatic.ts +3 -1
- package/src/constructors/Window/WindowVerification.ts +8 -5
- package/src/constructors/Window/basicTypes.ts +26 -16
- package/src/constructors/Window/properties.json +239 -236
- package/src/constructors/Window/props.ts +10 -1
- package/src/constructors/Window/style.scss +11 -0
- package/src/constructors/Window/types.ts +2 -2
- package/src/functions/{getClassTegAStatic.ts → getClassTagAStatic.ts} +1 -1
- package/src/library.ts +13 -1
- package/src/types/ariaTypes.ts +366 -0
- package/src/types/descriptionTypes.ts +8 -0
- package/src/types/fieldTypes.ts +120 -16
- package/src/types/labelTypes.ts +39 -0
- package/src/types/modelTypes.ts +16 -0
- package/src/types/roleTypes.ts +88 -0
- package/src/types/textTypes.ts +33 -0
- package/src/types/touchEventTypes.ts +43 -0
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
{
|
|
2
|
+
"#item": {},
|
|
3
|
+
"#list": {},
|
|
4
|
+
"#secondary": {},
|
|
5
|
+
"#spacer": {},
|
|
6
|
+
"~align": {
|
|
7
|
+
"~none": {},
|
|
8
|
+
"~center": {
|
|
9
|
+
"justify-content": "center",
|
|
10
|
+
"#secondary": {
|
|
11
|
+
"display": "none"
|
|
12
|
+
},
|
|
13
|
+
"#spacer": {
|
|
14
|
+
"display": "none"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"~left": {
|
|
18
|
+
"#secondary": {
|
|
19
|
+
"order": "8"
|
|
20
|
+
},
|
|
21
|
+
"#spacer": {
|
|
22
|
+
"order": "4"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"~right": {
|
|
26
|
+
"#list": {
|
|
27
|
+
"order": "8"
|
|
28
|
+
},
|
|
29
|
+
"#spacer": {
|
|
30
|
+
"order": "4"
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"~block": {
|
|
34
|
+
"flex-direction": "column-reverse",
|
|
35
|
+
"align-items": "stretch",
|
|
36
|
+
"#secondary": {
|
|
37
|
+
"display": "none"
|
|
38
|
+
},
|
|
39
|
+
"#spacer": {
|
|
40
|
+
"display": "none"
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"~auto": {
|
|
44
|
+
"link|center": "{??align.center}",
|
|
45
|
+
"#item": {
|
|
46
|
+
"flex-grow": "1",
|
|
47
|
+
"flex-shrink": "1",
|
|
48
|
+
"flex-basis": "auto"
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"_default": "right"
|
|
52
|
+
},
|
|
53
|
+
"~flexible": {
|
|
54
|
+
"group|adaptive": {
|
|
55
|
+
"link|block": "{??align.block}",
|
|
56
|
+
"_type": "media-max-group"
|
|
57
|
+
},
|
|
58
|
+
"group|container": {
|
|
59
|
+
"link|block": "{??align.block}",
|
|
60
|
+
"_type": "container-max-group"
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { ConstrBind } from '@dxtmisha/functional'
|
|
2
|
+
import type { ButtonPropsBasic } from '../Button'
|
|
3
|
+
|
|
4
|
+
interface ActionsPropsToken {
|
|
5
|
+
// :type [!] System label / Системная метка
|
|
6
|
+
align?: 'none' | 'center' | 'left' | 'right' | 'block' | 'auto'
|
|
7
|
+
flexible?: boolean
|
|
8
|
+
// :type [!] System label / Системная метка
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface ActionsPropsBasic<
|
|
12
|
+
Button extends ButtonPropsBasic = ButtonPropsBasic
|
|
13
|
+
> {
|
|
14
|
+
// Value
|
|
15
|
+
list?: ConstrBind<Button>[]
|
|
16
|
+
listSecondary?: ConstrBind<Button>[]
|
|
17
|
+
|
|
18
|
+
// Style
|
|
19
|
+
buttonAttrs?: ConstrBind<Button>
|
|
20
|
+
buttonSecondaryAttrs?: ConstrBind<Button>
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Type describing incoming properties.
|
|
25
|
+
*
|
|
26
|
+
* Тип, описывающий входящие свойства.
|
|
27
|
+
*/
|
|
28
|
+
export interface ActionsProps extends ActionsPropsBasic, ActionsPropsToken {
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Default value for property.
|
|
33
|
+
*
|
|
34
|
+
* Значение по умолчанию для свойства.
|
|
35
|
+
*/
|
|
36
|
+
export const defaultsActions = {
|
|
37
|
+
...{
|
|
38
|
+
// :default [!] System label / Системная метка
|
|
39
|
+
align: 'right'
|
|
40
|
+
// :default [!] System label / Системная метка
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { ConstrClass } from '@dxtmisha/functional'
|
|
2
|
+
|
|
3
|
+
import type { ButtonComponentInclude } from '../Button'
|
|
4
|
+
import type { EventClickEmits } from '../../types/eventClickTypes'
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Interface for describing which components need to be connected for work.
|
|
8
|
+
*
|
|
9
|
+
* Интерфейс для описания, какие компоненты надо подключить для работы.
|
|
10
|
+
*/
|
|
11
|
+
export type ActionsComponents = ButtonComponentInclude
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Type describing available events.
|
|
15
|
+
*
|
|
16
|
+
* Тип, описывающий доступные события.
|
|
17
|
+
*/
|
|
18
|
+
export type ActionsEmits = EventClickEmits
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Type describing available properties.
|
|
22
|
+
*
|
|
23
|
+
* Тип, описывающий доступные свойства.
|
|
24
|
+
*/
|
|
25
|
+
export interface ActionsExpose {
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Type describing available slots.
|
|
30
|
+
*
|
|
31
|
+
* Тип, описывающий доступные слоты.
|
|
32
|
+
*/
|
|
33
|
+
export interface ActionsSlots {
|
|
34
|
+
default?(props: any): any
|
|
35
|
+
|
|
36
|
+
secondary?(props: any): any
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Type describing subclasses.
|
|
41
|
+
*
|
|
42
|
+
* Тип, описывающий подклассы.
|
|
43
|
+
*/
|
|
44
|
+
export type ActionsClasses = {
|
|
45
|
+
main: ConstrClass
|
|
46
|
+
// :classes [!] System label / Системная метка
|
|
47
|
+
item: string
|
|
48
|
+
list: string
|
|
49
|
+
secondary: string
|
|
50
|
+
spacer: string
|
|
51
|
+
// :classes [!] System label / Системная метка
|
|
52
|
+
}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { computed, onMounted, type Ref, type ToRefs } from 'vue'
|
|
2
|
+
import { type ConstrEmit, DesignComp } from '@dxtmisha/functional'
|
|
3
|
+
|
|
4
|
+
import { LabelInclude } from '../../classes/LabelInclude'
|
|
5
|
+
import { TextInclude } from '../../classes/TextInclude'
|
|
6
|
+
import { TooltipInclude } from '../Tooltip'
|
|
7
|
+
|
|
8
|
+
import { AnchorHref } from './AnchorHref'
|
|
9
|
+
import { AnchorTo } from './AnchorTo'
|
|
10
|
+
import { AnchorEvent } from './AnchorEvent'
|
|
11
|
+
import { AnchorIcon } from './AnchorIcon'
|
|
12
|
+
|
|
13
|
+
import type { AnchorComponents, AnchorEmits, AnchorSlots } from './types'
|
|
14
|
+
import type { AnchorProps } from './props'
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Anchor
|
|
18
|
+
*/
|
|
19
|
+
export class Anchor {
|
|
20
|
+
readonly label: LabelInclude
|
|
21
|
+
readonly text: TextInclude
|
|
22
|
+
readonly tooltip: TooltipInclude
|
|
23
|
+
|
|
24
|
+
readonly href: AnchorHref
|
|
25
|
+
readonly to: AnchorTo
|
|
26
|
+
readonly event: AnchorEvent
|
|
27
|
+
readonly icon: AnchorIcon
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Constructor
|
|
31
|
+
* @param props input data/ входные данные
|
|
32
|
+
* @param refs input data in the form of reactive elements/ входные данные в виде реактивных элементов
|
|
33
|
+
* @param element input element/ элемент ввода
|
|
34
|
+
* @param classDesign design name/ название дизайна
|
|
35
|
+
* @param className class name/ название класса
|
|
36
|
+
* @param components object for working with components/ объект для работы с компонентами
|
|
37
|
+
* @param slots object for working with slots/ объект для работы со слотами
|
|
38
|
+
* @param emits the function is called when an event is triggered/ функция вызывается, когда срабатывает событие
|
|
39
|
+
* @param AnchorHrefConstructor class for working with href/ класс для работы с ссылкой
|
|
40
|
+
* @param AnchorToConstructor class for working with scroll/ класс для работы с прокруткой
|
|
41
|
+
* @param AnchorEventConstructor class for working with events/ класс для работы с событиями
|
|
42
|
+
* @param AnchorIconConstructor class for working with icons/ класс для работы с иконками
|
|
43
|
+
* @param LabelIncludeConstructor class for working with label/ класс для работы с меткой
|
|
44
|
+
* @param TextIncludeConstructor class for working with text/ класс для работы с текстом
|
|
45
|
+
* @param TooltipIncludeConstructor class for working with tooltip/ класс для работы с подсказкой
|
|
46
|
+
*/
|
|
47
|
+
constructor(
|
|
48
|
+
protected readonly props: AnchorProps,
|
|
49
|
+
protected readonly refs: ToRefs<AnchorProps>,
|
|
50
|
+
protected readonly element: Ref<HTMLElement | undefined>,
|
|
51
|
+
protected readonly classDesign: string,
|
|
52
|
+
protected readonly className: string,
|
|
53
|
+
protected readonly components?: DesignComp<AnchorComponents, AnchorProps>,
|
|
54
|
+
protected readonly slots?: AnchorSlots,
|
|
55
|
+
protected readonly emits?: ConstrEmit<AnchorEmits>,
|
|
56
|
+
protected readonly AnchorHrefConstructor: typeof AnchorHref = AnchorHref,
|
|
57
|
+
protected readonly AnchorToConstructor: typeof AnchorTo = AnchorTo,
|
|
58
|
+
protected readonly AnchorEventConstructor: typeof AnchorEvent = AnchorEvent,
|
|
59
|
+
protected readonly AnchorIconConstructor: typeof AnchorIcon = AnchorIcon,
|
|
60
|
+
protected readonly LabelIncludeConstructor: typeof LabelInclude = LabelInclude,
|
|
61
|
+
protected readonly TextIncludeConstructor: typeof TextInclude = TextInclude,
|
|
62
|
+
protected readonly TooltipIncludeConstructor: typeof TooltipInclude = TooltipInclude
|
|
63
|
+
) {
|
|
64
|
+
this.label = new LabelIncludeConstructor(props, className, undefined, slots)
|
|
65
|
+
this.text = new TextIncludeConstructor(this.props)
|
|
66
|
+
this.tooltip = new TooltipIncludeConstructor(
|
|
67
|
+
this.props,
|
|
68
|
+
this.className,
|
|
69
|
+
this.components,
|
|
70
|
+
computed(() => ({
|
|
71
|
+
description: this.text.copiedClipboard.value
|
|
72
|
+
}))
|
|
73
|
+
)
|
|
74
|
+
|
|
75
|
+
this.href = new AnchorHrefConstructor(this.props)
|
|
76
|
+
this.to = new AnchorToConstructor(
|
|
77
|
+
this.props,
|
|
78
|
+
this.element,
|
|
79
|
+
this.href
|
|
80
|
+
)
|
|
81
|
+
this.event = new AnchorEventConstructor(
|
|
82
|
+
this.props,
|
|
83
|
+
this.tooltip,
|
|
84
|
+
this.href,
|
|
85
|
+
this.to
|
|
86
|
+
)
|
|
87
|
+
this.icon = new AnchorIconConstructor(this.props, this.event)
|
|
88
|
+
|
|
89
|
+
onMounted(() => {
|
|
90
|
+
requestAnimationFrame(this.goIsFocus)
|
|
91
|
+
})
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/** Is hide anchor/ Скрыть якорь */
|
|
95
|
+
readonly isHide = computed<boolean>(() => {
|
|
96
|
+
return this.props.hide
|
|
97
|
+
|| (
|
|
98
|
+
!this.label.is.value
|
|
99
|
+
&& !this.props.isCopy
|
|
100
|
+
)
|
|
101
|
+
})
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Go if focus on anchor
|
|
105
|
+
*
|
|
106
|
+
* Перейти, если фокус на якоре
|
|
107
|
+
*/
|
|
108
|
+
protected readonly goIsFocus = (): void => {
|
|
109
|
+
if (location.hash === this.href.get()) {
|
|
110
|
+
this.to.go()
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
import { h, type VNode } from 'vue'
|
|
2
|
+
import {
|
|
3
|
+
type ConstrOptions,
|
|
4
|
+
type ConstrStyles,
|
|
5
|
+
DesignConstructorAbstract
|
|
6
|
+
} from '@dxtmisha/functional'
|
|
7
|
+
import { getClassTagAStatic } from '../../functions/getClassTagAStatic'
|
|
8
|
+
|
|
9
|
+
import { AriaStaticInclude } from '../../classes/AriaStaticInclude'
|
|
10
|
+
import { Anchor } from './Anchor'
|
|
11
|
+
|
|
12
|
+
import type { TooltipControl } from '../Tooltip'
|
|
13
|
+
import {
|
|
14
|
+
type AnchorPropsBasic
|
|
15
|
+
} from './props'
|
|
16
|
+
import {
|
|
17
|
+
type AnchorClasses,
|
|
18
|
+
type AnchorComponents,
|
|
19
|
+
type AnchorEmits,
|
|
20
|
+
type AnchorExpose,
|
|
21
|
+
type AnchorSlots
|
|
22
|
+
} from './types'
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* AnchorDesign
|
|
26
|
+
*/
|
|
27
|
+
export class AnchorDesign<
|
|
28
|
+
COMP extends AnchorComponents,
|
|
29
|
+
EXPOSE extends AnchorExpose,
|
|
30
|
+
CLASSES extends AnchorClasses,
|
|
31
|
+
P extends AnchorPropsBasic
|
|
32
|
+
> extends DesignConstructorAbstract<
|
|
33
|
+
HTMLDivElement,
|
|
34
|
+
COMP,
|
|
35
|
+
AnchorEmits,
|
|
36
|
+
EXPOSE,
|
|
37
|
+
AnchorSlots,
|
|
38
|
+
CLASSES,
|
|
39
|
+
P
|
|
40
|
+
> {
|
|
41
|
+
protected readonly item: Anchor
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Constructor
|
|
45
|
+
* @param name class name/ название класса
|
|
46
|
+
* @param props properties/ свойства
|
|
47
|
+
* @param options list of additional parameters/ список дополнительных параметров
|
|
48
|
+
* @param ItemConstructor class for working with the anchor/ класс для работы с якорем
|
|
49
|
+
*/
|
|
50
|
+
constructor(
|
|
51
|
+
name: string,
|
|
52
|
+
props: Readonly<P>,
|
|
53
|
+
options?: ConstrOptions<COMP, AnchorEmits, P>,
|
|
54
|
+
ItemConstructor: typeof Anchor = Anchor
|
|
55
|
+
) {
|
|
56
|
+
super(
|
|
57
|
+
name,
|
|
58
|
+
props,
|
|
59
|
+
options
|
|
60
|
+
)
|
|
61
|
+
|
|
62
|
+
this.item = new ItemConstructor(
|
|
63
|
+
this.props,
|
|
64
|
+
this.refs,
|
|
65
|
+
this.element,
|
|
66
|
+
this.getDesign(),
|
|
67
|
+
this.getName(),
|
|
68
|
+
this.components,
|
|
69
|
+
this.slots,
|
|
70
|
+
this.emits
|
|
71
|
+
)
|
|
72
|
+
|
|
73
|
+
this.init()
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Initialization of all the necessary properties for work
|
|
78
|
+
*
|
|
79
|
+
* Инициализация всех необходимых свойств для работы.
|
|
80
|
+
*/
|
|
81
|
+
protected initExpose(): EXPOSE {
|
|
82
|
+
return {} as EXPOSE
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Improvement of the obtained list of classes.
|
|
87
|
+
*
|
|
88
|
+
* Доработка полученного списка классов.
|
|
89
|
+
*/
|
|
90
|
+
protected initClasses(): Partial<CLASSES> {
|
|
91
|
+
return {
|
|
92
|
+
main: {},
|
|
93
|
+
...{
|
|
94
|
+
// :classes [!] System label / Системная метка
|
|
95
|
+
// :classes [!] System label / Системная метка
|
|
96
|
+
}
|
|
97
|
+
} as Partial<CLASSES>
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Refinement of the received list of styles.
|
|
102
|
+
*
|
|
103
|
+
* Доработка полученного списка стилей.
|
|
104
|
+
*/
|
|
105
|
+
protected initStyles(): ConstrStyles {
|
|
106
|
+
return {}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* A method for rendering.
|
|
111
|
+
*
|
|
112
|
+
* Метод для рендеринга.
|
|
113
|
+
*/
|
|
114
|
+
protected initRender(): VNode[] | undefined {
|
|
115
|
+
if (this.item.href.is()) {
|
|
116
|
+
if (this.item.isHide.value) {
|
|
117
|
+
return this.renderItemHide()
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
if (this.props.isCopy) {
|
|
121
|
+
return this.renderTooltip()
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
return this.renderItem()
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
return undefined
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Rendering the tooltip.
|
|
132
|
+
*
|
|
133
|
+
* Рендеринг подсказки.
|
|
134
|
+
*/
|
|
135
|
+
readonly renderTooltip = (): VNode[] => {
|
|
136
|
+
return this.item.tooltip.render(
|
|
137
|
+
{
|
|
138
|
+
control: (props: TooltipControl): VNode[] => this.renderItem(props)
|
|
139
|
+
}
|
|
140
|
+
)
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Rendering the main item.
|
|
145
|
+
*
|
|
146
|
+
* Рендеринг основного элемента.
|
|
147
|
+
* @param props additional properties/ дополнительные свойства
|
|
148
|
+
*/
|
|
149
|
+
readonly renderItem = (
|
|
150
|
+
props?: TooltipControl
|
|
151
|
+
): VNode[] => {
|
|
152
|
+
const classes = [
|
|
153
|
+
this.classes?.value.main,
|
|
154
|
+
getClassTagAStatic(this.getDesign())
|
|
155
|
+
]
|
|
156
|
+
|
|
157
|
+
if (props) {
|
|
158
|
+
classes.push(props.class)
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
return [
|
|
162
|
+
h('a', {
|
|
163
|
+
...this.getMainProps(),
|
|
164
|
+
class: classes
|
|
165
|
+
}, this.renderChildren())
|
|
166
|
+
]
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* Rendering the hidden item.
|
|
171
|
+
*
|
|
172
|
+
* Рендеринг скрытого элемента.
|
|
173
|
+
*/
|
|
174
|
+
readonly renderItemHide = (): VNode[] => {
|
|
175
|
+
return [
|
|
176
|
+
h('a', {
|
|
177
|
+
...this.getAttrs(),
|
|
178
|
+
key: 'main-hide',
|
|
179
|
+
name: this.props.name
|
|
180
|
+
})
|
|
181
|
+
]
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* Rendering an icon if it is set.
|
|
186
|
+
*
|
|
187
|
+
* Рендеринг иконки, если она задана.
|
|
188
|
+
*/
|
|
189
|
+
readonly renderIcon = (): VNode[] => {
|
|
190
|
+
if (this.item.icon.is()) {
|
|
191
|
+
return this.components.render(
|
|
192
|
+
'icon',
|
|
193
|
+
this.item.icon.binds.value
|
|
194
|
+
)
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
return []
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* Rendering children elements.
|
|
202
|
+
*
|
|
203
|
+
* Рендеринг дочерних элементов.
|
|
204
|
+
*/
|
|
205
|
+
readonly renderChildren = (): VNode[] => {
|
|
206
|
+
const children: VNode[] = []
|
|
207
|
+
|
|
208
|
+
if (!this.props.hide) {
|
|
209
|
+
children.push(
|
|
210
|
+
...this.renderIcon(),
|
|
211
|
+
...this.item.label.render()
|
|
212
|
+
)
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
return children
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* Get main element properties.
|
|
220
|
+
*
|
|
221
|
+
* Получить свойства основного элемента.
|
|
222
|
+
*/
|
|
223
|
+
protected getMainProps(): Record<string, any> {
|
|
224
|
+
const props: Record<string, any> = {
|
|
225
|
+
...this.getAttrs(),
|
|
226
|
+
ref: this.element,
|
|
227
|
+
key: 'main',
|
|
228
|
+
name: this.props.name,
|
|
229
|
+
onClick: this.item.event.onClick,
|
|
230
|
+
tabindex: 0
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
if (!this.props.isCopy) {
|
|
234
|
+
Object.assign(props, {
|
|
235
|
+
href: this.item.href.get(),
|
|
236
|
+
...AriaStaticInclude.current('page')
|
|
237
|
+
})
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
return props
|
|
241
|
+
}
|
|
242
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { ref } from 'vue'
|
|
2
|
+
import { writeClipboardData } from '@dxtmisha/functional'
|
|
3
|
+
|
|
4
|
+
import { TooltipInclude } from '../Tooltip'
|
|
5
|
+
import { AnchorHref } from './AnchorHref'
|
|
6
|
+
import { AnchorTo } from './AnchorTo'
|
|
7
|
+
|
|
8
|
+
import type { AnchorProps } from './props'
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Anchor event handler
|
|
12
|
+
*
|
|
13
|
+
* Обработчик событий Anchor
|
|
14
|
+
*/
|
|
15
|
+
export class AnchorEvent {
|
|
16
|
+
readonly copy = ref<boolean>()
|
|
17
|
+
|
|
18
|
+
protected timeout: any
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Constructor
|
|
22
|
+
* @param props input data / входные данные
|
|
23
|
+
* @param tooltip tooltip / подсказка
|
|
24
|
+
* @param href href handler / обработчик ссылки
|
|
25
|
+
* @param to scroll handler / обработчик прокрутки
|
|
26
|
+
*/
|
|
27
|
+
constructor(
|
|
28
|
+
protected readonly props: AnchorProps,
|
|
29
|
+
protected readonly tooltip: TooltipInclude,
|
|
30
|
+
protected readonly href: AnchorHref,
|
|
31
|
+
protected readonly to?: AnchorTo
|
|
32
|
+
) {
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Is copy state
|
|
37
|
+
*
|
|
38
|
+
* Является ли состоянием копирования
|
|
39
|
+
*/
|
|
40
|
+
isCopy(): boolean {
|
|
41
|
+
return Boolean(this.copy.value)
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* On click handler
|
|
46
|
+
*
|
|
47
|
+
* Обработчик нажатия
|
|
48
|
+
*/
|
|
49
|
+
readonly onClick = (event: MouseEvent): void => {
|
|
50
|
+
event.preventDefault()
|
|
51
|
+
|
|
52
|
+
if (this.props.isCopy) {
|
|
53
|
+
writeClipboardData(this.href.getLink())
|
|
54
|
+
.then(() => this.toCopy())
|
|
55
|
+
} else {
|
|
56
|
+
this.to?.go()
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Trigger copy state
|
|
62
|
+
*
|
|
63
|
+
* Запустить состояние копирования
|
|
64
|
+
*/
|
|
65
|
+
protected toCopy() {
|
|
66
|
+
clearTimeout(this.timeout)
|
|
67
|
+
|
|
68
|
+
this.copy.value = true
|
|
69
|
+
this.tooltip.open()
|
|
70
|
+
|
|
71
|
+
this.timeout = setTimeout(() => {
|
|
72
|
+
this.copy.value = false
|
|
73
|
+
this.tooltip.close()
|
|
74
|
+
}, this.props.delayHide ?? 1024)
|
|
75
|
+
}
|
|
76
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { computed } from 'vue'
|
|
2
|
+
import type { AnchorProps } from './props'
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Anchor href attribute handler
|
|
6
|
+
*
|
|
7
|
+
* Обработчик атрибута href якоря
|
|
8
|
+
*/
|
|
9
|
+
export class AnchorHref {
|
|
10
|
+
/**
|
|
11
|
+
* Constructor
|
|
12
|
+
* @param props input data / входные данные
|
|
13
|
+
*/
|
|
14
|
+
constructor(
|
|
15
|
+
protected readonly props: AnchorProps
|
|
16
|
+
) {
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/** Computed href attribute/ Вычисляемый атрибут href */
|
|
20
|
+
readonly href = computed<string | undefined>(() => {
|
|
21
|
+
if (this.props.name) {
|
|
22
|
+
return `#${this.props.name}`
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return undefined
|
|
26
|
+
})
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Check if href exists
|
|
30
|
+
*
|
|
31
|
+
* Проверить, существует ли href
|
|
32
|
+
*/
|
|
33
|
+
is() {
|
|
34
|
+
return Boolean(this.href.value)
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Get href value
|
|
39
|
+
*
|
|
40
|
+
* Получить значение href
|
|
41
|
+
*/
|
|
42
|
+
get(): string | undefined {
|
|
43
|
+
return this.href.value
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Get full link
|
|
48
|
+
*
|
|
49
|
+
* Получить полную ссылку
|
|
50
|
+
*/
|
|
51
|
+
getLink() {
|
|
52
|
+
return `${location.origin}${location.pathname}${this.href.value}`
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { computed } from 'vue'
|
|
2
|
+
import type { AnchorProps } from './props'
|
|
3
|
+
import type { ConstrBind } from '@dxtmisha/functional'
|
|
4
|
+
import type { IconProps } from '../Icon'
|
|
5
|
+
import { AnchorEvent } from './AnchorEvent.ts'
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Class for working with the anchor icon
|
|
9
|
+
*
|
|
10
|
+
* Класс для работы с иконкой якоря
|
|
11
|
+
*/
|
|
12
|
+
export class AnchorIcon {
|
|
13
|
+
/**
|
|
14
|
+
* Constructor
|
|
15
|
+
* @param props input data / входные данные
|
|
16
|
+
* @param event event handler / обработчик событий
|
|
17
|
+
*/
|
|
18
|
+
constructor(
|
|
19
|
+
protected readonly props: AnchorProps,
|
|
20
|
+
protected readonly event: AnchorEvent
|
|
21
|
+
) {
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/** Icon to display/ Иконка для отображения */
|
|
25
|
+
readonly icon = computed<string | undefined>(() => {
|
|
26
|
+
if (this.props.hide) {
|
|
27
|
+
return undefined
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
if (this.props.isCopy) {
|
|
31
|
+
return this.props.iconTag
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
return this.props.iconLink
|
|
35
|
+
})
|
|
36
|
+
|
|
37
|
+
/** Binds for the icon/ Привязки для иконки */
|
|
38
|
+
readonly binds = computed<ConstrBind<IconProps>>(() => {
|
|
39
|
+
return {
|
|
40
|
+
icon: this.icon.value,
|
|
41
|
+
iconActive: this.props.iconContentCopy,
|
|
42
|
+
active: this.event.isCopy()
|
|
43
|
+
}
|
|
44
|
+
})
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Check if the icon is set
|
|
48
|
+
*
|
|
49
|
+
* Проверяет, установлена ли иконка
|
|
50
|
+
*/
|
|
51
|
+
is(): boolean {
|
|
52
|
+
return Boolean(this.icon.value)
|
|
53
|
+
}
|
|
54
|
+
}
|