@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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { computed, type Ref, type ToRefs } from 'vue'
|
|
2
|
-
import { type ConstrEmit, DesignComp,
|
|
2
|
+
import { type ConstrEmit, DesignComp, ListDataRef } from '@dxtmisha/functional'
|
|
3
3
|
|
|
4
4
|
import { EventClickInclude } from '../../classes/EventClickInclude'
|
|
5
5
|
|
|
@@ -11,6 +11,7 @@ import { MenuSearch } from './MenuSearch'
|
|
|
11
11
|
|
|
12
12
|
import { MenuWindow } from './MenuWindow'
|
|
13
13
|
import { MenuValue } from './MenuValue'
|
|
14
|
+
import { MenuGo } from './MenuGo'
|
|
14
15
|
|
|
15
16
|
import type { MenuComponents, MenuEmits, MenuSlots } from './types'
|
|
16
17
|
import type { MenuProps } from './props'
|
|
@@ -30,7 +31,8 @@ export class Menu {
|
|
|
30
31
|
readonly value: MenuValue
|
|
31
32
|
|
|
32
33
|
/** Data manager for list selection and mapping/ Менеджер данных списка для выбора и сопоставления */
|
|
33
|
-
readonly data:
|
|
34
|
+
readonly data: ListDataRef
|
|
35
|
+
readonly go: MenuGo
|
|
34
36
|
|
|
35
37
|
/** Include for working with the Bars component/ Подключение для работы с компонентом Bars */
|
|
36
38
|
readonly bars: BarsInclude
|
|
@@ -68,18 +70,20 @@ export class Menu {
|
|
|
68
70
|
protected readonly emits?: ConstrEmit<MenuEmits>
|
|
69
71
|
) {
|
|
70
72
|
this.request = new MenuRequest(this.props)
|
|
71
|
-
this.search = new MenuSearch()
|
|
73
|
+
this.search = new MenuSearch(this.props)
|
|
72
74
|
this.value = new MenuValue(this.props, this.refs, this.emits)
|
|
73
75
|
|
|
74
|
-
this.data = new
|
|
76
|
+
this.data = new ListDataRef(
|
|
75
77
|
this.request.item,
|
|
76
78
|
undefined,
|
|
77
79
|
undefined,
|
|
78
80
|
undefined,
|
|
81
|
+
undefined,
|
|
79
82
|
this.value.selected,
|
|
80
83
|
this.refs.keyValue,
|
|
81
84
|
this.refs.keyLabel
|
|
82
85
|
)
|
|
86
|
+
this.go = new MenuGo(this.props, this.value, this.data)
|
|
83
87
|
|
|
84
88
|
this.bars = new BarsInclude(
|
|
85
89
|
this.props,
|
|
@@ -105,7 +109,10 @@ export class Menu {
|
|
|
105
109
|
isSelected: this.data.isSelected,
|
|
106
110
|
selectedList: this.data.selectedList,
|
|
107
111
|
selectedNames: this.data.selectedNames,
|
|
108
|
-
selectedValues: this.data.selectedValues
|
|
112
|
+
selectedValues: this.data.selectedValues,
|
|
113
|
+
|
|
114
|
+
previous: this.go.previous,
|
|
115
|
+
next: this.go.next
|
|
109
116
|
}
|
|
110
117
|
}
|
|
111
118
|
|
|
@@ -116,14 +123,19 @@ export class Menu {
|
|
|
116
123
|
*/
|
|
117
124
|
readonly binds = computed<ListPropsBasic>(() => {
|
|
118
125
|
return {
|
|
126
|
+
filterMode: this.props.filterMode,
|
|
127
|
+
|
|
119
128
|
liteThreshold: this.props.liteThreshold,
|
|
120
129
|
keyLabel: this.props.keyLabel,
|
|
121
130
|
keyValue: this.props.keyValue,
|
|
131
|
+
max: this.props.max,
|
|
122
132
|
|
|
123
133
|
tag: this.props.tag,
|
|
124
134
|
onClick: this.onClick,
|
|
125
135
|
onClose: this.window.expose.toClose,
|
|
126
136
|
|
|
137
|
+
itemAttrs: this.props.itemAttrs,
|
|
138
|
+
|
|
127
139
|
control: true
|
|
128
140
|
}
|
|
129
141
|
})
|
|
@@ -31,14 +31,14 @@ export class MenuDesign<
|
|
|
31
31
|
CLASSES extends MenuClasses,
|
|
32
32
|
P extends MenuPropsBasic
|
|
33
33
|
> extends DesignConstructorAbstract<
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
> {
|
|
34
|
+
HTMLDivElement,
|
|
35
|
+
COMP,
|
|
36
|
+
MenuEmits,
|
|
37
|
+
EXPOSE,
|
|
38
|
+
MenuSlots,
|
|
39
|
+
CLASSES,
|
|
40
|
+
P
|
|
41
|
+
> {
|
|
42
42
|
protected readonly item: Menu
|
|
43
43
|
|
|
44
44
|
/**
|
|
@@ -153,7 +153,6 @@ export class MenuDesign<
|
|
|
153
153
|
const children: any[] = []
|
|
154
154
|
if (this.item.bars.is.value) {
|
|
155
155
|
children.push(...this.item.bars.render())
|
|
156
|
-
console.log('this.item.bars.is.value', children)
|
|
157
156
|
}
|
|
158
157
|
|
|
159
158
|
this.initSlot('title', children, this.getBinds(props))
|
|
@@ -187,10 +186,11 @@ export class MenuDesign<
|
|
|
187
186
|
class: this.classes?.value.list,
|
|
188
187
|
|
|
189
188
|
selected: this.item.value.selected.value,
|
|
190
|
-
highlight: this.item.search.
|
|
189
|
+
highlight: this.item.search.value.value,
|
|
191
190
|
|
|
192
191
|
list,
|
|
193
|
-
lite: this.item.menuWindow.lite.value
|
|
192
|
+
lite: this.item.menuWindow.lite.value,
|
|
193
|
+
roleItem: this.props.roleItem
|
|
194
194
|
},
|
|
195
195
|
this.props.listAttrs
|
|
196
196
|
),
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { ListDataRef, type NumberOrStringOrBoolean } from '@dxtmisha/functional'
|
|
2
|
+
|
|
3
|
+
import { MenuValue } from './MenuValue'
|
|
4
|
+
|
|
5
|
+
import type { MenuProps } from './props'
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Navigation manager for Menu component
|
|
9
|
+
*
|
|
10
|
+
* Менеджер навигации для компонента Menu
|
|
11
|
+
*/
|
|
12
|
+
export class MenuGo {
|
|
13
|
+
/**
|
|
14
|
+
* Constructor
|
|
15
|
+
* @param props input data/ входные данные
|
|
16
|
+
* @param value value manager/ менеджер значений
|
|
17
|
+
* @param data data manager for list/ менеджер данных списка
|
|
18
|
+
*/
|
|
19
|
+
constructor(
|
|
20
|
+
protected readonly props: MenuProps,
|
|
21
|
+
protected readonly value: MenuValue,
|
|
22
|
+
protected readonly data: ListDataRef
|
|
23
|
+
) {
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Navigates to the previous item in the menu
|
|
28
|
+
*
|
|
29
|
+
* Переходит к предыдущему элементу меню
|
|
30
|
+
* @returns value of the previous item or undefined/ значение предыдущего элемента или undefined
|
|
31
|
+
*/
|
|
32
|
+
readonly previous = (): NumberOrStringOrBoolean | undefined => {
|
|
33
|
+
return this.go(-1)
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Navigates to the next item in the menu
|
|
38
|
+
*
|
|
39
|
+
* Переходит к следующему элементу меню
|
|
40
|
+
* @returns value of the next item or undefined/ значение следующего элемента или undefined
|
|
41
|
+
*/
|
|
42
|
+
readonly next = (): NumberOrStringOrBoolean | undefined => {
|
|
43
|
+
return this.go(1)
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Returns the step value for navigation
|
|
48
|
+
*
|
|
49
|
+
* Возвращает значение шага для навигации
|
|
50
|
+
* @returns step value/ значение шага
|
|
51
|
+
*/
|
|
52
|
+
protected getStep(): number {
|
|
53
|
+
return Number(this.props.step) || 1
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Navigates through the menu items by the specified direction
|
|
58
|
+
*
|
|
59
|
+
* Перемещается по элементам меню в указанном направлении
|
|
60
|
+
* @param directions direction multiplier (-1 for previous, 1 for next)/ множитель направления (-1 для предыдущего, 1 для следующего)
|
|
61
|
+
* @returns value of the selected item or undefined/ значение выбранного элемента или undefined
|
|
62
|
+
*/
|
|
63
|
+
protected go(directions: number): NumberOrStringOrBoolean | undefined {
|
|
64
|
+
const value = this.data.getSelectedByStep(this.getStep() * directions)
|
|
65
|
+
|
|
66
|
+
if (value) {
|
|
67
|
+
this.value.setValue(value, true)
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
return value
|
|
71
|
+
}
|
|
72
|
+
}
|
|
@@ -5,7 +5,8 @@ import {
|
|
|
5
5
|
getRef,
|
|
6
6
|
type RawSlots,
|
|
7
7
|
type RefOrNormal,
|
|
8
|
-
toBind
|
|
8
|
+
toBind,
|
|
9
|
+
toBinds
|
|
9
10
|
} from '@dxtmisha/functional'
|
|
10
11
|
|
|
11
12
|
import type { MenuComponentInclude, MenuExposeInclude, MenuPropsInclude } from './basicTypes'
|
|
@@ -53,17 +54,17 @@ export class MenuInclude<
|
|
|
53
54
|
|
|
54
55
|
/** Computed bindings for the menu/ Вычисляемые привязки для меню */
|
|
55
56
|
readonly binds = computed<PropsExtra>(() => {
|
|
56
|
-
const props =
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
57
|
+
const props = toBinds<PropsExtra>(
|
|
58
|
+
getRef(this.extra),
|
|
59
|
+
this.props.menuAttrs,
|
|
60
|
+
{
|
|
61
|
+
class: `${this.className}__menu`
|
|
62
|
+
}
|
|
62
63
|
)
|
|
63
64
|
|
|
64
65
|
return {
|
|
65
|
-
|
|
66
|
-
|
|
66
|
+
disabled: this.props.disabled,
|
|
67
|
+
...props
|
|
67
68
|
}
|
|
68
69
|
})
|
|
69
70
|
|
|
@@ -78,6 +79,15 @@ export class MenuInclude<
|
|
|
78
79
|
menuElement: this.element
|
|
79
80
|
}
|
|
80
81
|
|
|
82
|
+
/**
|
|
83
|
+
* Get the menu element
|
|
84
|
+
*
|
|
85
|
+
* Получить элемент меню
|
|
86
|
+
*/
|
|
87
|
+
getElement() {
|
|
88
|
+
return this.element.value
|
|
89
|
+
}
|
|
90
|
+
|
|
81
91
|
/**
|
|
82
92
|
* Render the Menu component
|
|
83
93
|
*
|
|
@@ -90,7 +100,7 @@ export class MenuInclude<
|
|
|
90
100
|
slotsChildren?: MenuSlots,
|
|
91
101
|
attrs?: Record<string, any>
|
|
92
102
|
): VNode[] => {
|
|
93
|
-
if (this.components
|
|
103
|
+
if (this.components) {
|
|
94
104
|
return this.components.render(
|
|
95
105
|
'menu',
|
|
96
106
|
{
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { ref } from 'vue'
|
|
1
|
+
import { computed, ref } from 'vue'
|
|
2
2
|
import { isFilled } from '@dxtmisha/functional'
|
|
3
|
+
import type { MenuProps } from './props'
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* Class for working with search.
|
|
@@ -9,6 +10,24 @@ import { isFilled } from '@dxtmisha/functional'
|
|
|
9
10
|
export class MenuSearch {
|
|
10
11
|
readonly item = ref<string>()
|
|
11
12
|
|
|
13
|
+
/**
|
|
14
|
+
* Constructor
|
|
15
|
+
* @param props input data/ входные данные
|
|
16
|
+
*/
|
|
17
|
+
constructor(
|
|
18
|
+
protected readonly props: MenuProps
|
|
19
|
+
) {
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/** Returns the search string/ Возвращает строку поиска */
|
|
23
|
+
readonly value = computed<string | undefined>(() => {
|
|
24
|
+
if (this.props.highlight) {
|
|
25
|
+
return this.props.highlight
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
return this.item.value
|
|
29
|
+
})
|
|
30
|
+
|
|
12
31
|
/**
|
|
13
32
|
* Sets the search string.
|
|
14
33
|
*
|
|
@@ -26,7 +26,7 @@ export class MenuValue {
|
|
|
26
26
|
protected readonly emits?: ConstrEmit<MenuEmits>
|
|
27
27
|
) {
|
|
28
28
|
if (this.props.isSelectedByValue) {
|
|
29
|
-
new ModelInclude('
|
|
29
|
+
new ModelInclude('selected', this.emits, this.value)
|
|
30
30
|
|
|
31
31
|
if (refs.selected) {
|
|
32
32
|
watch(
|
|
@@ -58,15 +58,19 @@ export class MenuValue {
|
|
|
58
58
|
*
|
|
59
59
|
* Устанавливает новое выбранное значение, если оно изменилось, и возвращает экземпляр для чейнинга.
|
|
60
60
|
* @param value selected list value/ выбранное значение списка
|
|
61
|
-
* @
|
|
61
|
+
* @param isEmit whether to emit the update event/ нужно ли вызвать событие обновления
|
|
62
62
|
*/
|
|
63
|
-
setValue(value: ListSelectedList): this {
|
|
63
|
+
setValue(value: ListSelectedList, isEmit: boolean = false): this {
|
|
64
64
|
if (
|
|
65
65
|
this.props.isSelectedByValue
|
|
66
66
|
&& !isObject(value)
|
|
67
67
|
&& this.value.value !== value
|
|
68
68
|
) {
|
|
69
69
|
this.value.value = value
|
|
70
|
+
|
|
71
|
+
if (isEmit) {
|
|
72
|
+
this.emits?.('updateValue', value)
|
|
73
|
+
}
|
|
70
74
|
}
|
|
71
75
|
return this
|
|
72
76
|
}
|
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import type { ComputedRef, Ref } from 'vue'
|
|
2
|
-
import type { ConstrBind } from '@dxtmisha/functional'
|
|
2
|
+
import type { ConstrBind, NumberOrStringOrBoolean } from '@dxtmisha/functional'
|
|
3
3
|
import type { WindowControlItem } from '../Window'
|
|
4
4
|
|
|
5
5
|
import type { ListExpose } from '../List'
|
|
6
6
|
import type { MenuExpose } from './types'
|
|
7
|
-
import type {
|
|
7
|
+
import type { MenuPropsBasic } from './props'
|
|
8
8
|
|
|
9
9
|
export type MenuControlBasic
|
|
10
10
|
= ListExpose
|
|
11
11
|
& {
|
|
12
12
|
loading: Ref<boolean>
|
|
13
|
+
|
|
14
|
+
previous(): NumberOrStringOrBoolean | undefined
|
|
15
|
+
next(): NumberOrStringOrBoolean | undefined
|
|
13
16
|
}
|
|
14
17
|
|
|
15
18
|
export type MenuControlItem
|
|
@@ -34,8 +37,22 @@ export interface MenuExposeInclude {
|
|
|
34
37
|
menuElement: Ref<ConstrBind<MenuExpose> | undefined>
|
|
35
38
|
}
|
|
36
39
|
|
|
40
|
+
export type MenuSlotInclude = {
|
|
41
|
+
/** Title slot for window title/ Слот заголовка для заголовка окна */
|
|
42
|
+
title?(props: MenuControlItem): any
|
|
43
|
+
|
|
44
|
+
/** Footer slot for window bottom/ Слот подвала для низа окна */
|
|
45
|
+
footer?(props: MenuControlItem): any
|
|
46
|
+
|
|
47
|
+
/** Context slot for top area / Слот контекстной области сверху */
|
|
48
|
+
contextTop?(props: MenuControlItem): any
|
|
49
|
+
|
|
50
|
+
/** Context slot for bottom area / Слот контекстной области снизу */
|
|
51
|
+
contextBottom?(props: MenuControlItem): any
|
|
52
|
+
}
|
|
53
|
+
|
|
37
54
|
/** Interface for menu include props/ Интерфейс для свойств включения меню */
|
|
38
|
-
export interface MenuPropsInclude {
|
|
55
|
+
export interface MenuPropsInclude<Menu extends MenuPropsBasic = MenuPropsBasic> {
|
|
39
56
|
disabled?: boolean
|
|
40
|
-
menuAttrs?: ConstrBind<
|
|
57
|
+
menuAttrs?: ConstrBind<Menu>
|
|
41
58
|
}
|
|
@@ -1,17 +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
|
-
}
|
|
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
|
+
}
|
|
@@ -10,7 +10,9 @@ import type { ListPropsBasic } from '../List'
|
|
|
10
10
|
import type { ListItemProps, ListItemPropsBasic } from '../ListItem'
|
|
11
11
|
import type { BarsPropsBasic, BarsPropsInclude } from '../Bars'
|
|
12
12
|
import type { WindowPropsBasic, WindowPropsInclude } from '../Window'
|
|
13
|
-
|
|
13
|
+
|
|
14
|
+
import type { ModelPropsSelected } from '../../types/modelTypes'
|
|
15
|
+
import type { RoleType } from '../../types/roleTypes'
|
|
14
16
|
|
|
15
17
|
interface MenuPropsToken {
|
|
16
18
|
// :type [!] System label / Системная метка
|
|
@@ -26,15 +28,17 @@ export interface MenuPropsBasic<
|
|
|
26
28
|
Window extends WindowPropsBasic = WindowPropsBasic
|
|
27
29
|
> extends BarsPropsInclude<Bars>,
|
|
28
30
|
WindowPropsInclude<Window>,
|
|
29
|
-
|
|
31
|
+
ModelPropsSelected {
|
|
30
32
|
// Status
|
|
31
33
|
selected?: ListSelectedList
|
|
32
|
-
highlightLengthStart?: number
|
|
33
34
|
hideList?: boolean
|
|
34
35
|
|
|
35
36
|
// Value
|
|
36
37
|
list?: ListRecord<ListItem>
|
|
37
38
|
liteThreshold?: number
|
|
39
|
+
highlight?: string
|
|
40
|
+
highlightLengthStart?: number
|
|
41
|
+
filterMode?: boolean
|
|
38
42
|
|
|
39
43
|
ajax?: string | (() => NormalOrPromise<ListRecord<ListItem>>)
|
|
40
44
|
request?: ApiFetch
|
|
@@ -43,12 +47,18 @@ export interface MenuPropsBasic<
|
|
|
43
47
|
keyLabel?: string
|
|
44
48
|
keyValue?: string
|
|
45
49
|
|
|
50
|
+
max?: string | number
|
|
51
|
+
|
|
46
52
|
// Style
|
|
47
53
|
tag?: ListItemProps['tag']
|
|
54
|
+
step?: string | number
|
|
48
55
|
|
|
49
56
|
listAttrs?: ConstrBind<List>
|
|
50
57
|
itemAttrs?: ConstrBind<ListItem>
|
|
51
58
|
|
|
59
|
+
// ARIA
|
|
60
|
+
roleItem?: RoleType
|
|
61
|
+
|
|
52
62
|
// Technical
|
|
53
63
|
isSelectedByValue?: boolean
|
|
54
64
|
}
|
|
@@ -71,7 +81,9 @@ export const defaultsMenu = {
|
|
|
71
81
|
barsHide: true,
|
|
72
82
|
barsBackHide: true,
|
|
73
83
|
tag: 'a',
|
|
84
|
+
step: 1,
|
|
74
85
|
autoClose: true,
|
|
86
|
+
roleItem: 'menuitem',
|
|
75
87
|
...{
|
|
76
88
|
// :default [!] System label / Системная метка
|
|
77
89
|
// :default [!] System label / Системная метка
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import type { ConstrClass } from '@dxtmisha/functional'
|
|
1
|
+
import type { ConstrClass, NumberOrStringOrBoolean } from '@dxtmisha/functional'
|
|
2
2
|
|
|
3
3
|
import type { EventClickEmits } from '../../types/eventClickTypes'
|
|
4
4
|
|
|
5
5
|
import type { ListComponentInclude, ListSlots } from '../List'
|
|
6
6
|
import type { BarsComponentInclude, BarsEmitsInclude } from '../Bars'
|
|
7
7
|
import type { WindowComponentInclude, WindowEmitsInclude, WindowExposeInclude } from '../Window'
|
|
8
|
-
import type {
|
|
8
|
+
import type { ModelEmitsSelected } from '../../types/modelTypes'
|
|
9
9
|
|
|
10
|
-
import type { MenuControlBasic, MenuControlItem } from './basicTypes'
|
|
10
|
+
import type { MenuControlBasic, MenuControlItem, MenuSlotInclude } from './basicTypes'
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* Interface for describing which components need to be connected for work.
|
|
@@ -28,8 +28,9 @@ export type MenuEmits
|
|
|
28
28
|
= BarsEmitsInclude
|
|
29
29
|
& EventClickEmits
|
|
30
30
|
& WindowEmitsInclude
|
|
31
|
-
&
|
|
31
|
+
& ModelEmitsSelected
|
|
32
32
|
& {
|
|
33
|
+
updateValue: [value?: NumberOrStringOrBoolean]
|
|
33
34
|
clickSlot: [value?: string]
|
|
34
35
|
}
|
|
35
36
|
|
|
@@ -48,21 +49,10 @@ export interface MenuExpose extends WindowExposeInclude, MenuControlBasic {
|
|
|
48
49
|
*/
|
|
49
50
|
export type MenuSlots
|
|
50
51
|
= ListSlots
|
|
52
|
+
& MenuSlotInclude
|
|
51
53
|
& {
|
|
52
54
|
/** Control slot for window management / Слот управления для управления окном */
|
|
53
55
|
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
56
|
}
|
|
67
57
|
|
|
68
58
|
/**
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { computed, type Ref, type ToRefs } from 'vue'
|
|
2
|
+
import { type ConstrEmit, DesignComp } from '@dxtmisha/functional'
|
|
3
|
+
|
|
4
|
+
import { ModalAbstract } from './ModalAbstract'
|
|
5
|
+
|
|
6
|
+
import type { ModalComponents, ModalEmits, ModalSlots } from './types'
|
|
7
|
+
import type { ModalProps } from './props'
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Modal
|
|
11
|
+
*/
|
|
12
|
+
export class Modal extends ModalAbstract {
|
|
13
|
+
/**
|
|
14
|
+
* Constructor
|
|
15
|
+
* @param props input data/ входные данные
|
|
16
|
+
* @param refs input data in the form of reactive elements/ входные данные в виде реактивных элементов
|
|
17
|
+
* @param element input element/ элемент ввода
|
|
18
|
+
* @param classDesign design name/ название дизайна
|
|
19
|
+
* @param className class name/ название класса
|
|
20
|
+
* @param components object for working with components/ объект для работы с компонентами
|
|
21
|
+
* @param slots object for working with slots/ объект для работы со слотами
|
|
22
|
+
* @param emits the function is called when an event is triggered/ функция вызывается, когда срабатывает событие
|
|
23
|
+
*/
|
|
24
|
+
constructor(
|
|
25
|
+
protected readonly props: ModalProps,
|
|
26
|
+
protected readonly refs: ToRefs<ModalProps>,
|
|
27
|
+
protected readonly element: Ref<HTMLElement | undefined>,
|
|
28
|
+
protected readonly classDesign: string,
|
|
29
|
+
protected readonly className: string,
|
|
30
|
+
protected readonly components?: DesignComp<ModalComponents, ModalProps>,
|
|
31
|
+
protected readonly slots?: ModalSlots,
|
|
32
|
+
protected readonly emits?: ConstrEmit<ModalEmits>
|
|
33
|
+
) {
|
|
34
|
+
super(
|
|
35
|
+
props,
|
|
36
|
+
refs,
|
|
37
|
+
element,
|
|
38
|
+
classDesign,
|
|
39
|
+
className,
|
|
40
|
+
components,
|
|
41
|
+
slots,
|
|
42
|
+
emits,
|
|
43
|
+
computed(() => ({
|
|
44
|
+
open: props.open,
|
|
45
|
+
image: props.image,
|
|
46
|
+
|
|
47
|
+
adaptive: 'modal',
|
|
48
|
+
imagePosition: props.imagePosition,
|
|
49
|
+
closeButton: props.barsBackHide
|
|
50
|
+
}))
|
|
51
|
+
)
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { computed, type Ref, type ToRefs } from 'vue'
|
|
2
|
+
import { type ConstrEmit, DesignComp, getRef, type RefOrNormal } from '@dxtmisha/functional'
|
|
3
|
+
|
|
4
|
+
import { WindowInclude } from '../Window'
|
|
5
|
+
import { BarsInclude } from '../Bars'
|
|
6
|
+
import { ActionsInclude } from '../Actions'
|
|
7
|
+
|
|
8
|
+
import type { ModalComponents, ModalEmits, ModalSlots } from './types'
|
|
9
|
+
import type { ModalProps } from './props'
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* ModalAbstract
|
|
13
|
+
*/
|
|
14
|
+
export abstract class ModalAbstract {
|
|
15
|
+
readonly bars: BarsInclude
|
|
16
|
+
readonly actions: ActionsInclude
|
|
17
|
+
readonly window: WindowInclude
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Constructor
|
|
21
|
+
* @param props input data/ входные данные
|
|
22
|
+
* @param refs input data in the form of reactive elements/ входные данные в виде реактивных элементов
|
|
23
|
+
* @param element input element/ элемент ввода
|
|
24
|
+
* @param classDesign design name/ название дизайна
|
|
25
|
+
* @param className class name/ название класса
|
|
26
|
+
* @param components object for working with components/ объект для работы с компонентами
|
|
27
|
+
* @param slots object for working with slots/ объект для работы со слотами
|
|
28
|
+
* @param emits the function is called when an event is triggered/ функция вызывается, когда срабатывает событие
|
|
29
|
+
* @param extraWindow additional parameters for WindowInclude/ дополнительные параметры для WindowInclude
|
|
30
|
+
* @param extraBars additional parameters for BarsInclude/ дополнительные параметры для BarsInclude
|
|
31
|
+
* @param extraActions additional parameters for ActionsInclude/ дополнительные параметры для ActionsInclude
|
|
32
|
+
*/
|
|
33
|
+
protected constructor(
|
|
34
|
+
protected readonly props: ModalProps,
|
|
35
|
+
protected readonly refs: ToRefs<ModalProps>,
|
|
36
|
+
protected readonly element: Ref<HTMLElement | undefined>,
|
|
37
|
+
protected readonly classDesign: string,
|
|
38
|
+
protected readonly className: string,
|
|
39
|
+
protected readonly components?: DesignComp<ModalComponents, ModalProps>,
|
|
40
|
+
protected readonly slots?: ModalSlots,
|
|
41
|
+
protected readonly emits?: ConstrEmit<ModalEmits>,
|
|
42
|
+
protected readonly extraWindow?: RefOrNormal<any>,
|
|
43
|
+
protected readonly extraBars?: RefOrNormal<any>,
|
|
44
|
+
protected readonly extraActions?: RefOrNormal<any>
|
|
45
|
+
) {
|
|
46
|
+
this.bars = new BarsInclude(
|
|
47
|
+
props,
|
|
48
|
+
className,
|
|
49
|
+
components,
|
|
50
|
+
emits,
|
|
51
|
+
extraBars
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
this.actions = new ActionsInclude(
|
|
55
|
+
props,
|
|
56
|
+
className,
|
|
57
|
+
components,
|
|
58
|
+
emits,
|
|
59
|
+
extraActions
|
|
60
|
+
)
|
|
61
|
+
|
|
62
|
+
this.window = new WindowInclude(
|
|
63
|
+
props,
|
|
64
|
+
className,
|
|
65
|
+
components,
|
|
66
|
+
emits,
|
|
67
|
+
computed(() => ({
|
|
68
|
+
...getRef(extraWindow),
|
|
69
|
+
ariaLabelledby: this.bars.element.value?.labelId,
|
|
70
|
+
ariaDescribedby: this.bars.element.value?.descriptionId
|
|
71
|
+
}))
|
|
72
|
+
)
|
|
73
|
+
}
|
|
74
|
+
}
|