@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
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxtmisha/constructor",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.30.1",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Vue component constructors for DXT UI design system - ready-to-use constructors with TypeScript support and SCSS styling",
|
|
7
7
|
"keywords": [
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"build": "vue-tsc -b && vite build",
|
|
37
37
|
"preview": "vite preview",
|
|
38
38
|
"dxt-library": "dxt-library",
|
|
39
|
-
"dxt-constructor": "dxt-constructor
|
|
39
|
+
"dxt-constructor": "dxt-constructor tooltip"
|
|
40
40
|
},
|
|
41
41
|
"files": [
|
|
42
42
|
"src/",
|
|
@@ -49,16 +49,30 @@
|
|
|
49
49
|
"types": "./src/library.ts",
|
|
50
50
|
"exports": {
|
|
51
51
|
".": "./src/library.ts",
|
|
52
|
+
"./Accordion": "./src/constructors/Accordion/index.ts",
|
|
53
|
+
"./Accordion/style": "./src/constructors/Accordion/style.scss",
|
|
54
|
+
"./ActionSheet": "./src/constructors/ActionSheet/index.ts",
|
|
55
|
+
"./ActionSheet/style": "./src/constructors/ActionSheet/style.scss",
|
|
56
|
+
"./Actions": "./src/constructors/Actions/index.ts",
|
|
57
|
+
"./Actions/style": "./src/constructors/Actions/style.scss",
|
|
58
|
+
"./Anchor": "./src/constructors/Anchor/index.ts",
|
|
59
|
+
"./Anchor/style": "./src/constructors/Anchor/style.scss",
|
|
52
60
|
"./Badge": "./src/constructors/Badge/index.ts",
|
|
53
61
|
"./Badge/style": "./src/constructors/Badge/style.scss",
|
|
54
62
|
"./Bars": "./src/constructors/Bars/index.ts",
|
|
55
63
|
"./Bars/style": "./src/constructors/Bars/style.scss",
|
|
64
|
+
"./Block": "./src/constructors/Block/index.ts",
|
|
65
|
+
"./Block/style": "./src/constructors/Block/style.scss",
|
|
56
66
|
"./Button": "./src/constructors/Button/index.ts",
|
|
57
67
|
"./Button/style": "./src/constructors/Button/style.scss",
|
|
58
68
|
"./Cell": "./src/constructors/Cell/index.ts",
|
|
59
69
|
"./Cell/style": "./src/constructors/Cell/style.scss",
|
|
60
70
|
"./Chip": "./src/constructors/Chip/index.ts",
|
|
61
71
|
"./Chip/style": "./src/constructors/Chip/style.scss",
|
|
72
|
+
"./ChipGroup": "./src/constructors/ChipGroup/index.ts",
|
|
73
|
+
"./ChipGroup/style": "./src/constructors/ChipGroup/style.scss",
|
|
74
|
+
"./Dialog": "./src/constructors/Dialog/index.ts",
|
|
75
|
+
"./Dialog/style": "./src/constructors/Dialog/style.scss",
|
|
62
76
|
"./Field": "./src/constructors/Field/index.ts",
|
|
63
77
|
"./Field/style": "./src/constructors/Field/style.scss",
|
|
64
78
|
"./FieldCounter": "./src/constructors/FieldCounter/index.ts",
|
|
@@ -71,6 +85,8 @@
|
|
|
71
85
|
"./Icon/style": "./src/constructors/Icon/style.scss",
|
|
72
86
|
"./Image": "./src/constructors/Image/index.ts",
|
|
73
87
|
"./Image/style": "./src/constructors/Image/style.scss",
|
|
88
|
+
"./Input": "./src/constructors/Input/index.ts",
|
|
89
|
+
"./Input/style": "./src/constructors/Input/style.scss",
|
|
74
90
|
"./List": "./src/constructors/List/index.ts",
|
|
75
91
|
"./List/style": "./src/constructors/List/style.scss",
|
|
76
92
|
"./ListGroup": "./src/constructors/ListGroup/index.ts",
|
|
@@ -83,6 +99,8 @@
|
|
|
83
99
|
"./Mask/style": "./src/constructors/Mask/style.scss",
|
|
84
100
|
"./Menu": "./src/constructors/Menu/index.ts",
|
|
85
101
|
"./Menu/style": "./src/constructors/Menu/style.scss",
|
|
102
|
+
"./Modal": "./src/constructors/Modal/index.ts",
|
|
103
|
+
"./Modal/style": "./src/constructors/Modal/style.scss",
|
|
86
104
|
"./MotionTransform": "./src/constructors/MotionTransform/index.ts",
|
|
87
105
|
"./MotionTransform/style": "./src/constructors/MotionTransform/style.scss",
|
|
88
106
|
"./Motiontransform": "./src/constructors/Motiontransform/index.ts",
|
|
@@ -93,10 +111,22 @@
|
|
|
93
111
|
"./Ripple/style": "./src/constructors/Ripple/style.scss",
|
|
94
112
|
"./Scrollbar": "./src/constructors/Scrollbar/index.ts",
|
|
95
113
|
"./Scrollbar/style": "./src/constructors/Scrollbar/style.scss",
|
|
114
|
+
"./Section": "./src/constructors/Section/index.ts",
|
|
115
|
+
"./Section/style": "./src/constructors/Section/style.scss",
|
|
116
|
+
"./Select": "./src/constructors/Select/index.ts",
|
|
117
|
+
"./Select/style": "./src/constructors/Select/style.scss",
|
|
118
|
+
"./SelectValue": "./src/constructors/SelectValue/index.ts",
|
|
119
|
+
"./SelectValue/style": "./src/constructors/SelectValue/style.scss",
|
|
96
120
|
"./Skeleton": "./src/constructors/Skeleton/index.ts",
|
|
97
121
|
"./Skeleton/style": "./src/constructors/Skeleton/style.scss",
|
|
122
|
+
"./TextareaAutosize": "./src/constructors/TextareaAutosize/index.ts",
|
|
123
|
+
"./TextareaAutosize/style": "./src/constructors/TextareaAutosize/style.scss",
|
|
98
124
|
"./Window": "./src/constructors/Window/index.ts",
|
|
99
|
-
"./Window/style": "./src/constructors/Window/style.scss"
|
|
125
|
+
"./Window/style": "./src/constructors/Window/style.scss",
|
|
126
|
+
"./Arrow": "./src/constructors/Arrow/index.ts",
|
|
127
|
+
"./Arrow/style": "./src/constructors/Arrow/style.scss",
|
|
128
|
+
"./Tooltip": "./src/constructors/Tooltip/index.ts",
|
|
129
|
+
"./Tooltip/style": "./src/constructors/Tooltip/style.scss"
|
|
100
130
|
},
|
|
101
131
|
"buildOptions": {
|
|
102
132
|
"name": "@dxtmisha/constructor",
|
|
@@ -108,8 +138,8 @@
|
|
|
108
138
|
"node": ">=18.0.0"
|
|
109
139
|
},
|
|
110
140
|
"peerDependencies": {
|
|
111
|
-
"@dxtmisha/functional": "
|
|
112
|
-
"vue": "
|
|
141
|
+
"@dxtmisha/functional": "*",
|
|
142
|
+
"vue": "*"
|
|
113
143
|
},
|
|
114
144
|
"peerDependenciesMeta": {
|
|
115
145
|
"@dxtmisha/functional": {
|
|
@@ -121,4 +151,4 @@
|
|
|
121
151
|
},
|
|
122
152
|
"dependencies": {},
|
|
123
153
|
"sideEffects": false
|
|
124
|
-
}
|
|
154
|
+
}
|
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
import type { AriaList, AriaTrueOrFalse } from '../types/ariaTypes'
|
|
2
|
+
import type { RoleType } from '../types/roleTypes'
|
|
3
|
+
import { isString } from '@dxtmisha/functional'
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* The class returns static ARIA attributes.
|
|
7
|
+
*
|
|
8
|
+
* Класс возвращает статические ARIA атрибуты.
|
|
9
|
+
*/
|
|
10
|
+
export class AriaStaticInclude {
|
|
11
|
+
/**
|
|
12
|
+
* Get role by props.
|
|
13
|
+
*
|
|
14
|
+
* Получить роль по пропсам.
|
|
15
|
+
* @param role ARIA role type/ Тип ARIA роли
|
|
16
|
+
*/
|
|
17
|
+
static role(role?: RoleType): AriaList {
|
|
18
|
+
return {
|
|
19
|
+
role
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Get ARIA atomic attribute.
|
|
25
|
+
*
|
|
26
|
+
* Получить атрибут ARIA atomic.
|
|
27
|
+
* @param isAtomic is atomic/ является атомарным
|
|
28
|
+
*/
|
|
29
|
+
static atomic(isAtomic?: boolean): AriaList {
|
|
30
|
+
return {
|
|
31
|
+
'aria-atomic': this.isTrueOrFalse(isAtomic)
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Get ARIA checked attribute.
|
|
37
|
+
*
|
|
38
|
+
* Получить атрибут ARIA checked.
|
|
39
|
+
* @param isChecked is checked/ является отмеченным
|
|
40
|
+
*/
|
|
41
|
+
static checked(isChecked?: boolean): AriaList {
|
|
42
|
+
return {
|
|
43
|
+
'aria-checked': this.isTrueOrFalse(isChecked)
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Get ARIA current attribute.
|
|
49
|
+
*
|
|
50
|
+
* Получить атрибут ARIA current.
|
|
51
|
+
* @param value ARIA current attribute/ Атрибут ARIA current
|
|
52
|
+
*/
|
|
53
|
+
static current(value?: AriaList['aria-current']): AriaList {
|
|
54
|
+
const current = isString(value)
|
|
55
|
+
? value
|
|
56
|
+
: this.isTrueOrFalse(value)
|
|
57
|
+
|
|
58
|
+
return this.isDataToData('aria-current', current)
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Get ARIA busy attribute.
|
|
63
|
+
*
|
|
64
|
+
* Получить атрибут ARIA busy.
|
|
65
|
+
* @param isBusy is busy/ является занятым
|
|
66
|
+
*/
|
|
67
|
+
static busy(isBusy?: boolean): AriaList {
|
|
68
|
+
return {
|
|
69
|
+
'aria-busy': this.isTrueOrFalse(isBusy)
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Get ARIA describedby attribute.
|
|
75
|
+
*
|
|
76
|
+
* Получить атрибут ARIA describedby.
|
|
77
|
+
* @param id Element ID/ Идентификатор элемента
|
|
78
|
+
*/
|
|
79
|
+
static describedby(id?: string): AriaList {
|
|
80
|
+
return this.isDataToData('aria-describedby', id)
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Get ARIA disabled attribute.
|
|
85
|
+
*
|
|
86
|
+
* Получить атрибут ARIA disabled.
|
|
87
|
+
* @param isDisabled is disabled/ является отключенным
|
|
88
|
+
*/
|
|
89
|
+
static disabled(isDisabled: boolean = true): AriaList {
|
|
90
|
+
return {
|
|
91
|
+
'aria-disabled': this.isTrueOrFalse(isDisabled)
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Get ARIA expanded attribute.
|
|
97
|
+
*
|
|
98
|
+
* Получить атрибут ARIA expanded.
|
|
99
|
+
* @param isExpanded is expanded/ является расширенным
|
|
100
|
+
*/
|
|
101
|
+
static expanded(isExpanded?: boolean): AriaList {
|
|
102
|
+
return {
|
|
103
|
+
'aria-expanded': this.isTrueOrFalse(isExpanded)
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Get ARIA haspopup attribute.
|
|
109
|
+
*
|
|
110
|
+
* Получить атрибут ARIA haspopup.
|
|
111
|
+
* @param haspopup ARIA haspopup attribute/ Атрибут ARIA haspopup
|
|
112
|
+
*/
|
|
113
|
+
static haspopup(haspopup?: AriaList['aria-haspopup']): AriaList {
|
|
114
|
+
return this.isDataToData('aria-haspopup', haspopup)
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Get ARIA label.
|
|
119
|
+
*
|
|
120
|
+
* Получить ARIA label.
|
|
121
|
+
* @param label ARIA label/ ARIA метка
|
|
122
|
+
*/
|
|
123
|
+
static label(label?: string): AriaList {
|
|
124
|
+
return this.isDataToData('aria-label', label)
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Get ARIA labelledby attribute.
|
|
129
|
+
*
|
|
130
|
+
* Получить атрибут ARIA labelledby.
|
|
131
|
+
* @param id Element ID/ Идентификатор элемента
|
|
132
|
+
*/
|
|
133
|
+
static labelledby(id?: string): AriaList {
|
|
134
|
+
return this.isDataToData('aria-labelledby', id)
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Get ARIA invalid attribute.
|
|
139
|
+
*
|
|
140
|
+
* Получить атрибут ARIA invalid.
|
|
141
|
+
* @param isInvalid is invalid/ является недействительным
|
|
142
|
+
*/
|
|
143
|
+
static invalid(isInvalid: boolean = true): AriaList {
|
|
144
|
+
return {
|
|
145
|
+
'aria-invalid': this.isTrueOrFalse(isInvalid)
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Get control role.
|
|
151
|
+
*
|
|
152
|
+
* Получить роль управления.
|
|
153
|
+
* @param id Element ID/ Идентификатор элемента
|
|
154
|
+
* @param controls ARIA controls attribute/ Атрибут ARIA controls
|
|
155
|
+
* @param haspopup ARIA haspopup attribute/ Атрибут ARIA haspopup
|
|
156
|
+
* @param expanded ARIA expanded state/ Состояние ARIA expanded
|
|
157
|
+
*/
|
|
158
|
+
static control(
|
|
159
|
+
id?: string,
|
|
160
|
+
controls?: string,
|
|
161
|
+
haspopup?: AriaList['aria-haspopup'],
|
|
162
|
+
expanded?: boolean
|
|
163
|
+
): AriaList {
|
|
164
|
+
return {
|
|
165
|
+
id,
|
|
166
|
+
'aria-controls': controls,
|
|
167
|
+
...this.haspopup(haspopup),
|
|
168
|
+
...this.expanded(expanded)
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* Get ARIA hidden attribute.
|
|
174
|
+
*
|
|
175
|
+
* Получить атрибут ARIA hidden.
|
|
176
|
+
* @param isHidden is hidden/ является скрытым
|
|
177
|
+
*/
|
|
178
|
+
static hidden(
|
|
179
|
+
isHidden: boolean = true
|
|
180
|
+
): AriaList {
|
|
181
|
+
return {
|
|
182
|
+
'aria-hidden': this.isTrueOrFalse(isHidden)
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* Get ARIA live attribute.
|
|
188
|
+
*
|
|
189
|
+
* Получить атрибут ARIA live.
|
|
190
|
+
* @param live ARIA live attribute/ Атрибут ARIA live
|
|
191
|
+
*/
|
|
192
|
+
static live(
|
|
193
|
+
live?: AriaList['aria-live']
|
|
194
|
+
): AriaList {
|
|
195
|
+
return {
|
|
196
|
+
'aria-live': live
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* Get modal role.
|
|
202
|
+
*
|
|
203
|
+
* Получить модальную роль.
|
|
204
|
+
* @param isModal is modal/ является модальным
|
|
205
|
+
* @param ariaLabelledby ARIA labelledby attribute/ Атрибут ARIA labelledby
|
|
206
|
+
* @param ariaDescribedby ARIA describedby attribute/ Атрибут ARIA describedby
|
|
207
|
+
*/
|
|
208
|
+
static modal(
|
|
209
|
+
isModal: boolean = true,
|
|
210
|
+
ariaLabelledby?: string,
|
|
211
|
+
ariaDescribedby?: string
|
|
212
|
+
): AriaList {
|
|
213
|
+
return {
|
|
214
|
+
...this.isDataToData('aria-modal', isModal),
|
|
215
|
+
...this.labelledby(ariaLabelledby),
|
|
216
|
+
...this.describedby(ariaDescribedby)
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* Returns ARIA value now, min and max.
|
|
222
|
+
*
|
|
223
|
+
* Возвращает ARIA value now, min и max.
|
|
224
|
+
* @param value Current value/ Текущее значение
|
|
225
|
+
* @param min Minimum value/ Минимальное значение
|
|
226
|
+
* @param max Maximum value/ Максимальное значение
|
|
227
|
+
*/
|
|
228
|
+
static valueMinMax(
|
|
229
|
+
value?: string | number,
|
|
230
|
+
min?: string | number,
|
|
231
|
+
max?: string | number
|
|
232
|
+
): AriaList {
|
|
233
|
+
return {
|
|
234
|
+
'aria-valuenow': value,
|
|
235
|
+
'aria-valuemin': min,
|
|
236
|
+
'aria-valuemax': max
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
/**
|
|
241
|
+
* Returns 'true' or 'false' based on the boolean value.
|
|
242
|
+
*
|
|
243
|
+
* Возвращает 'true' или 'false' в зависимости от булевого значения.
|
|
244
|
+
* @param value boolean value/ булевое значение
|
|
245
|
+
*/
|
|
246
|
+
static isTrueOrFalse(value?: boolean): AriaTrueOrFalse | undefined {
|
|
247
|
+
return value ? 'true' : 'false'
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
/**
|
|
251
|
+
* Returns data as ARIA attribute.
|
|
252
|
+
*
|
|
253
|
+
* Возвращает данные в виде ARIA атрибута.
|
|
254
|
+
* @param name attribute name/ имя атрибута
|
|
255
|
+
* @param value attribute value/ значение атрибута
|
|
256
|
+
*/
|
|
257
|
+
protected static isDataToData<V>(
|
|
258
|
+
name: string,
|
|
259
|
+
value?: V
|
|
260
|
+
): AriaList {
|
|
261
|
+
if (value) {
|
|
262
|
+
return {
|
|
263
|
+
[name]: value
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
return {}
|
|
268
|
+
}
|
|
269
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { computed, type VNode } from 'vue'
|
|
2
|
-
import { isFilled, render } from '@dxtmisha/functional'
|
|
2
|
+
import { getElementId, isFilled, render } from '@dxtmisha/functional'
|
|
3
3
|
|
|
4
4
|
import { SkeletonInclude } from '../constructors/Skeleton'
|
|
5
5
|
|
|
6
|
-
import type { DescriptionProps, DescriptionSlots } from '../types/descriptionTypes'
|
|
6
|
+
import type { DescriptionExpose, DescriptionProps, DescriptionSlots } from '../types/descriptionTypes'
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Use for adding description text
|
|
@@ -11,6 +11,9 @@ import type { DescriptionProps, DescriptionSlots } from '../types/descriptionTyp
|
|
|
11
11
|
* Использование для добавления описания текста
|
|
12
12
|
*/
|
|
13
13
|
export class DescriptionInclude {
|
|
14
|
+
/** Unique identifier/ Уникальный идентификатор */
|
|
15
|
+
protected id = getElementId()
|
|
16
|
+
|
|
14
17
|
/**
|
|
15
18
|
* Constructor
|
|
16
19
|
* @param props input property/ входное свойство
|
|
@@ -33,6 +36,20 @@ export class DescriptionInclude {
|
|
|
33
36
|
*/
|
|
34
37
|
readonly is = computed(() => Boolean(this.props.description || this.slots?.description))
|
|
35
38
|
|
|
39
|
+
/** Description expose reference/ Ссылка на expose описания */
|
|
40
|
+
readonly expose: DescriptionExpose = {
|
|
41
|
+
descriptionId: this.id
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Get description ID
|
|
46
|
+
*
|
|
47
|
+
* Получить ID описания
|
|
48
|
+
*/
|
|
49
|
+
getId(): string {
|
|
50
|
+
return this.id
|
|
51
|
+
}
|
|
52
|
+
|
|
36
53
|
/**
|
|
37
54
|
* Render the description
|
|
38
55
|
*
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { computed } from 'vue'
|
|
2
|
+
|
|
3
|
+
import { AriaStaticInclude } from './AriaStaticInclude'
|
|
2
4
|
import { ProgressInclude } from '../constructors/Progress'
|
|
3
5
|
|
|
6
|
+
import type { AriaList } from '../types/ariaTypes'
|
|
4
7
|
import type { EnabledProps } from '../types/enabledTypes'
|
|
5
8
|
|
|
6
9
|
/**
|
|
@@ -53,4 +56,12 @@ export class EnabledInclude {
|
|
|
53
56
|
* проверяет, отключён ли элемент или пустое ли значение
|
|
54
57
|
*/
|
|
55
58
|
readonly isDisabledOrUndefined = computed<boolean | undefined>(() => this.isDisabled.value || undefined)
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* list of aria properties for the enabled state/
|
|
62
|
+
* список aria свойств для состояния активности
|
|
63
|
+
*/
|
|
64
|
+
readonly aria = computed<AriaList>(
|
|
65
|
+
() => AriaStaticInclude.disabled(!this.isEnabled.value)
|
|
66
|
+
)
|
|
56
67
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { toRefs, type ToRefs } from 'vue'
|
|
2
|
-
import { type ConstrEmit,
|
|
2
|
+
import { type ConstrEmit, RouterItemRef } from '@dxtmisha/functional'
|
|
3
3
|
|
|
4
4
|
import { EnabledInclude } from './EnabledInclude'
|
|
5
5
|
|
|
@@ -112,7 +112,7 @@ export class EventClickInclude {
|
|
|
112
112
|
*/
|
|
113
113
|
protected toRouter(): boolean {
|
|
114
114
|
if (this.props?.to) {
|
|
115
|
-
|
|
115
|
+
RouterItemRef.push(this.props?.to)
|
|
116
116
|
return true
|
|
117
117
|
}
|
|
118
118
|
|
|
@@ -45,6 +45,41 @@ export class LabelHighlightInclude extends LabelInclude {
|
|
|
45
45
|
)
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
+
/**
|
|
49
|
+
* Determines if highlighting is required.
|
|
50
|
+
*
|
|
51
|
+
* Определяет, требуется ли выделение.
|
|
52
|
+
*/
|
|
53
|
+
isHighlight(): boolean {
|
|
54
|
+
const props = this.props
|
|
55
|
+
|
|
56
|
+
if (
|
|
57
|
+
!props.highlight
|
|
58
|
+
|| props.highlight.length < this.getLengthStart()
|
|
59
|
+
) {
|
|
60
|
+
return true
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
if (!(
|
|
64
|
+
props.highlight
|
|
65
|
+
&& props.highlight.length >= this.getLengthStart()
|
|
66
|
+
&& props.label
|
|
67
|
+
)) {
|
|
68
|
+
return false
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
const label = props.label.toString()
|
|
72
|
+
const exp = getExp(props.highlight, 'i')
|
|
73
|
+
|
|
74
|
+
return Boolean(
|
|
75
|
+
label.match(exp)
|
|
76
|
+
|| (
|
|
77
|
+
isFilled(props.value)
|
|
78
|
+
&& props.value.toString().match(exp)
|
|
79
|
+
)
|
|
80
|
+
)
|
|
81
|
+
}
|
|
82
|
+
|
|
48
83
|
/**
|
|
49
84
|
* Returns a string with highlighted parts.
|
|
50
85
|
* If highlighting is not required, returns the original string.
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { computed, type Ref, type VNode } from 'vue'
|
|
2
|
-
import { type ConstrClass, isFilled, render } from '@dxtmisha/functional'
|
|
2
|
+
import { type ConstrClass, getElementId, getRef, isFilled, type RefOrNormal, render } from '@dxtmisha/functional'
|
|
3
3
|
|
|
4
4
|
import { SkeletonInclude } from '../constructors/Skeleton'
|
|
5
5
|
|
|
6
|
-
import type { LabelAlternativeSlots, LabelProps, LabelSlots } from '../types/labelTypes'
|
|
6
|
+
import type { LabelAlternativeSlots, LabelExpose, LabelProps, LabelSlots } from '../types/labelTypes'
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Use for adding text
|
|
@@ -11,6 +11,9 @@ import type { LabelAlternativeSlots, LabelProps, LabelSlots } from '../types/lab
|
|
|
11
11
|
* Использование для добавления текста
|
|
12
12
|
*/
|
|
13
13
|
export class LabelInclude {
|
|
14
|
+
/** Unique identifier/ Уникальный идентификатор */
|
|
15
|
+
protected id = getElementId()
|
|
16
|
+
|
|
14
17
|
/**
|
|
15
18
|
* Constructor
|
|
16
19
|
* @param props input property/ входное свойство
|
|
@@ -21,6 +24,7 @@ export class LabelInclude {
|
|
|
21
24
|
* @param labelReplacing additional elements/ дополнительные элементы
|
|
22
25
|
* @param alternativeSlots alternative slots/ альтернативные слоты
|
|
23
26
|
* @param skeleton optional skeleton for loading state/ необязательный скелетон для состояния загрузки
|
|
27
|
+
* @param tag tag name/ имя тега
|
|
24
28
|
*/
|
|
25
29
|
constructor(
|
|
26
30
|
protected readonly props: Readonly<LabelProps>,
|
|
@@ -30,7 +34,8 @@ export class LabelInclude {
|
|
|
30
34
|
protected readonly elementsExtra?: () => VNode[],
|
|
31
35
|
protected readonly labelReplacing?: Ref<string | number | undefined>,
|
|
32
36
|
protected readonly alternativeSlots?: boolean,
|
|
33
|
-
protected readonly skeleton?: SkeletonInclude
|
|
37
|
+
protected readonly skeleton?: SkeletonInclude,
|
|
38
|
+
protected readonly tag: RefOrNormal<string> = 'span'
|
|
34
39
|
) {
|
|
35
40
|
}
|
|
36
41
|
|
|
@@ -54,6 +59,33 @@ export class LabelInclude {
|
|
|
54
59
|
return false
|
|
55
60
|
})
|
|
56
61
|
|
|
62
|
+
/** Identifier for the element/ Идентификатор для элемента */
|
|
63
|
+
readonly idElement = computed<string | undefined>(() => {
|
|
64
|
+
if (this.is.value) {
|
|
65
|
+
return this.getId()
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
return undefined
|
|
69
|
+
})
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Expose helpers for Label state and actions.
|
|
73
|
+
*
|
|
74
|
+
* Вспомогательные методы expose для состояния и действий Label.
|
|
75
|
+
*/
|
|
76
|
+
readonly expose: LabelExpose = {
|
|
77
|
+
labelId: this.getId()
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Get the unique identifier.
|
|
82
|
+
*
|
|
83
|
+
* Получение уникального идентификатора.
|
|
84
|
+
*/
|
|
85
|
+
getId(): string {
|
|
86
|
+
return this.props?.labelId || this.id
|
|
87
|
+
}
|
|
88
|
+
|
|
57
89
|
/**
|
|
58
90
|
* Render the label
|
|
59
91
|
*
|
|
@@ -83,8 +115,11 @@ export class LabelInclude {
|
|
|
83
115
|
if (children.length > 0) {
|
|
84
116
|
elements.push(
|
|
85
117
|
render(
|
|
86
|
-
|
|
87
|
-
{
|
|
118
|
+
getRef(this.tag),
|
|
119
|
+
{
|
|
120
|
+
id: this.getId(),
|
|
121
|
+
class: this.getClassName()
|
|
122
|
+
},
|
|
88
123
|
children,
|
|
89
124
|
'label'
|
|
90
125
|
)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { watch } from 'vue'
|
|
1
|
+
import { isReadonly, isRef, type Ref, watch } from 'vue'
|
|
2
2
|
import {
|
|
3
3
|
isFunction,
|
|
4
4
|
type RefType,
|
|
@@ -32,6 +32,55 @@ export class ModelInclude<Value = string> {
|
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
+
/**
|
|
36
|
+
* Type guard to check if syncValue is a mutable Ref.
|
|
37
|
+
* Returns true if syncValue is a reference and not readonly.
|
|
38
|
+
*
|
|
39
|
+
* Проверка типа, является ли syncValue изменяемым Ref.
|
|
40
|
+
* Возвращает true, если syncValue является ссылкой и не readonly.
|
|
41
|
+
* @returns Type predicate indicating syncValue is a mutable Ref/ Предикат типа, указывающий что syncValue - изменяемый Ref
|
|
42
|
+
*/
|
|
43
|
+
isValue(): this is { syncValue: Ref<Value> } {
|
|
44
|
+
return isRef(this.syncValue)
|
|
45
|
+
&& !isReadonly(this.syncValue)
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Generates binding object for v-model integration.
|
|
50
|
+
* Creates properties for two-way data binding with model and update handlers.
|
|
51
|
+
*
|
|
52
|
+
* Генерирует объект привязок для интеграции v-model.
|
|
53
|
+
* Создает свойства для двусторонней привязки данных с обработчиками модели и обновления.
|
|
54
|
+
* @returns Object with model value and update handlers/ Объект со значением модели и обработчиками обновления
|
|
55
|
+
*/
|
|
56
|
+
getBinds() {
|
|
57
|
+
if (this.isValue()) {
|
|
58
|
+
const name = toCamelCaseFirst(this.index)
|
|
59
|
+
|
|
60
|
+
return {
|
|
61
|
+
[`model${name}`]: this.syncValue.value,
|
|
62
|
+
[`onUpdate:${toCamelCase(this.index)}`]: this.update,
|
|
63
|
+
[`onUpdate:model${name}`]: this.update
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
return {}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Updates the synchronized value.
|
|
72
|
+
* Sets the value of the reactive reference if it's a mutable Ref.
|
|
73
|
+
*
|
|
74
|
+
* Обновляет синхронизированное значение.
|
|
75
|
+
* Устанавливает значение реактивной ссылки, если это изменяемый Ref.
|
|
76
|
+
* @param value The new value to set/ Новое значение для установки
|
|
77
|
+
*/
|
|
78
|
+
readonly update = (value: Value): void => {
|
|
79
|
+
if (this.isValue()) {
|
|
80
|
+
this.syncValue.value = value
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
35
84
|
/**
|
|
36
85
|
* Emits an event to update the model value.
|
|
37
86
|
* Triggers the corresponding update event with the new value.
|