@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
|
@@ -36,6 +36,9 @@ export class FieldMessageInclude<
|
|
|
36
36
|
* @param components object for working with components/ объект для работы с компонентами
|
|
37
37
|
* @param validationMessage error line/ строка ошибки
|
|
38
38
|
* @param isCounter whether to display the counter/ отображать ли счетчик
|
|
39
|
+
* @param helperId helper message identifier/ идентификатор сообщения помощника
|
|
40
|
+
* @param validationId validation message identifier/ идентификатор сообщения проверки
|
|
41
|
+
* @param counterId counter identifier/ идентификатор счетчика
|
|
39
42
|
* @param extra additional parameter or property name/ дополнительный параметр или имя свойства
|
|
40
43
|
* @param index index identifier/ идентификатор индекса
|
|
41
44
|
*/
|
|
@@ -45,6 +48,9 @@ export class FieldMessageInclude<
|
|
|
45
48
|
protected readonly components?: DesignComponents<FieldMessageComponentInclude, Props>,
|
|
46
49
|
protected readonly validationMessage?: RefOrNormal<string>,
|
|
47
50
|
protected readonly isCounter?: RefType<boolean | undefined>,
|
|
51
|
+
protected readonly helperId?: RefOrNormal<string>,
|
|
52
|
+
protected readonly validationId?: RefOrNormal<string>,
|
|
53
|
+
protected readonly counterId?: RefOrNormal<string>,
|
|
48
54
|
protected readonly extra?: RefOrNormal<PropsExtra>,
|
|
49
55
|
protected readonly index?: string
|
|
50
56
|
) {
|
|
@@ -74,7 +80,11 @@ export class FieldMessageInclude<
|
|
|
74
80
|
disabled: this.props.disabled,
|
|
75
81
|
forceShow: this.props.forceShowMessage,
|
|
76
82
|
helperMessage: this.props.helperMessage,
|
|
77
|
-
validationMessage: this.validation.value
|
|
83
|
+
validationMessage: this.validation.value,
|
|
84
|
+
|
|
85
|
+
helperId: this.props.helperId ?? this.helperId,
|
|
86
|
+
validationId: this.props.validationId ?? this.validationId,
|
|
87
|
+
counterId: this.props.counterId ?? this.counterId
|
|
78
88
|
},
|
|
79
89
|
this.props.fieldMessageAttrs
|
|
80
90
|
)
|
|
@@ -1,7 +1,19 @@
|
|
|
1
1
|
import type { ConstrBind } from '@dxtmisha/functional'
|
|
2
2
|
|
|
3
3
|
import type { FieldMessagePropsBasic } from './props'
|
|
4
|
-
import type {
|
|
4
|
+
import type {
|
|
5
|
+
FieldCounterPropsBasic,
|
|
6
|
+
FieldCounterPropsInclude
|
|
7
|
+
} from '../FieldCounter'
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Type describing available slots/ Тип, описывающий доступные слоты
|
|
11
|
+
*/
|
|
12
|
+
export type FieldMessageSlot = {
|
|
13
|
+
message?: string
|
|
14
|
+
helperMessage?: string
|
|
15
|
+
validationMessage?: string
|
|
16
|
+
}
|
|
5
17
|
|
|
6
18
|
/**
|
|
7
19
|
* Interface for describing which components need to be connected for FieldMessage work/
|
|
@@ -24,4 +36,6 @@ export interface FieldMessagePropsInclude<
|
|
|
24
36
|
helperMessage?: string
|
|
25
37
|
validationMessage?: string
|
|
26
38
|
fieldMessageAttrs?: ConstrBind<FieldMessage>
|
|
39
|
+
helperId?: string
|
|
40
|
+
validationId?: string
|
|
27
41
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
{
|
|
2
|
-
"padding": {
|
|
3
|
-
"_type": "var"
|
|
4
|
-
},
|
|
5
|
-
"#info": {},
|
|
6
|
-
"
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"padding": {
|
|
3
|
+
"_type": "var"
|
|
4
|
+
},
|
|
5
|
+
"#info": {},
|
|
6
|
+
"#error": {},
|
|
7
|
+
"~validation": {
|
|
8
|
+
"_prop": false
|
|
9
|
+
}
|
|
10
|
+
}
|
|
@@ -6,8 +6,23 @@
|
|
|
6
6
|
|
|
7
7
|
@include ui.paddingX(ui.v('??-padding', 0));
|
|
8
8
|
|
|
9
|
-
&__info
|
|
9
|
+
&__info,
|
|
10
|
+
&__error {
|
|
10
11
|
flex-grow: 1;
|
|
11
12
|
flex-shrink: 1;
|
|
12
13
|
}
|
|
14
|
+
|
|
15
|
+
&__error {
|
|
16
|
+
display: none;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
&--validation {
|
|
20
|
+
@include ui.subclass('info') {
|
|
21
|
+
display: none;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
@include ui.subclass('error') {
|
|
25
|
+
display: unset;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
13
28
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ConstrClass } from '@dxtmisha/functional'
|
|
2
2
|
import type { FieldCounterComponentInclude } from '../FieldCounter'
|
|
3
|
+
import type { FieldMessageSlot } from './basicTypes'
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* Interface for describing which components need to be connected for work.
|
|
@@ -30,10 +31,10 @@ export interface FieldMessageExpose {
|
|
|
30
31
|
*/
|
|
31
32
|
export interface FieldMessageSlots {
|
|
32
33
|
/** Slot for helper message/ Слот для вспомогательного сообщения */
|
|
33
|
-
helper?(props:
|
|
34
|
+
helper?(props: FieldMessageSlot): any
|
|
34
35
|
|
|
35
36
|
/** Slot for validation message/Слот для сообщения об ошибке */
|
|
36
|
-
validation?(props:
|
|
37
|
+
validation?(props: FieldMessageSlot): any
|
|
37
38
|
}
|
|
38
39
|
|
|
39
40
|
/**
|
|
@@ -45,5 +46,6 @@ export type FieldMessageClasses = {
|
|
|
45
46
|
main: ConstrClass
|
|
46
47
|
// :classes [!] System label / Системная метка
|
|
47
48
|
info: string
|
|
49
|
+
error: string
|
|
48
50
|
// :classes [!] System label / Системная метка
|
|
49
51
|
}
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
getBindRef
|
|
7
7
|
} from '@dxtmisha/functional'
|
|
8
8
|
|
|
9
|
+
import { AriaStaticInclude } from '../../classes/AriaStaticInclude'
|
|
9
10
|
import { type ImageEventData } from '../Image'
|
|
10
11
|
import { SkeletonInclude } from '../Skeleton'
|
|
11
12
|
|
|
@@ -44,6 +45,7 @@ export class Icon {
|
|
|
44
45
|
* @param components object for working with components/ объект для работы с компонентами
|
|
45
46
|
* @param slots object for working with slots/ объект для работы со слотами
|
|
46
47
|
* @param emits the function is called when an event is triggered/ функция вызывается, когда срабатывает событие
|
|
48
|
+
* @param SkeletonIncludeConstructor class for working with Skeleton/ класс для работы с Skeleton
|
|
47
49
|
*/
|
|
48
50
|
constructor(
|
|
49
51
|
protected readonly props: IconProps,
|
|
@@ -53,11 +55,13 @@ export class Icon {
|
|
|
53
55
|
protected readonly className: string,
|
|
54
56
|
protected readonly components?: DesignComp<IconComponents, IconProps>,
|
|
55
57
|
protected readonly slots?: IconSlots,
|
|
56
|
-
protected readonly emits?: ConstrEmit<IconEmits
|
|
58
|
+
protected readonly emits?: ConstrEmit<IconEmits>,
|
|
59
|
+
protected readonly SkeletonIncludeConstructor: typeof SkeletonInclude = SkeletonInclude
|
|
57
60
|
) {
|
|
58
61
|
this.iconBind = getBindRef(
|
|
59
62
|
refs.icon,
|
|
60
63
|
computed(() => ({
|
|
64
|
+
key: 'mainIcon',
|
|
61
65
|
class: `${className}__icon`,
|
|
62
66
|
turn: this.props.turn,
|
|
63
67
|
disabled: this.props.disabled,
|
|
@@ -69,6 +73,7 @@ export class Icon {
|
|
|
69
73
|
this.iconActiveBind = getBindRef(
|
|
70
74
|
refs.iconActive,
|
|
71
75
|
computed(() => ({
|
|
76
|
+
key: 'activeIcon',
|
|
72
77
|
class: `${className}__iconActive`,
|
|
73
78
|
turn: this.props.turn,
|
|
74
79
|
disabled: this.props.disabled,
|
|
@@ -76,7 +81,7 @@ export class Icon {
|
|
|
76
81
|
}))
|
|
77
82
|
)
|
|
78
83
|
|
|
79
|
-
this.skeleton = new
|
|
84
|
+
this.skeleton = new SkeletonIncludeConstructor(
|
|
80
85
|
props,
|
|
81
86
|
classDesign,
|
|
82
87
|
['classBackgroundVariant']
|
|
@@ -95,6 +100,36 @@ export class Icon {
|
|
|
95
100
|
...this.skeleton.classes.value
|
|
96
101
|
}))
|
|
97
102
|
|
|
103
|
+
/**
|
|
104
|
+
* Computed bindings for the icon element.
|
|
105
|
+
*
|
|
106
|
+
* Вычисляемые привязки для элемента иконки.
|
|
107
|
+
*/
|
|
108
|
+
readonly binds = computed<any>(() => ({
|
|
109
|
+
key: 'icon',
|
|
110
|
+
tabindex: this.props.dynamic ? 0 : undefined,
|
|
111
|
+
...AriaStaticInclude.role(this.getRole()),
|
|
112
|
+
...AriaStaticInclude.label(this.props.ariaLabel),
|
|
113
|
+
...AriaStaticInclude.hidden(!this.props.dynamic)
|
|
114
|
+
}))
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Get the ARIA role for the icon element.
|
|
118
|
+
*
|
|
119
|
+
* Получить ARIA роль для элемента иконки.
|
|
120
|
+
*/
|
|
121
|
+
protected getRole(): string | undefined {
|
|
122
|
+
if (this.props.role) {
|
|
123
|
+
return this.props.role
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
if (this.props.dynamic) {
|
|
127
|
+
return 'button'
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
return undefined
|
|
131
|
+
}
|
|
132
|
+
|
|
98
133
|
/**
|
|
99
134
|
* Triggers an event when the image loading is complete.
|
|
100
135
|
*
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { h, type VNode } from 'vue'
|
|
1
|
+
import { computed, h, type VNode } from 'vue'
|
|
2
2
|
import {
|
|
3
3
|
type ConstrOptions,
|
|
4
4
|
type ConstrStyles,
|
|
@@ -42,11 +42,13 @@ export class IconDesign<
|
|
|
42
42
|
* @param name class name/ название класса
|
|
43
43
|
* @param props properties/ свойства
|
|
44
44
|
* @param options list of additional parameters/ список дополнительных параметров
|
|
45
|
+
* @param ItemConstructor icon item class/ класс элемента иконки
|
|
45
46
|
*/
|
|
46
47
|
constructor(
|
|
47
48
|
name: string,
|
|
48
49
|
props: Readonly<P>,
|
|
49
|
-
options?: ConstrOptions<COMP, IconEmits, P
|
|
50
|
+
options?: ConstrOptions<COMP, IconEmits, P>,
|
|
51
|
+
ItemConstructor: typeof Icon = Icon
|
|
50
52
|
) {
|
|
51
53
|
super(
|
|
52
54
|
name,
|
|
@@ -54,7 +56,7 @@ export class IconDesign<
|
|
|
54
56
|
options
|
|
55
57
|
)
|
|
56
58
|
|
|
57
|
-
this.item = new
|
|
59
|
+
this.item = new ItemConstructor(
|
|
58
60
|
this.props,
|
|
59
61
|
this.refs,
|
|
60
62
|
this.element,
|
|
@@ -68,34 +70,6 @@ export class IconDesign<
|
|
|
68
70
|
this.init()
|
|
69
71
|
}
|
|
70
72
|
|
|
71
|
-
/**
|
|
72
|
-
* Render the main icon.
|
|
73
|
-
*
|
|
74
|
-
* Рендер основной иконки.
|
|
75
|
-
*/
|
|
76
|
-
readonly renderIcon = (): VNode | undefined => {
|
|
77
|
-
return this.components.renderOne(
|
|
78
|
-
'image',
|
|
79
|
-
this.item.iconBind.value,
|
|
80
|
-
undefined,
|
|
81
|
-
'icon'
|
|
82
|
-
)
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
/**
|
|
86
|
-
* Render the secondary icon.
|
|
87
|
-
*
|
|
88
|
-
* Рендер вторичной иконки.
|
|
89
|
-
*/
|
|
90
|
-
readonly renderIconActive = (): VNode | undefined => {
|
|
91
|
-
return this.components.renderOne(
|
|
92
|
-
'image',
|
|
93
|
-
this.item.iconActiveBind.value,
|
|
94
|
-
undefined,
|
|
95
|
-
'iconActive'
|
|
96
|
-
)
|
|
97
|
-
}
|
|
98
|
-
|
|
99
73
|
/**
|
|
100
74
|
* Initialization of all the necessary properties for work<br>
|
|
101
75
|
* Инициализация всех необходимых свойств для работы.
|
|
@@ -129,7 +103,8 @@ export class IconDesign<
|
|
|
129
103
|
}
|
|
130
104
|
|
|
131
105
|
/**
|
|
132
|
-
* A method for rendering
|
|
106
|
+
* A method for rendering.
|
|
107
|
+
*
|
|
133
108
|
* Метод для рендеринга.
|
|
134
109
|
*/
|
|
135
110
|
protected initRender(): VNode {
|
|
@@ -145,13 +120,45 @@ export class IconDesign<
|
|
|
145
120
|
children.push(this.renderIconActive())
|
|
146
121
|
}
|
|
147
122
|
|
|
148
|
-
return h(
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
123
|
+
return h('span', this.propsMain.value, children)
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Computed properties for the main element.
|
|
128
|
+
*
|
|
129
|
+
* Вычисляемые свойства для главного элемента.
|
|
130
|
+
*/
|
|
131
|
+
readonly propsMain = computed<any>(() => ({
|
|
132
|
+
...this.getAttrs(),
|
|
133
|
+
...this.item.binds.value,
|
|
134
|
+
class: this.classes?.value.main
|
|
135
|
+
}))
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Render the main icon.
|
|
139
|
+
*
|
|
140
|
+
* Рендер основной иконки.
|
|
141
|
+
*/
|
|
142
|
+
readonly renderIcon = (): VNode | undefined => {
|
|
143
|
+
return this.components.renderOne(
|
|
144
|
+
'image',
|
|
145
|
+
this.item.iconBind.value,
|
|
146
|
+
undefined,
|
|
147
|
+
'icon'
|
|
148
|
+
)
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Render the secondary icon.
|
|
153
|
+
*
|
|
154
|
+
* Рендер вторичной иконки.
|
|
155
|
+
*/
|
|
156
|
+
readonly renderIconActive = (): VNode | undefined => {
|
|
157
|
+
return this.components.renderOne(
|
|
158
|
+
'image',
|
|
159
|
+
this.item.iconActiveBind.value,
|
|
160
|
+
undefined,
|
|
161
|
+
'iconActive'
|
|
155
162
|
)
|
|
156
163
|
}
|
|
157
164
|
}
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
{
|
|
2
|
-
"width": {
|
|
3
|
-
"_type": "var"
|
|
4
|
-
},
|
|
5
|
-
"~turn": {},
|
|
6
|
-
"~disabled": {},
|
|
7
|
-
"~hide": {},
|
|
8
|
-
"~asPalette": {},
|
|
9
|
-
"~dir": {},
|
|
10
|
-
"~overlay": {},
|
|
11
|
-
"~dynamic": {},
|
|
12
|
-
"~start": {
|
|
13
|
-
"_category": "order"
|
|
14
|
-
},
|
|
15
|
-
"~end": {
|
|
16
|
-
"_category": "order"
|
|
17
|
-
},
|
|
18
|
-
"~high": {},
|
|
19
|
-
"~animation-type": {
|
|
20
|
-
"~type1": {},
|
|
21
|
-
"~type2": {},
|
|
22
|
-
"_default": "type1"
|
|
23
|
-
},
|
|
24
|
-
"~animation-show": {}
|
|
25
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"width": {
|
|
3
|
+
"_type": "var"
|
|
4
|
+
},
|
|
5
|
+
"~turn": {},
|
|
6
|
+
"~disabled": {},
|
|
7
|
+
"~hide": {},
|
|
8
|
+
"~asPalette": {},
|
|
9
|
+
"~dir": {},
|
|
10
|
+
"~overlay": {},
|
|
11
|
+
"~dynamic": {},
|
|
12
|
+
"~start": {
|
|
13
|
+
"_category": "order"
|
|
14
|
+
},
|
|
15
|
+
"~end": {
|
|
16
|
+
"_category": "order"
|
|
17
|
+
},
|
|
18
|
+
"~high": {},
|
|
19
|
+
"~animation-type": {
|
|
20
|
+
"~type1": {},
|
|
21
|
+
"~type2": {},
|
|
22
|
+
"_default": "type1"
|
|
23
|
+
},
|
|
24
|
+
"~animation-show": {}
|
|
25
|
+
}
|
|
@@ -1,26 +1,29 @@
|
|
|
1
|
+
import type { RoleType } from '../../types/roleTypes'
|
|
1
2
|
import type { ImagePropsBasic, ImageValue } from '../Image'
|
|
2
3
|
import type { SkeletonPropsInclude } from '../Skeleton'
|
|
4
|
+
import type { AriaLabelPropsInclude } from '../../types/ariaTypes.ts'
|
|
3
5
|
|
|
4
6
|
interface IconPropsToken {
|
|
5
|
-
// :type [!] System label / Системная метка
|
|
6
|
-
turn?: boolean
|
|
7
|
-
disabled?: boolean
|
|
8
|
-
hide?: boolean
|
|
9
|
-
asPalette?: boolean
|
|
10
|
-
dir?: boolean
|
|
11
|
-
overlay?: boolean
|
|
12
|
-
dynamic?: boolean
|
|
13
|
-
start?: boolean
|
|
14
|
-
end?: boolean
|
|
15
|
-
high?: boolean
|
|
16
|
-
animationType?: 'type1' | 'type2'
|
|
17
|
-
animationShow?: boolean
|
|
7
|
+
// :type [!] System label / Системная метка
|
|
8
|
+
turn?: boolean
|
|
9
|
+
disabled?: boolean
|
|
10
|
+
hide?: boolean
|
|
11
|
+
asPalette?: boolean
|
|
12
|
+
dir?: boolean
|
|
13
|
+
overlay?: boolean
|
|
14
|
+
dynamic?: boolean
|
|
15
|
+
start?: boolean
|
|
16
|
+
end?: boolean
|
|
17
|
+
high?: boolean
|
|
18
|
+
animationType?: 'type1' | 'type2'
|
|
19
|
+
animationShow?: boolean
|
|
18
20
|
// :type [!] System label / Системная метка
|
|
19
21
|
}
|
|
20
22
|
|
|
21
23
|
export interface IconPropsBasic<
|
|
22
24
|
Image extends ImagePropsBasic = ImagePropsBasic
|
|
23
|
-
> extends SkeletonPropsInclude
|
|
25
|
+
> extends SkeletonPropsInclude,
|
|
26
|
+
AriaLabelPropsInclude {
|
|
24
27
|
// Status
|
|
25
28
|
/** Активное состояние иконки/ Active state of the icon */
|
|
26
29
|
active?: boolean
|
|
@@ -30,6 +33,9 @@ export interface IconPropsBasic<
|
|
|
30
33
|
icon?: ImageValue<Image>
|
|
31
34
|
/** Value of the active icon/ Значение активной иконки */
|
|
32
35
|
iconActive?: ImageValue<Image>
|
|
36
|
+
|
|
37
|
+
// ARIA
|
|
38
|
+
role?: RoleType
|
|
33
39
|
}
|
|
34
40
|
|
|
35
41
|
/**
|
|
@@ -47,8 +53,8 @@ export interface IconProps extends IconPropsBasic, IconPropsToken {
|
|
|
47
53
|
*/
|
|
48
54
|
export const defaultsIcon = {
|
|
49
55
|
...{
|
|
50
|
-
// :default [!] System label / Системная метка
|
|
51
|
-
animationType: 'type1'
|
|
56
|
+
// :default [!] System label / Системная метка
|
|
57
|
+
animationType: 'type1'
|
|
52
58
|
// :default [!] System label / Системная метка
|
|
53
59
|
}
|
|
54
60
|
}
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { computed, onUnmounted, type Ref, watch } from 'vue'
|
|
2
2
|
import {
|
|
3
|
+
type ConstrBind,
|
|
3
4
|
type ConstrClassObject,
|
|
4
5
|
type ConstrEmit,
|
|
5
6
|
type ConstrStyles,
|
|
6
7
|
isString
|
|
7
8
|
} from '@dxtmisha/functional'
|
|
8
9
|
|
|
10
|
+
import { AriaStaticInclude } from '../../classes/AriaStaticInclude'
|
|
11
|
+
|
|
9
12
|
import { ImageType } from './ImageType'
|
|
10
13
|
import { ImageData } from './ImageData'
|
|
11
14
|
|
|
@@ -13,6 +16,7 @@ import { ImageCoordinator } from './ImageCoordinator'
|
|
|
13
16
|
import { ImagePosition } from './ImagePosition'
|
|
14
17
|
import { ImageAdaptiveItem } from './ImageAdaptiveItem'
|
|
15
18
|
import { ImageBackground } from './ImageBackground'
|
|
19
|
+
import { ImageImg } from './ImageImg'
|
|
16
20
|
|
|
17
21
|
import { ImageTypeValue } from './basicTypes'
|
|
18
22
|
import type { ImageEmits } from './types'
|
|
@@ -32,38 +36,62 @@ export class Image {
|
|
|
32
36
|
readonly adaptiveItem: ImageAdaptiveItem
|
|
33
37
|
readonly background: ImageBackground
|
|
34
38
|
|
|
39
|
+
readonly img: ImageImg
|
|
40
|
+
|
|
35
41
|
/**
|
|
36
42
|
* Constructor
|
|
37
43
|
* @param props input data/ входные данные
|
|
38
44
|
* @param element input element/ элемент ввода
|
|
39
45
|
* @param className class name/ название класса
|
|
40
46
|
* @param emits the function is called when an event is triggered/ функция вызывается, когда срабатывает событие
|
|
47
|
+
* @param ImageTypeConstructor class for working with image type/ класс для работы с типом изображения
|
|
48
|
+
* @param ImageDataConstructor class for working with image data/ класс для работы с данными изображения
|
|
49
|
+
* @param ImageCoordinatorConstructor class for working with image coordinates/ класс для работы с координатами изображения
|
|
50
|
+
* @param ImagePositionConstructor class for working with image position/ класс для работы с позицией изображения
|
|
51
|
+
* @param ImageAdaptiveItemConstructor class for working with adaptive image item/ класс для работы с адаптивным элементом изображения
|
|
52
|
+
* @param ImageBackgroundConstructor class for working with image background/ класс для работы с фоном изображения
|
|
53
|
+
* @param ImageImgConstructor class for working with image tag/ класс для работы с тегом изображения
|
|
41
54
|
*/
|
|
42
55
|
constructor(
|
|
43
56
|
protected readonly props: ImageProps,
|
|
44
57
|
protected readonly element: Ref<HTMLElement | undefined>,
|
|
45
58
|
protected readonly className: string,
|
|
46
|
-
protected readonly emits?: ConstrEmit<ImageEmits
|
|
59
|
+
protected readonly emits?: ConstrEmit<ImageEmits>,
|
|
60
|
+
protected readonly ImageTypeConstructor: typeof ImageType = ImageType,
|
|
61
|
+
protected readonly ImageDataConstructor: typeof ImageData = ImageData,
|
|
62
|
+
protected readonly ImageCoordinatorConstructor: typeof ImageCoordinator = ImageCoordinator,
|
|
63
|
+
protected readonly ImagePositionConstructor: typeof ImagePosition = ImagePosition,
|
|
64
|
+
protected readonly ImageAdaptiveItemConstructor: typeof ImageAdaptiveItem = ImageAdaptiveItem,
|
|
65
|
+
protected readonly ImageBackgroundConstructor: typeof ImageBackground = ImageBackground,
|
|
66
|
+
protected readonly ImageImgConstructor: typeof ImageImg = ImageImg
|
|
47
67
|
) {
|
|
48
|
-
this.type = new
|
|
49
|
-
this.data = new
|
|
68
|
+
this.type = new ImageTypeConstructor(props)
|
|
69
|
+
this.data = new ImageDataConstructor(props, this.type)
|
|
50
70
|
|
|
51
|
-
this.coordinator = new
|
|
52
|
-
this.position = new
|
|
71
|
+
this.coordinator = new ImageCoordinatorConstructor(props)
|
|
72
|
+
this.position = new ImagePositionConstructor(props, this.coordinator)
|
|
53
73
|
|
|
54
|
-
this.adaptiveItem = new
|
|
74
|
+
this.adaptiveItem = new ImageAdaptiveItemConstructor(
|
|
55
75
|
props,
|
|
56
76
|
this.data,
|
|
57
77
|
element
|
|
58
78
|
)
|
|
59
79
|
|
|
60
|
-
this.background = new
|
|
80
|
+
this.background = new ImageBackgroundConstructor(
|
|
61
81
|
props,
|
|
62
82
|
this.data,
|
|
63
83
|
this.coordinator,
|
|
64
84
|
this.adaptiveItem
|
|
65
85
|
)
|
|
66
86
|
|
|
87
|
+
this.img = new ImageImgConstructor(
|
|
88
|
+
this.props,
|
|
89
|
+
element,
|
|
90
|
+
this.type,
|
|
91
|
+
this.position,
|
|
92
|
+
this.background
|
|
93
|
+
)
|
|
94
|
+
|
|
67
95
|
if (emits) {
|
|
68
96
|
watch(this.data.image, (image) => {
|
|
69
97
|
emits('load', {
|
|
@@ -76,6 +104,11 @@ export class Image {
|
|
|
76
104
|
onUnmounted(() => this.adaptiveItem.remove())
|
|
77
105
|
}
|
|
78
106
|
|
|
107
|
+
/**
|
|
108
|
+
* Determines the tag to use/ Определяет используемый тег
|
|
109
|
+
*/
|
|
110
|
+
readonly tag = computed<string>(() => this.img.is.value ? 'img' : 'span')
|
|
111
|
+
|
|
79
112
|
/**
|
|
80
113
|
* Values for the text. Text is used for the type of icon that works as a background.
|
|
81
114
|
*
|
|
@@ -125,6 +158,10 @@ export class Image {
|
|
|
125
158
|
notranslate: true
|
|
126
159
|
}
|
|
127
160
|
|
|
161
|
+
if (this.img.is.value) {
|
|
162
|
+
data[`${this.className}--img`] = true
|
|
163
|
+
}
|
|
164
|
+
|
|
128
165
|
switch (type) {
|
|
129
166
|
case 'outlined':
|
|
130
167
|
data['material-symbols-outlined'] = true
|
|
@@ -144,9 +181,8 @@ export class Image {
|
|
|
144
181
|
})
|
|
145
182
|
|
|
146
183
|
/**
|
|
147
|
-
* Calculates all properties for the style of the element
|
|
148
|
-
*
|
|
149
|
-
* Вычисляет все свойства для стиля элемента.
|
|
184
|
+
* Calculates all properties for the style of the element/
|
|
185
|
+
* Вычисляет все свойства для стиля элемента
|
|
150
186
|
*/
|
|
151
187
|
readonly styles = computed<ConstrStyles>(() => {
|
|
152
188
|
const value = this.props.value
|
|
@@ -181,4 +217,26 @@ export class Image {
|
|
|
181
217
|
|
|
182
218
|
return {} as ConstrStyles
|
|
183
219
|
})
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* Computed bindings for the image element.
|
|
223
|
+
*
|
|
224
|
+
* Вычисляемые привязки для элемента изображения.
|
|
225
|
+
*/
|
|
226
|
+
readonly binds = computed(() => ({
|
|
227
|
+
translate: 'no',
|
|
228
|
+
...AriaStaticInclude.role('img'),
|
|
229
|
+
...AriaStaticInclude.label(this.props.alt),
|
|
230
|
+
...AriaStaticInclude.hidden()
|
|
231
|
+
}))
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* Bindings for the image value.
|
|
235
|
+
*
|
|
236
|
+
* Привязки для значения изображения.
|
|
237
|
+
*/
|
|
238
|
+
readonly valueBinds = computed<ConstrBind<any>>(() => ({
|
|
239
|
+
key: 'value',
|
|
240
|
+
data: this.data.image.value
|
|
241
|
+
}))
|
|
184
242
|
}
|
|
@@ -34,13 +34,26 @@ export class ImageBackground {
|
|
|
34
34
|
* Возвращает значения для свойства background-image.
|
|
35
35
|
*/
|
|
36
36
|
readonly image = computed<string | null>(() => {
|
|
37
|
+
const image = this.imageSrc.value
|
|
38
|
+
|
|
39
|
+
if (image) {
|
|
40
|
+
return `url("${image}")`
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return null
|
|
44
|
+
})
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Returns the image source/ Возвращает источник изображения
|
|
48
|
+
*/
|
|
49
|
+
readonly imageSrc = computed<string | null>(() => {
|
|
37
50
|
const image = this.data.image.value
|
|
38
51
|
|
|
39
52
|
switch (typeof image) {
|
|
40
53
|
case 'string':
|
|
41
|
-
return
|
|
54
|
+
return image
|
|
42
55
|
case 'object':
|
|
43
|
-
return
|
|
56
|
+
return image.src
|
|
44
57
|
default:
|
|
45
58
|
return null
|
|
46
59
|
}
|
|
@@ -95,10 +95,12 @@ export class ImageCoordinator {
|
|
|
95
95
|
*/
|
|
96
96
|
getSize(): ImageSize<string> {
|
|
97
97
|
const item = this.size.value
|
|
98
|
+
const width = item.width === 0 ? 100 : item.width
|
|
99
|
+
const height = item.height === 0 ? 100 : item.height
|
|
98
100
|
|
|
99
101
|
return {
|
|
100
|
-
width: `${100 /
|
|
101
|
-
height: `${100 /
|
|
102
|
+
width: `${100 / width * 100}%`,
|
|
103
|
+
height: `${100 / height * 100}%`
|
|
102
104
|
}
|
|
103
105
|
}
|
|
104
106
|
}
|