@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,67 @@
|
|
|
1
|
+
import type { ConstrClass } from '@dxtmisha/functional'
|
|
2
|
+
import type {
|
|
3
|
+
ModalComponents,
|
|
4
|
+
ModalEmits,
|
|
5
|
+
ModalExpose,
|
|
6
|
+
ModalSlots
|
|
7
|
+
} from '../Modal'
|
|
8
|
+
import type { IconComponentInclude } from '../Icon'
|
|
9
|
+
|
|
10
|
+
import type { LabelAlternativeSlots } from '../../types/labelTypes'
|
|
11
|
+
import type { DescriptionSlots } from '../../types/descriptionTypes'
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Interface for describing which components need to be connected for work.
|
|
15
|
+
*
|
|
16
|
+
* Интерфейс для описания, какие компоненты надо подключить для работы.
|
|
17
|
+
*/
|
|
18
|
+
export type DialogComponents = ModalComponents & IconComponentInclude
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Type describing available events.
|
|
22
|
+
*
|
|
23
|
+
* Тип, описывающий доступные события.
|
|
24
|
+
*/
|
|
25
|
+
export type DialogEmits
|
|
26
|
+
= ModalEmits
|
|
27
|
+
& {
|
|
28
|
+
ok: []
|
|
29
|
+
close: []
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Type describing available properties.
|
|
34
|
+
*
|
|
35
|
+
* Тип, описывающий доступные свойства.
|
|
36
|
+
*/
|
|
37
|
+
export interface DialogExpose extends ModalExpose {
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Type describing available slots.
|
|
42
|
+
*
|
|
43
|
+
* Тип, описывающий доступные слоты.
|
|
44
|
+
*/
|
|
45
|
+
export interface DialogSlots extends ModalSlots,
|
|
46
|
+
LabelAlternativeSlots,
|
|
47
|
+
DescriptionSlots {
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Type describing subclasses.
|
|
52
|
+
*
|
|
53
|
+
* Тип, описывающий подклассы.
|
|
54
|
+
*/
|
|
55
|
+
export type DialogClasses = {
|
|
56
|
+
main: ConstrClass
|
|
57
|
+
// :classes [!] System label / Системная метка
|
|
58
|
+
title: string
|
|
59
|
+
header: string
|
|
60
|
+
information: string
|
|
61
|
+
icon: string
|
|
62
|
+
label: string
|
|
63
|
+
description: string
|
|
64
|
+
body: string
|
|
65
|
+
footer: string
|
|
66
|
+
// :classes [!] System label / Системная метка
|
|
67
|
+
}
|
|
@@ -19,11 +19,18 @@ import { FieldSize } from './FieldSize'
|
|
|
19
19
|
import type { FieldComponents, FieldEmits, FieldSlots } from './types'
|
|
20
20
|
import type { FieldProps } from './props'
|
|
21
21
|
import type { FieldControl } from './basicTypes'
|
|
22
|
+
import { AriaStaticInclude } from '../../classes/AriaStaticInclude'
|
|
22
23
|
|
|
23
24
|
/**
|
|
24
25
|
* Field
|
|
25
26
|
*/
|
|
26
27
|
export class Field {
|
|
28
|
+
readonly id: string = getElementId()
|
|
29
|
+
readonly labelId: string = `${this.id}-label`
|
|
30
|
+
readonly helperId: string = `${this.id}-helper`
|
|
31
|
+
readonly validationId: string = `${this.id}-validation`
|
|
32
|
+
readonly counterId: string = `${this.id}-counter`
|
|
33
|
+
|
|
27
34
|
readonly icon: IconTrailingInclude
|
|
28
35
|
|
|
29
36
|
readonly caption: CaptionInclude
|
|
@@ -62,6 +69,11 @@ export class Field {
|
|
|
62
69
|
protected readonly slots?: FieldSlots,
|
|
63
70
|
protected readonly emits?: ConstrEmit<FieldEmits>
|
|
64
71
|
) {
|
|
72
|
+
this.skeleton = new SkeletonInclude(
|
|
73
|
+
this.props,
|
|
74
|
+
this.classDesign,
|
|
75
|
+
['classBackground']
|
|
76
|
+
)
|
|
65
77
|
this.icon = new IconTrailingInclude(this.props, this.className, this.components)
|
|
66
78
|
|
|
67
79
|
this.caption = new CaptionInclude(this.props, this.className, this.slots)
|
|
@@ -74,7 +86,9 @@ export class Field {
|
|
|
74
86
|
this.components,
|
|
75
87
|
this.slots,
|
|
76
88
|
this.refs.counterTop,
|
|
77
|
-
this.
|
|
89
|
+
this.labelId,
|
|
90
|
+
this.counterId,
|
|
91
|
+
this.skeleton.binds
|
|
78
92
|
)
|
|
79
93
|
this.fieldMessage = new FieldMessageInclude(
|
|
80
94
|
this.props,
|
|
@@ -82,7 +96,10 @@ export class Field {
|
|
|
82
96
|
this.components,
|
|
83
97
|
undefined,
|
|
84
98
|
computed(() => !this.props.counterTop),
|
|
85
|
-
this.
|
|
99
|
+
this.helperId,
|
|
100
|
+
this.validationId,
|
|
101
|
+
this.counterId,
|
|
102
|
+
this.skeleton.binds
|
|
86
103
|
)
|
|
87
104
|
|
|
88
105
|
this.progress = new ProgressInclude(
|
|
@@ -98,11 +115,6 @@ export class Field {
|
|
|
98
115
|
|
|
99
116
|
this.enabled = new EnabledInclude(this.props, this.progress)
|
|
100
117
|
this.event = new EventClickInclude(this.props, this.enabled, this.emits)
|
|
101
|
-
this.skeleton = new SkeletonInclude(
|
|
102
|
-
this.props,
|
|
103
|
-
this.classDesign,
|
|
104
|
-
['classBackground']
|
|
105
|
-
)
|
|
106
118
|
|
|
107
119
|
this.icons = new FieldIcons(this.props, this.className)
|
|
108
120
|
this.size = new FieldSize(this.element, this.className)
|
|
@@ -128,20 +140,47 @@ export class Field {
|
|
|
128
140
|
}))
|
|
129
141
|
|
|
130
142
|
/**
|
|
131
|
-
* Returns data for the slot
|
|
132
|
-
*
|
|
133
|
-
* Возвращает данные для слота
|
|
143
|
+
* Returns data for the slot/ Возвращает данные для слота
|
|
134
144
|
*/
|
|
135
|
-
|
|
145
|
+
readonly control = computed<FieldControl>(() => {
|
|
146
|
+
const id = String(this.props.id || this.id)
|
|
147
|
+
const className = `${this.className}__body__input ${this.skeleton.classesSkeleton.classText}`
|
|
148
|
+
|
|
136
149
|
return {
|
|
137
|
-
id
|
|
138
|
-
className
|
|
139
|
-
classHidden: `${this.className}__body__hidden
|
|
150
|
+
id,
|
|
151
|
+
className,
|
|
152
|
+
classHidden: `${this.className}__body__hidden`,
|
|
153
|
+
classForFocus: `${this.className}__body__focus`,
|
|
154
|
+
binds: {
|
|
155
|
+
id,
|
|
156
|
+
className,
|
|
157
|
+
...AriaStaticInclude.labelledby(this.labelId),
|
|
158
|
+
...AriaStaticInclude.describedby(this.getDescribedby()),
|
|
159
|
+
...AriaStaticInclude.invalid(this.isValidation.value)
|
|
160
|
+
}
|
|
140
161
|
}
|
|
141
|
-
}
|
|
162
|
+
})
|
|
142
163
|
|
|
143
|
-
/**
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
164
|
+
/**
|
|
165
|
+
* Get ARIA describedby attribute.
|
|
166
|
+
*
|
|
167
|
+
* Получить атрибут ARIA describedby.
|
|
168
|
+
*/
|
|
169
|
+
protected getDescribedby(): string {
|
|
170
|
+
const describedby = []
|
|
171
|
+
|
|
172
|
+
if (this.props.helperMessage) {
|
|
173
|
+
describedby.push(this.helperId)
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
if (this.isValidation.value) {
|
|
177
|
+
describedby.push(this.validationId)
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
if (this.props.counterShow) {
|
|
181
|
+
describedby.push(this.counterId)
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
return describedby.join(' ')
|
|
185
|
+
}
|
|
147
186
|
}
|
|
@@ -28,14 +28,14 @@ export class FieldDesign<
|
|
|
28
28
|
CLASSES extends FieldClasses,
|
|
29
29
|
P extends FieldPropsBasic
|
|
30
30
|
> extends DesignConstructorAbstract<
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
> {
|
|
31
|
+
HTMLLabelElement,
|
|
32
|
+
COMP,
|
|
33
|
+
FieldEmits,
|
|
34
|
+
EXPOSE,
|
|
35
|
+
FieldSlots,
|
|
36
|
+
CLASSES,
|
|
37
|
+
P
|
|
38
|
+
> {
|
|
39
39
|
protected readonly item: Field
|
|
40
40
|
|
|
41
41
|
/**
|
|
@@ -157,7 +157,7 @@ export class FieldDesign<
|
|
|
157
157
|
*/
|
|
158
158
|
readonly renderBody = (): VNode[] => {
|
|
159
159
|
const children: any[] = [
|
|
160
|
-
this.initSlot('default', undefined, this.item.
|
|
160
|
+
this.initSlot('default', undefined, this.item.control.value),
|
|
161
161
|
this.renderBodyLabel(),
|
|
162
162
|
this.renderBodyScoreboard(),
|
|
163
163
|
this.renderBodyBorder()
|
|
@@ -311,8 +311,11 @@ export class FieldDesign<
|
|
|
311
311
|
children.push(
|
|
312
312
|
h(
|
|
313
313
|
'span',
|
|
314
|
-
{
|
|
315
|
-
|
|
314
|
+
{
|
|
315
|
+
class: this.classes?.value.bodyScoreboardInput,
|
|
316
|
+
style: `min-width: ${this.lengthValue()};`
|
|
317
|
+
},
|
|
318
|
+
this.focusValue()
|
|
316
319
|
),
|
|
317
320
|
...this.item.caption.render()
|
|
318
321
|
)
|
|
@@ -341,14 +344,29 @@ export class FieldDesign<
|
|
|
341
344
|
*
|
|
342
345
|
* Значение для фокуса.
|
|
343
346
|
*/
|
|
344
|
-
protected readonly focusValue =
|
|
345
|
-
if (
|
|
347
|
+
protected readonly focusValue = (): string => {
|
|
348
|
+
if (
|
|
349
|
+
!this.lengthElement.value
|
|
350
|
+
&& isString(this.props.value)
|
|
351
|
+
) {
|
|
346
352
|
return this.props.value
|
|
347
353
|
}
|
|
348
354
|
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
355
|
+
return ''
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
/**
|
|
359
|
+
* Length value.
|
|
360
|
+
*
|
|
361
|
+
* Значение длины.
|
|
362
|
+
*/
|
|
363
|
+
protected readonly lengthValue = (): string | undefined => {
|
|
364
|
+
if (this.lengthElement.value) {
|
|
365
|
+
return `${this.lengthElement.value.offsetWidth}px`
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
return undefined
|
|
369
|
+
}
|
|
352
370
|
|
|
353
371
|
/**
|
|
354
372
|
* Element for counting characters.
|
|
@@ -357,7 +375,7 @@ export class FieldDesign<
|
|
|
357
375
|
*/
|
|
358
376
|
protected readonly lengthElement = computed<HTMLInputElement | undefined>(() => {
|
|
359
377
|
return this.element.value
|
|
360
|
-
?.querySelector<HTMLInputElement>(
|
|
378
|
+
?.querySelector<HTMLInputElement>(`*[data-length]`) ?? undefined
|
|
361
379
|
})
|
|
362
380
|
|
|
363
381
|
/**
|
|
@@ -1,8 +1,23 @@
|
|
|
1
|
-
import { computed } from 'vue'
|
|
2
|
-
import {
|
|
1
|
+
import { computed, type VNode } from 'vue'
|
|
2
|
+
import {
|
|
3
|
+
type ConstrBind,
|
|
4
|
+
type DesignComponents,
|
|
5
|
+
eventStopPropagation,
|
|
6
|
+
type RefOrNormal,
|
|
7
|
+
toBind,
|
|
8
|
+
toBinds,
|
|
9
|
+
getRef
|
|
10
|
+
} from '@dxtmisha/functional'
|
|
3
11
|
|
|
4
|
-
import type {
|
|
12
|
+
import type { EventClickValue } from '../../types/eventClickTypes'
|
|
13
|
+
import type { FieldValueInclude } from '../../classes/field/FieldValueInclude'
|
|
14
|
+
import type { FieldEventInclude } from '../../classes/field/FieldEventInclude'
|
|
15
|
+
import type { FieldArrowInclude } from '../../classes/field/FieldArrowInclude'
|
|
16
|
+
|
|
17
|
+
import type { FieldComponentInclude, FieldPropsInclude } from './basicTypes'
|
|
18
|
+
import type { FieldArrowProps } from '../../types/fieldTypes'
|
|
5
19
|
import type { FieldPropsBasic } from './props'
|
|
20
|
+
import type { FieldSlots } from './types'
|
|
6
21
|
|
|
7
22
|
/**
|
|
8
23
|
* The class returns data for working with the Field framework.
|
|
@@ -10,19 +25,41 @@ import type { FieldPropsBasic } from './props'
|
|
|
10
25
|
* Класс возвращает данные для работы с каркасом поля.
|
|
11
26
|
*/
|
|
12
27
|
export class FieldInclude<
|
|
13
|
-
Props extends FieldPropsInclude = FieldPropsInclude,
|
|
28
|
+
Props extends FieldPropsInclude & FieldArrowProps = FieldPropsInclude,
|
|
14
29
|
PropsExtra extends ConstrBind<FieldPropsBasic> = ConstrBind<FieldPropsBasic>
|
|
15
30
|
> {
|
|
31
|
+
/**
|
|
32
|
+
* Constructor
|
|
33
|
+
* @param props input data/ входные данные
|
|
34
|
+
* @param value object for working with values/ объект для работы со значениями
|
|
35
|
+
* @param components object for working with components/ объект для работы с компонентами
|
|
36
|
+
* @param event object for working with events/ объект для работы с событиями
|
|
37
|
+
* @param arrow object for working with arrows/ объект для работы со стрелками
|
|
38
|
+
* @param onIcon Collection icon click handler/ Обработчик клика по иконке коллекции
|
|
39
|
+
* @param onTrailing Trailing icon click handler/ Обработчик клика по иконке трейлинга
|
|
40
|
+
* @param onNext Next arrow click handler/ Обработчик клика по следующей стрелке
|
|
41
|
+
* @param onPrevious Previous arrow click handler/ Обработчик клика по предыдущей стрелке
|
|
42
|
+
* @param extra additional parameter or property name/ дополнительный параметр или имя свойства
|
|
43
|
+
* @param index index identifier/ идентификатор индекса
|
|
44
|
+
*/
|
|
16
45
|
constructor(
|
|
17
46
|
protected readonly props: Readonly<Props>,
|
|
18
|
-
protected readonly
|
|
47
|
+
protected readonly value: FieldValueInclude,
|
|
48
|
+
protected readonly components?: DesignComponents<FieldComponentInclude, Props>,
|
|
49
|
+
protected readonly event?: FieldEventInclude,
|
|
50
|
+
protected readonly arrow?: FieldArrowInclude,
|
|
51
|
+
protected readonly onIcon?: () => void,
|
|
52
|
+
protected readonly onTrailing?: () => void,
|
|
53
|
+
protected readonly onNext?: () => void,
|
|
54
|
+
protected readonly onPrevious?: () => void,
|
|
55
|
+
protected readonly extra?: RefOrNormal<PropsExtra>,
|
|
56
|
+
protected readonly index?: string
|
|
19
57
|
) {
|
|
20
58
|
}
|
|
21
59
|
|
|
22
60
|
/** Returns properties for the field framework/ Возвращает свойства для каркаса поля */
|
|
23
|
-
readonly binds = computed<PropsExtra>(
|
|
24
|
-
|
|
25
|
-
getRef(this.extra),
|
|
61
|
+
readonly binds = computed<PropsExtra>(() => {
|
|
62
|
+
return toBinds<PropsExtra>(
|
|
26
63
|
{
|
|
27
64
|
// Status
|
|
28
65
|
focus: this.props.focus,
|
|
@@ -39,7 +76,6 @@ export class FieldInclude<
|
|
|
39
76
|
suffix: this.props.suffix,
|
|
40
77
|
caption: this.props.caption,
|
|
41
78
|
helperMessage: this.props.helperMessage,
|
|
42
|
-
validationMessage: this.props.validationMessage,
|
|
43
79
|
|
|
44
80
|
required: this.props.required,
|
|
45
81
|
|
|
@@ -60,13 +96,107 @@ export class FieldInclude<
|
|
|
60
96
|
iconTrailingPalette: this.props.iconTrailingPalette,
|
|
61
97
|
iconAttrs: this.props.iconAttrs,
|
|
62
98
|
|
|
99
|
+
align: this.props.align,
|
|
100
|
+
|
|
101
|
+
arrowCarousel: this.arrow?.isCarousel() ?? this.props.arrow === 'carousel',
|
|
102
|
+
arrowStepper: this.arrow?.isStepper() ?? this.props.arrow === 'stepper',
|
|
103
|
+
arrowAlign: this.arrow?.align() ?? this.props.arrowAlign,
|
|
104
|
+
|
|
63
105
|
isSkeleton: this.props.isSkeleton,
|
|
64
106
|
|
|
65
107
|
fieldLabelAttrs: this.props.fieldLabelAttrs,
|
|
66
108
|
fieldMessageAttrs: this.props.fieldMessageAttrs,
|
|
67
|
-
fieldCounterAttrs: this.props.fieldCounterAttrs
|
|
109
|
+
fieldCounterAttrs: this.props.fieldCounterAttrs,
|
|
110
|
+
|
|
111
|
+
onClick: this.on
|
|
68
112
|
},
|
|
113
|
+
getRef(this.extra),
|
|
69
114
|
this.props.fieldAttrs
|
|
70
115
|
)
|
|
71
|
-
)
|
|
116
|
+
})
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Returns properties for working with the value of the Field framework/
|
|
120
|
+
* Возвращает свойства для работы со значением каркаса поля
|
|
121
|
+
*/
|
|
122
|
+
readonly valueBinds = computed<ConstrBind<PropsExtra>>(() => ({
|
|
123
|
+
...this.binds.value,
|
|
124
|
+
isValue: this.value.is.value,
|
|
125
|
+
value: this.value.item.value,
|
|
126
|
+
cancelShow: this.value.boolean.value,
|
|
127
|
+
|
|
128
|
+
counter: this.value.length.value,
|
|
129
|
+
|
|
130
|
+
disabledPrevious: this.arrow?.disabledPrevious.value,
|
|
131
|
+
disabledNext: this.arrow?.disabledNext.value
|
|
132
|
+
}))
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Renders the Field framework.
|
|
136
|
+
*
|
|
137
|
+
* Отрисовывает каркас поля.
|
|
138
|
+
* @param slotsChildren
|
|
139
|
+
* @param attrs
|
|
140
|
+
*/
|
|
141
|
+
readonly render = (
|
|
142
|
+
slotsChildren?: FieldSlots,
|
|
143
|
+
attrs?: Record<string, any>
|
|
144
|
+
): VNode[] => {
|
|
145
|
+
if (this.components) {
|
|
146
|
+
return this.components.render(
|
|
147
|
+
'field',
|
|
148
|
+
toBind(
|
|
149
|
+
this.valueBinds.value,
|
|
150
|
+
attrs ?? {}
|
|
151
|
+
),
|
|
152
|
+
slotsChildren as any as Record<string, any>,
|
|
153
|
+
this.index
|
|
154
|
+
)
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
return []
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Method for listening to events.
|
|
162
|
+
*
|
|
163
|
+
* Метод для прослушивания событий.
|
|
164
|
+
* @param event event object/ объект события
|
|
165
|
+
* @param type type of the object that was clicked/ тип объекта, который был нажат
|
|
166
|
+
*/
|
|
167
|
+
protected readonly on = (
|
|
168
|
+
event: MouseEvent,
|
|
169
|
+
{ type }: EventClickValue
|
|
170
|
+
) => {
|
|
171
|
+
if (
|
|
172
|
+
(event.target as HTMLElement).closest('[data-element="scoreboard"]')
|
|
173
|
+
) {
|
|
174
|
+
switch (type) {
|
|
175
|
+
case 'icon':
|
|
176
|
+
this.onIcon?.()
|
|
177
|
+
eventStopPropagation(event)
|
|
178
|
+
break
|
|
179
|
+
case 'icon-trailing':
|
|
180
|
+
this.onTrailing?.()
|
|
181
|
+
eventStopPropagation(event)
|
|
182
|
+
break
|
|
183
|
+
case 'cancel':
|
|
184
|
+
this.event?.onClear(event)
|
|
185
|
+
eventStopPropagation(event)
|
|
186
|
+
break
|
|
187
|
+
case 'next':
|
|
188
|
+
this.onNext?.()
|
|
189
|
+
this.arrow?.next()
|
|
190
|
+
this.event?.on(event)
|
|
191
|
+
eventStopPropagation(event)
|
|
192
|
+
break
|
|
193
|
+
case 'previous':
|
|
194
|
+
this.onPrevious?.()
|
|
195
|
+
this.arrow?.previous()
|
|
196
|
+
this.event?.on(event)
|
|
197
|
+
eventStopPropagation(event)
|
|
198
|
+
break
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}
|
|
72
202
|
}
|
|
@@ -6,6 +6,7 @@ import type { FieldLabelPropsBasic } from '../FieldLabel'
|
|
|
6
6
|
import type { FieldCounterPropsBasic } from '../FieldCounter'
|
|
7
7
|
import type { ProgressPropsBasic } from '../Progress'
|
|
8
8
|
|
|
9
|
+
import type { AriaList } from '../../types/ariaTypes'
|
|
9
10
|
import type { FieldPropsBasic } from './props'
|
|
10
11
|
import type { FieldSlots } from './types'
|
|
11
12
|
|
|
@@ -29,6 +30,18 @@ export type FieldControl = {
|
|
|
29
30
|
* CSS-классы для скрытого нативного элемента ввода
|
|
30
31
|
*/
|
|
31
32
|
classHidden: string
|
|
33
|
+
/**
|
|
34
|
+
* CSS classes applied when the field is focused/
|
|
35
|
+
* CSS-классы, применяемые при фокусировке на поле
|
|
36
|
+
*/
|
|
37
|
+
classForFocus: string
|
|
38
|
+
|
|
39
|
+
binds:
|
|
40
|
+
AriaList
|
|
41
|
+
& {
|
|
42
|
+
id: string
|
|
43
|
+
className: string
|
|
44
|
+
}
|
|
32
45
|
}
|
|
33
46
|
|
|
34
47
|
/**
|
|
@@ -58,26 +71,27 @@ export interface FieldPropsInclude<
|
|
|
58
71
|
FieldCounter extends FieldCounterPropsBasic = FieldCounterPropsBasic,
|
|
59
72
|
Progress extends ProgressPropsBasic = ProgressPropsBasic
|
|
60
73
|
> extends Omit<
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
74
|
+
FieldPropsBasic<Icon, FieldLabel, FieldMessage, FieldCounter, Progress>,
|
|
75
|
+
// Status
|
|
76
|
+
'disabledPrevious'
|
|
77
|
+
| 'disabledNext'
|
|
65
78
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
79
|
+
// Value
|
|
80
|
+
| 'to'
|
|
81
|
+
| 'value'
|
|
82
|
+
| 'maxlength'
|
|
70
83
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
84
|
+
// Style
|
|
85
|
+
| 'cancelShow'
|
|
86
|
+
| 'counter'
|
|
87
|
+
| 'counterTemplate'
|
|
88
|
+
| 'counterTop'
|
|
89
|
+
| 'iconArrowLeft'
|
|
90
|
+
| 'iconArrowRight'
|
|
91
|
+
| 'iconPlus'
|
|
92
|
+
| 'iconMinus'
|
|
93
|
+
| 'iconClose'
|
|
94
|
+
> {
|
|
81
95
|
// Status
|
|
82
96
|
focus?: boolean
|
|
83
97
|
selected?: boolean
|
|
@@ -85,6 +99,8 @@ export interface FieldPropsInclude<
|
|
|
85
99
|
disabled?: boolean
|
|
86
100
|
|
|
87
101
|
// Style
|
|
88
|
-
|
|
102
|
+
align?: 'center' | 'right' | 'left'
|
|
103
|
+
|
|
104
|
+
cancel?: 'auto' | 'always' | 'none'
|
|
89
105
|
fieldAttrs?: ConstrBind<Field>
|
|
90
106
|
}
|