@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,46 @@
|
|
|
1
|
+
import type { Ref } from 'vue'
|
|
2
|
+
import { goScrollSmooth, toNumber } from '@dxtmisha/functional'
|
|
3
|
+
|
|
4
|
+
import { AnchorHref } from './AnchorHref'
|
|
5
|
+
import type { AnchorProps } from './props'
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Anchor scroll handler
|
|
9
|
+
*
|
|
10
|
+
* Обработчик прокрутки якоря
|
|
11
|
+
*/
|
|
12
|
+
export class AnchorTo {
|
|
13
|
+
/**
|
|
14
|
+
* Constructor
|
|
15
|
+
* @param props input data / входные данные
|
|
16
|
+
* @param element input element / элемент ввода
|
|
17
|
+
* @param href href handler / обработчик ссылки
|
|
18
|
+
*/
|
|
19
|
+
constructor(
|
|
20
|
+
protected readonly props: AnchorProps,
|
|
21
|
+
protected readonly element: Ref<HTMLElement | undefined>,
|
|
22
|
+
protected readonly href: AnchorHref
|
|
23
|
+
) {
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Scroll to element
|
|
28
|
+
*
|
|
29
|
+
* Прокрутить к элементу
|
|
30
|
+
*/
|
|
31
|
+
go() {
|
|
32
|
+
if (this.element.value) {
|
|
33
|
+
goScrollSmooth(
|
|
34
|
+
this.element.value,
|
|
35
|
+
{
|
|
36
|
+
behavior: this.props.behavior,
|
|
37
|
+
block: this.props.block,
|
|
38
|
+
inline: this.props.inline
|
|
39
|
+
},
|
|
40
|
+
toNumber(this.props.shift)
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
history.replaceState({}, '', this.href.get())
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { NumberOrString } from '@dxtmisha/functional'
|
|
2
|
+
|
|
3
|
+
/** Anchor scroll properties/ Свойства прокрутки якоря */
|
|
4
|
+
export interface AnchorScrollProps {
|
|
5
|
+
shift?: NumberOrString
|
|
6
|
+
behavior?: ScrollIntoViewOptions['behavior']
|
|
7
|
+
block?: ScrollIntoViewOptions['block']
|
|
8
|
+
inline?: ScrollIntoViewOptions['inline']
|
|
9
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { TooltipProps, TooltipPropsInclude } from '../Tooltip'
|
|
2
|
+
|
|
3
|
+
import type { LabelProps } from '../../types/labelTypes'
|
|
4
|
+
import type { TextCopiedClipboardPropsInclude } from '../../types/textTypes'
|
|
5
|
+
import type { AnchorScrollProps } from './basicTypes'
|
|
6
|
+
|
|
7
|
+
interface AnchorPropsToken {
|
|
8
|
+
// :type [!] System label / Системная метка
|
|
9
|
+
// :type [!] System label / Системная метка
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface AnchorPropsBasic<
|
|
13
|
+
Tooltip extends TooltipProps = TooltipProps
|
|
14
|
+
> extends LabelProps,
|
|
15
|
+
TooltipPropsInclude<Tooltip>,
|
|
16
|
+
TextCopiedClipboardPropsInclude,
|
|
17
|
+
AnchorScrollProps {
|
|
18
|
+
// Status
|
|
19
|
+
hide?: boolean
|
|
20
|
+
|
|
21
|
+
// Value
|
|
22
|
+
name?: string
|
|
23
|
+
|
|
24
|
+
// Style
|
|
25
|
+
isCopy?: boolean
|
|
26
|
+
|
|
27
|
+
iconLink?: string
|
|
28
|
+
iconTag?: string
|
|
29
|
+
iconContentCopy?: string
|
|
30
|
+
|
|
31
|
+
delayHide?: number
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Type describing incoming properties.
|
|
36
|
+
*
|
|
37
|
+
* Тип, описывающий входящие свойства.
|
|
38
|
+
*/
|
|
39
|
+
export interface AnchorProps extends AnchorPropsBasic, AnchorPropsToken {
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Default value for property.
|
|
44
|
+
*
|
|
45
|
+
* Значение по умолчанию для свойства.
|
|
46
|
+
*/
|
|
47
|
+
export const defaultsAnchor = {
|
|
48
|
+
shift: 64,
|
|
49
|
+
delayHide: 3_072,
|
|
50
|
+
...{
|
|
51
|
+
// :default [!] System label / Системная метка
|
|
52
|
+
// :default [!] System label / Системная метка
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { ConstrClass } from '@dxtmisha/functional'
|
|
2
|
+
import type { TooltipComponentInclude } from '../Tooltip'
|
|
3
|
+
import type { LabelExpose, LabelSlots } from '../../types/labelTypes'
|
|
4
|
+
import type { IconComponentInclude } from '../Icon'
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Interface for describing which components need to be connected for work.
|
|
8
|
+
*
|
|
9
|
+
* Интерфейс для описания, какие компоненты надо подключить для работы.
|
|
10
|
+
*/
|
|
11
|
+
export type AnchorComponents = TooltipComponentInclude
|
|
12
|
+
& IconComponentInclude
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Type describing available events.
|
|
16
|
+
*
|
|
17
|
+
* Тип, описывающий доступные события.
|
|
18
|
+
*/
|
|
19
|
+
export type AnchorEmits = {}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Type describing available properties.
|
|
23
|
+
*
|
|
24
|
+
* Тип, описывающий доступные свойства.
|
|
25
|
+
*/
|
|
26
|
+
export interface AnchorExpose extends LabelExpose {
|
|
27
|
+
go(): void
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Type describing available slots.
|
|
32
|
+
*
|
|
33
|
+
* Тип, описывающий доступные слоты.
|
|
34
|
+
*/
|
|
35
|
+
export interface AnchorSlots extends LabelSlots {
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Type describing subclasses.
|
|
40
|
+
*
|
|
41
|
+
* Тип, описывающий подклассы.
|
|
42
|
+
*/
|
|
43
|
+
export type AnchorClasses = {
|
|
44
|
+
main: ConstrClass
|
|
45
|
+
// :classes [!] System label / Системная метка
|
|
46
|
+
// :classes [!] System label / Системная метка
|
|
47
|
+
}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { computed, type Ref, type ToRefs } from 'vue'
|
|
2
|
+
import {
|
|
3
|
+
type ConstrClassObject,
|
|
4
|
+
type ConstrEmit,
|
|
5
|
+
type ConstrStyles,
|
|
6
|
+
DesignComp,
|
|
7
|
+
isFilled
|
|
8
|
+
} from '@dxtmisha/functional'
|
|
9
|
+
|
|
10
|
+
import { ArrowElement } from './ArrowElement'
|
|
11
|
+
import { ArrowElementTarget } from './ArrowElementTarget'
|
|
12
|
+
import { ArrowParent } from './ArrowParent'
|
|
13
|
+
import { ArrowPosition } from './ArrowPosition'
|
|
14
|
+
import { ArrowEvent } from './ArrowEvent'
|
|
15
|
+
|
|
16
|
+
import { ArrowDirection } from './basicTypes'
|
|
17
|
+
import type { ArrowComponents, ArrowEmits, ArrowSlots } from './types'
|
|
18
|
+
import type { ArrowProps } from './props'
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Arrow
|
|
22
|
+
*/
|
|
23
|
+
export class Arrow {
|
|
24
|
+
readonly elementItem: ArrowElement
|
|
25
|
+
readonly elementTarget: ArrowElementTarget
|
|
26
|
+
readonly parent: ArrowParent
|
|
27
|
+
readonly position: ArrowPosition
|
|
28
|
+
readonly event: ArrowEvent
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Constructor
|
|
32
|
+
* @param props input data/ входные данные
|
|
33
|
+
* @param refs input data in the form of reactive elements/ входные данные в виде реактивных элементов
|
|
34
|
+
* @param element input element/ элемент ввода
|
|
35
|
+
* @param classDesign design name/ название дизайна
|
|
36
|
+
* @param className class name/ название класса
|
|
37
|
+
* @param components object for working with components/ объект для работы с компонентами
|
|
38
|
+
* @param slots object for working with slots/ объект для работы со слотами
|
|
39
|
+
* @param emits the function is called when an event is triggered/ функция вызывается, когда срабатывает событие
|
|
40
|
+
* @param ArrowElementConstructor class for working with the arrow element/ класс для работы с элементом стрелки
|
|
41
|
+
* @param ArrowElementTargetConstructor class for working with the target element of the arrow/ класс для работы с целевым элементом стрелки
|
|
42
|
+
* @param ArrowParentConstructor class for working with the parent element of the arrow/ класс для работы с родительским элементом стрелки
|
|
43
|
+
* @param ArrowPositionConstructor class for working with the position of the arrow/ класс для работы с позицией стрелки
|
|
44
|
+
* @param ArrowEventConstructor class for working with arrow events/ класс для работы с событиями стрелки
|
|
45
|
+
*/
|
|
46
|
+
constructor(
|
|
47
|
+
protected readonly props: ArrowProps,
|
|
48
|
+
protected readonly refs: ToRefs<ArrowProps>,
|
|
49
|
+
protected readonly element: Ref<HTMLElement | undefined>,
|
|
50
|
+
protected readonly classDesign: string,
|
|
51
|
+
protected readonly className: string,
|
|
52
|
+
protected readonly components?: DesignComp<ArrowComponents, ArrowProps>,
|
|
53
|
+
protected readonly slots?: ArrowSlots,
|
|
54
|
+
protected readonly emits?: ConstrEmit<ArrowEmits>,
|
|
55
|
+
protected readonly ArrowElementConstructor: typeof ArrowElement = ArrowElement,
|
|
56
|
+
protected readonly ArrowElementTargetConstructor: typeof ArrowElementTarget = ArrowElementTarget,
|
|
57
|
+
protected readonly ArrowParentConstructor: typeof ArrowParent = ArrowParent,
|
|
58
|
+
protected readonly ArrowPositionConstructor: typeof ArrowPosition = ArrowPosition,
|
|
59
|
+
protected readonly ArrowEventConstructor: typeof ArrowEvent = ArrowEvent
|
|
60
|
+
) {
|
|
61
|
+
this.elementItem = new ArrowElementConstructor(
|
|
62
|
+
this.element,
|
|
63
|
+
this.className
|
|
64
|
+
)
|
|
65
|
+
this.elementTarget = new ArrowElementTargetConstructor(this.props)
|
|
66
|
+
this.parent = new ArrowParentConstructor(
|
|
67
|
+
this.element,
|
|
68
|
+
this.className,
|
|
69
|
+
this.elementItem
|
|
70
|
+
)
|
|
71
|
+
|
|
72
|
+
this.position = new ArrowPositionConstructor(
|
|
73
|
+
this.props,
|
|
74
|
+
this.elementItem,
|
|
75
|
+
this.elementTarget,
|
|
76
|
+
this.parent
|
|
77
|
+
)
|
|
78
|
+
|
|
79
|
+
this.event = new ArrowEventConstructor(
|
|
80
|
+
this.props,
|
|
81
|
+
this.refs,
|
|
82
|
+
this.element,
|
|
83
|
+
this.elementTarget,
|
|
84
|
+
this.parent,
|
|
85
|
+
this.position
|
|
86
|
+
)
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/** Direction of the arrow/ Направление стрелки */
|
|
90
|
+
readonly direction = computed<ArrowDirection>(() => {
|
|
91
|
+
if (isFilled(this.props.position)) {
|
|
92
|
+
const directionPosition = this.position.direction.value
|
|
93
|
+
|
|
94
|
+
if (directionPosition) {
|
|
95
|
+
return directionPosition
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
return ArrowDirection.HIDE
|
|
100
|
+
})
|
|
101
|
+
|
|
102
|
+
/** Classes for the component/ Классы для компонента */
|
|
103
|
+
readonly classes = computed<ConstrClassObject>(() => {
|
|
104
|
+
return {
|
|
105
|
+
[`${this.className}--direction--${this.direction.value}`]: Boolean(this.direction.value)
|
|
106
|
+
}
|
|
107
|
+
})
|
|
108
|
+
|
|
109
|
+
/** Styles for the component/ Стили для компонента */
|
|
110
|
+
readonly styles = computed<ConstrStyles>(() => {
|
|
111
|
+
const styles = {
|
|
112
|
+
[`--${this.className}-sys-background`]: this.parent.background.value,
|
|
113
|
+
[`--${this.className}-sys-borderWidth`]: this.parent.borderWidth.value,
|
|
114
|
+
[`--${this.className}-sys-borderColor`]: this.parent.borderColor.value,
|
|
115
|
+
[`--${this.className}-sys-borderRadius`]: this.parent.borderRadius.value
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
if (
|
|
119
|
+
this.parent.isBorder.value
|
|
120
|
+
&& this.position.clipPath.value
|
|
121
|
+
) {
|
|
122
|
+
styles[`--${this.className}-sys-clipPath`] = this.position.clipPath.value
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
if (
|
|
126
|
+
this.elementTarget.is()
|
|
127
|
+
&& this.position.shift.value
|
|
128
|
+
) {
|
|
129
|
+
styles[`--${this.className}-sys-shift`] = this.position.shift.value
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
return styles
|
|
133
|
+
})
|
|
134
|
+
}
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
import { h, nextTick, ref, type VNode, watch } from 'vue'
|
|
2
|
+
import {
|
|
3
|
+
type ConstrOptions,
|
|
4
|
+
type ConstrStyles,
|
|
5
|
+
DesignConstructorAbstract,
|
|
6
|
+
isDomRuntime
|
|
7
|
+
} from '@dxtmisha/functional'
|
|
8
|
+
|
|
9
|
+
import { AriaStaticInclude } from '../../classes/AriaStaticInclude'
|
|
10
|
+
import { Arrow } from './Arrow'
|
|
11
|
+
|
|
12
|
+
import { ArrowDirection } from './basicTypes'
|
|
13
|
+
import {
|
|
14
|
+
type ArrowPropsBasic
|
|
15
|
+
} from './props'
|
|
16
|
+
import {
|
|
17
|
+
type ArrowClasses,
|
|
18
|
+
type ArrowComponents,
|
|
19
|
+
type ArrowEmits,
|
|
20
|
+
type ArrowExpose,
|
|
21
|
+
type ArrowSlots
|
|
22
|
+
} from './types'
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* ArrowDesign
|
|
26
|
+
*/
|
|
27
|
+
export class ArrowDesign<
|
|
28
|
+
COMP extends ArrowComponents,
|
|
29
|
+
EXPOSE extends ArrowExpose,
|
|
30
|
+
CLASSES extends ArrowClasses,
|
|
31
|
+
P extends ArrowPropsBasic
|
|
32
|
+
> extends DesignConstructorAbstract<
|
|
33
|
+
HTMLDivElement,
|
|
34
|
+
COMP,
|
|
35
|
+
ArrowEmits,
|
|
36
|
+
EXPOSE,
|
|
37
|
+
ArrowSlots,
|
|
38
|
+
CLASSES,
|
|
39
|
+
P
|
|
40
|
+
> {
|
|
41
|
+
protected readonly item: Arrow
|
|
42
|
+
protected readonly points = ref<string>('')
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Constructor
|
|
46
|
+
* @param name class name/ название класса
|
|
47
|
+
* @param props properties/ свойства
|
|
48
|
+
* @param options list of additional parameters/ список дополнительных параметров
|
|
49
|
+
* @param ItemConstructor arrow item class/ класс элемента стрелки
|
|
50
|
+
*/
|
|
51
|
+
constructor(
|
|
52
|
+
name: string,
|
|
53
|
+
props: Readonly<P>,
|
|
54
|
+
options?: ConstrOptions<COMP, ArrowEmits, P>,
|
|
55
|
+
ItemConstructor: typeof Arrow = Arrow
|
|
56
|
+
) {
|
|
57
|
+
super(
|
|
58
|
+
name,
|
|
59
|
+
props,
|
|
60
|
+
options
|
|
61
|
+
)
|
|
62
|
+
|
|
63
|
+
this.item = new ItemConstructor(
|
|
64
|
+
this.props,
|
|
65
|
+
this.refs,
|
|
66
|
+
this.element,
|
|
67
|
+
this.getDesign(),
|
|
68
|
+
this.getName(),
|
|
69
|
+
this.components,
|
|
70
|
+
this.slots,
|
|
71
|
+
this.emits
|
|
72
|
+
)
|
|
73
|
+
|
|
74
|
+
this.init()
|
|
75
|
+
|
|
76
|
+
watch([this.classes], () => {
|
|
77
|
+
nextTick().then(
|
|
78
|
+
() => requestAnimationFrame(() => {
|
|
79
|
+
this.points.value = this.getRePoints()
|
|
80
|
+
})
|
|
81
|
+
)
|
|
82
|
+
}, { immediate: true })
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Initialization of all the necessary properties for work
|
|
87
|
+
*
|
|
88
|
+
* Инициализация всех необходимых свойств для работы.
|
|
89
|
+
*/
|
|
90
|
+
protected initExpose(): EXPOSE {
|
|
91
|
+
return {
|
|
92
|
+
update: this.item.position.update
|
|
93
|
+
} as EXPOSE
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Improvement of the obtained list of classes.
|
|
98
|
+
*
|
|
99
|
+
* Доработка полученного списка классов.
|
|
100
|
+
*/
|
|
101
|
+
protected initClasses(): Partial<CLASSES> {
|
|
102
|
+
return {
|
|
103
|
+
main: this.item.classes.value,
|
|
104
|
+
...{
|
|
105
|
+
// :classes [!] System label / Системная метка
|
|
106
|
+
mask: this.getSubClass('mask'),
|
|
107
|
+
arrow: this.getSubClass('arrow'),
|
|
108
|
+
arrowLine: this.getSubClass('arrowLine'),
|
|
109
|
+
arrowArea: this.getSubClass('arrowArea'),
|
|
110
|
+
border: this.getSubClass('border'),
|
|
111
|
+
borderHidden: this.getSubClass('borderHidden')
|
|
112
|
+
// :classes [!] System label / Системная метка
|
|
113
|
+
}
|
|
114
|
+
} as Partial<CLASSES>
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Refinement of the received list of styles.
|
|
119
|
+
*
|
|
120
|
+
* Доработка полученного списка стилей.
|
|
121
|
+
*/
|
|
122
|
+
protected initStyles(): ConstrStyles {
|
|
123
|
+
return {
|
|
124
|
+
...this.item.styles.value
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* A method for rendering.
|
|
130
|
+
*
|
|
131
|
+
* Метод для рендеринга.
|
|
132
|
+
*/
|
|
133
|
+
protected initRender(): VNode | undefined {
|
|
134
|
+
if (!isDomRuntime()) {
|
|
135
|
+
return undefined
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
const children: any[] = [
|
|
139
|
+
...this.renderArrow()
|
|
140
|
+
]
|
|
141
|
+
|
|
142
|
+
if (this.item.parent.isBorder.value) {
|
|
143
|
+
children.push(
|
|
144
|
+
...this.renderBorder()
|
|
145
|
+
)
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
return h('div', {
|
|
149
|
+
ref: this.element,
|
|
150
|
+
class: this.classes?.value.main,
|
|
151
|
+
style: this.styles?.value,
|
|
152
|
+
...AriaStaticInclude.hidden()
|
|
153
|
+
}, children)
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Method for rendering an arrow.
|
|
158
|
+
*
|
|
159
|
+
* Метод для рендеринга стрелки.
|
|
160
|
+
*/
|
|
161
|
+
protected renderArrow(): VNode[] {
|
|
162
|
+
return [
|
|
163
|
+
h(
|
|
164
|
+
'svg',
|
|
165
|
+
{
|
|
166
|
+
key: 'svg-arrow',
|
|
167
|
+
class: this.classes?.value.arrowArea
|
|
168
|
+
},
|
|
169
|
+
[
|
|
170
|
+
h(
|
|
171
|
+
'polygon',
|
|
172
|
+
{
|
|
173
|
+
key: 'arrow',
|
|
174
|
+
class: this.classes?.value.arrow,
|
|
175
|
+
points: this.points.value
|
|
176
|
+
}
|
|
177
|
+
),
|
|
178
|
+
h(
|
|
179
|
+
'polyline',
|
|
180
|
+
{
|
|
181
|
+
key: 'arrow-line',
|
|
182
|
+
class: this.classes?.value.arrowLine,
|
|
183
|
+
points: this.points.value
|
|
184
|
+
}
|
|
185
|
+
)
|
|
186
|
+
]
|
|
187
|
+
)
|
|
188
|
+
]
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* Method for rendering a border.
|
|
193
|
+
*
|
|
194
|
+
* Метод для рендеринга границы.
|
|
195
|
+
*/
|
|
196
|
+
protected renderBorder(): VNode[] {
|
|
197
|
+
return [
|
|
198
|
+
h('div', {
|
|
199
|
+
key: 'border',
|
|
200
|
+
class: this.classes?.value.border,
|
|
201
|
+
...AriaStaticInclude.hidden()
|
|
202
|
+
})
|
|
203
|
+
]
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* Gets the points for the arrow.
|
|
208
|
+
*
|
|
209
|
+
* Получает точки для стрелки.
|
|
210
|
+
*/
|
|
211
|
+
protected readonly getRePoints = (): string => {
|
|
212
|
+
const width = this.item.elementItem.getWidth()
|
|
213
|
+
const height = this.item.elementItem.getHeight()
|
|
214
|
+
|
|
215
|
+
switch (this.item.direction.value) {
|
|
216
|
+
case ArrowDirection.BOTTOM:
|
|
217
|
+
return `0, 0 ${width / 2}, ${height} ${width}, 0`
|
|
218
|
+
case ArrowDirection.LEFT:
|
|
219
|
+
return `${width}, 0 0, ${height / 2} ${width}, ${height}`
|
|
220
|
+
case ArrowDirection.RIGHT:
|
|
221
|
+
return `0, 0 ${width}, ${height / 2} 0, ${height}`
|
|
222
|
+
default:
|
|
223
|
+
return `0, ${height} ${width / 2}, 0 ${width}, ${height}`
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { type Ref } from 'vue'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Class for working with the arrow element.
|
|
5
|
+
*
|
|
6
|
+
* Класс для работы с элементом стрелки.
|
|
7
|
+
*/
|
|
8
|
+
export class ArrowElement {
|
|
9
|
+
/**
|
|
10
|
+
* Constructor
|
|
11
|
+
* @param element input element/ элемент ввода
|
|
12
|
+
* @param className class name/ название класса
|
|
13
|
+
*/
|
|
14
|
+
constructor(
|
|
15
|
+
protected readonly element: Ref<HTMLElement | undefined>,
|
|
16
|
+
protected readonly className: string
|
|
17
|
+
) {
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Checks that the element exists.
|
|
22
|
+
*
|
|
23
|
+
* Проверяет, что элемент существует.
|
|
24
|
+
*/
|
|
25
|
+
is(): this is { element: Ref<HTMLElement> } {
|
|
26
|
+
return Boolean(this.element.value)
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Gets the width of the arrow.
|
|
31
|
+
*
|
|
32
|
+
* Получает ширину стрелки.
|
|
33
|
+
*/
|
|
34
|
+
getWidth() {
|
|
35
|
+
const size = this.getStyleArrowWidth()
|
|
36
|
+
|
|
37
|
+
if (size) {
|
|
38
|
+
return Number(
|
|
39
|
+
size.replace(/[^0-9]+/ig, '')
|
|
40
|
+
)
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return 0
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Gets the height of the arrow.
|
|
48
|
+
*
|
|
49
|
+
* Получает высоту стрелки.
|
|
50
|
+
*/
|
|
51
|
+
getHeight() {
|
|
52
|
+
const size = this.getStyleArrowHeight()
|
|
53
|
+
|
|
54
|
+
if (size) {
|
|
55
|
+
return Number(
|
|
56
|
+
size.replace(/[^0-9]+/ig, '')
|
|
57
|
+
)
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
return 0
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Gets the element's bounding rectangle.
|
|
65
|
+
*
|
|
66
|
+
* Получает ограничивающий прямоугольник элемента.
|
|
67
|
+
*/
|
|
68
|
+
getRect(): DOMRect | undefined {
|
|
69
|
+
return this.element.value?.getBoundingClientRect()
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Gets the bounding rectangle of the border element.
|
|
74
|
+
*
|
|
75
|
+
* Получает ограничивающий прямоугольник элемента границы.
|
|
76
|
+
*/
|
|
77
|
+
getRectBorder(): DOMRect | undefined {
|
|
78
|
+
return this.element.value?.querySelector(`.${this.className}__border`)?.getBoundingClientRect() ?? undefined
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Gets the bounding rectangle of the border element.
|
|
83
|
+
*
|
|
84
|
+
* Получает ограничивающий прямоугольник элемента границы.
|
|
85
|
+
*/
|
|
86
|
+
getRectArrowLine(): DOMRect | undefined {
|
|
87
|
+
return this.element.value?.querySelector(`.${this.className}__arrowLine`)?.getBoundingClientRect() ?? undefined
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Gets the name of the arrow width variable.
|
|
92
|
+
*
|
|
93
|
+
* Получает имя переменной ширины стрелки.
|
|
94
|
+
*/
|
|
95
|
+
protected getNameArrowWidth(): string {
|
|
96
|
+
return `--${this.className}-arrowWidth`
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Gets the name of the arrow height variable.
|
|
101
|
+
*
|
|
102
|
+
* Получает имя переменной высоты стрелки.
|
|
103
|
+
*/
|
|
104
|
+
protected getNameArrowHeight(): string {
|
|
105
|
+
return `--${this.className}-arrowHeight`
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Gets the width of the arrow from styles.
|
|
110
|
+
*
|
|
111
|
+
* Получает ширину стрелки из стилей.
|
|
112
|
+
*/
|
|
113
|
+
protected getStyleArrowWidth(): string | undefined {
|
|
114
|
+
if (this.is()) {
|
|
115
|
+
return getComputedStyle(this.element.value)
|
|
116
|
+
.getPropertyValue(
|
|
117
|
+
this.getNameArrowWidth()
|
|
118
|
+
)
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
return undefined
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Gets the size of the arrow from styles.
|
|
126
|
+
*
|
|
127
|
+
* Получает размер стрелки из стилей.
|
|
128
|
+
*/
|
|
129
|
+
protected getStyleArrowHeight(): string | undefined {
|
|
130
|
+
if (this.is()) {
|
|
131
|
+
return getComputedStyle(this.element.value)
|
|
132
|
+
.getPropertyValue(
|
|
133
|
+
this.getNameArrowHeight()
|
|
134
|
+
)
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
return undefined
|
|
138
|
+
}
|
|
139
|
+
}
|