@volverjs/ui-vue 0.0.4 → 0.0.5-beta.2
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/README.md +2 -2
- package/auto-imports.d.ts +12 -3
- package/bin/icons.cjs +1 -73
- package/dist/Volver.d.ts +19 -11
- package/dist/components/VvAccordion/VvAccordion.es.js +165 -106
- package/dist/components/VvAccordion/VvAccordion.umd.js +1 -1
- package/dist/components/VvAccordion/VvAccordion.vue.d.ts +4 -1
- package/dist/components/VvAccordion/index.d.ts +8 -3
- package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +264 -164
- package/dist/components/VvAccordionGroup/VvAccordionGroup.umd.js +1 -1
- package/dist/components/VvAccordionGroup/VvAccordionGroup.vue.d.ts +15 -12
- package/dist/components/VvAccordionGroup/index.d.ts +8 -0
- package/dist/components/VvAction/VvAction.es.js +276 -98
- package/dist/components/VvAction/VvAction.umd.js +1 -1
- package/dist/components/VvAction/VvAction.vue.d.ts +12 -12
- package/dist/components/VvAction/index.d.ts +2 -2
- package/dist/components/VvBadge/VvBadge.es.js +213 -44
- package/dist/components/VvBadge/VvBadge.umd.js +1 -1
- package/dist/components/VvBadge/VvBadge.vue.d.ts +2 -2
- package/dist/components/VvBadge/index.d.ts +1 -1
- package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +247 -75
- package/dist/components/VvBreadcrumb/VvBreadcrumb.umd.js +1 -1
- package/dist/components/VvBreadcrumb/VvBreadcrumb.vue.d.ts +11 -11
- package/dist/components/VvBreadcrumb/index.d.ts +1 -1
- package/dist/components/VvButton/VvButton.es.js +646 -360
- package/dist/components/VvButton/VvButton.umd.js +1 -1
- package/dist/components/VvButton/VvButton.vue.d.ts +18 -18
- package/dist/components/VvButton/index.d.ts +13 -13
- package/dist/components/VvButtonGroup/VvButtonGroup.es.js +261 -79
- package/dist/components/VvButtonGroup/VvButtonGroup.umd.js +1 -1
- package/dist/components/VvButtonGroup/VvButtonGroup.vue.d.ts +2 -2
- package/dist/components/VvButtonGroup/index.d.ts +1 -1
- package/dist/components/VvCard/VvCard.es.js +57 -38
- package/dist/components/VvCard/VvCard.umd.js +1 -1
- package/dist/components/VvCheckbox/VvCheckbox.es.js +562 -274
- package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -1
- package/dist/components/VvCheckbox/VvCheckbox.vue.d.ts +2 -2
- package/dist/components/VvCheckbox/index.d.ts +5 -5
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +661 -340
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.vue.d.ts +7 -7
- package/dist/components/VvCheckboxGroup/index.d.ts +3 -3
- package/dist/components/VvCombobox/VvCombobox.es.js +1546 -983
- package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
- package/dist/components/VvCombobox/VvCombobox.vue.d.ts +138 -51
- package/dist/components/VvCombobox/index.d.ts +41 -10
- package/dist/components/VvDialog/VvDialog.es.js +387 -141
- package/dist/components/VvDialog/VvDialog.umd.js +1 -1
- package/dist/components/VvDialog/VvDialog.vue.d.ts +12 -3
- package/dist/components/VvDialog/index.d.ts +4 -1
- package/dist/components/VvDropdown/VvDropdown.es.js +452 -244
- package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
- package/dist/components/VvDropdown/VvDropdown.vue.d.ts +130 -42
- package/dist/components/VvDropdown/VvDropdownAction.vue.d.ts +13 -13
- package/dist/components/VvDropdown/VvDropdownOption.vue.d.ts +2 -2
- package/dist/components/VvDropdown/index.d.ts +40 -11
- package/dist/components/VvDropdownAction/VvDropdownAction.es.js +373 -160
- package/dist/components/VvDropdownAction/VvDropdownAction.umd.js +1 -1
- package/dist/components/VvDropdownItem/VvDropdownItem.es.js +43 -28
- package/dist/components/VvDropdownItem/VvDropdownItem.umd.js +1 -1
- package/dist/components/VvDropdownOption/VvDropdownOption.es.js +285 -90
- package/dist/components/VvDropdownOption/VvDropdownOption.umd.js +1 -1
- package/dist/components/VvIcon/VvIcon.es.js +113 -65
- package/dist/components/VvIcon/VvIcon.umd.js +1 -1
- package/dist/components/VvIcon/VvIcon.vue.d.ts +7 -7
- package/dist/components/VvIcon/index.d.ts +2 -2
- package/dist/components/VvInputText/VvInputPasswordAction.d.ts +2 -2
- package/dist/components/VvInputText/VvInputStepAction.d.ts +1 -1
- package/dist/components/VvInputText/VvInputText.es.js +986 -462
- package/dist/components/VvInputText/VvInputText.umd.js +1 -1
- package/dist/components/VvInputText/VvInputText.vue.d.ts +100 -20
- package/dist/components/VvInputText/VvInputTextActions.d.ts +1 -1
- package/dist/components/VvInputText/index.d.ts +66 -13
- package/dist/components/VvProgress/VvProgress.es.js +216 -45
- package/dist/components/VvProgress/VvProgress.umd.js +1 -1
- package/dist/components/VvProgress/VvProgress.vue.d.ts +2 -2
- package/dist/components/VvProgress/index.d.ts +1 -1
- package/dist/components/VvRadio/VvRadio.es.js +499 -238
- package/dist/components/VvRadio/VvRadio.umd.js +1 -1
- package/dist/components/VvRadio/VvRadio.vue.d.ts +2 -2
- package/dist/components/VvRadio/index.d.ts +5 -5
- package/dist/components/VvRadioGroup/VvRadioGroup.es.js +598 -304
- package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
- package/dist/components/VvRadioGroup/VvRadioGroup.vue.d.ts +7 -7
- package/dist/components/VvRadioGroup/index.d.ts +3 -3
- package/dist/components/VvSelect/VvSelect.es.js +631 -324
- package/dist/components/VvSelect/VvSelect.umd.js +1 -1
- package/dist/components/VvSelect/VvSelect.vue.d.ts +13 -13
- package/dist/components/VvSelect/index.d.ts +3 -3
- package/dist/components/VvTextarea/VvTextarea.es.js +676 -355
- package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
- package/dist/components/VvTextarea/VvTextarea.vue.d.ts +20 -20
- package/dist/components/VvTextarea/index.d.ts +4 -4
- package/dist/components/VvTooltip/VvTooltip.es.js +215 -47
- package/dist/components/VvTooltip/VvTooltip.umd.js +1 -1
- package/dist/components/VvTooltip/VvTooltip.vue.d.ts +7 -7
- package/dist/components/VvTooltip/index.d.ts +2 -2
- package/dist/components/index.es.js +3522 -2231
- package/dist/components/index.umd.js +1 -1
- package/dist/composables/dropdown/useInjectDropdown.d.ts +1 -1
- package/dist/composables/dropdown/useProvideDropdown.d.ts +3 -3
- package/dist/composables/group/useInjectedGroupState.d.ts +2 -2
- package/dist/composables/group/useProvideGroupState.d.ts +1 -1
- package/dist/composables/useComponentFocus.d.ts +1 -1
- package/dist/composables/useComponentIcon.d.ts +7 -7
- package/dist/composables/useDebouncedInput.d.ts +4 -1
- package/dist/composables/useDefaults.d.ts +2 -0
- package/dist/composables/useModifiers.d.ts +1 -1
- package/dist/composables/useOptions.d.ts +2 -2
- package/dist/composables/useTextCount.d.ts +3 -3
- package/dist/composables/useUniqueId.d.ts +1 -1
- package/dist/composables/useVolver.d.ts +1 -1
- package/dist/directives/index.d.ts +1 -0
- package/dist/directives/index.es.js +264 -55
- package/dist/directives/index.umd.js +1 -1
- package/dist/directives/v-contextmenu.d.ts +3 -0
- package/dist/directives/v-contextmenu.es.js +42 -0
- package/dist/directives/v-contextmenu.umd.js +1 -0
- package/dist/directives/v-tooltip.es.js +222 -53
- package/dist/directives/v-tooltip.umd.js +1 -1
- package/dist/icons.d.ts +3 -1
- package/dist/icons.es.js +40 -23
- package/dist/icons.umd.js +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.es.js +112 -3607
- package/dist/index.umd.js +1 -1
- package/dist/props/index.d.ts +50 -18
- package/dist/resolvers/unplugin.d.ts +7 -1
- package/dist/resolvers/unplugin.es.js +77 -37
- package/dist/resolvers/unplugin.umd.js +1 -1
- package/dist/stories/Combobox/Combobox.settings.d.ts +12 -0
- package/dist/stories/Dropdown/Dropdown.settings.d.ts +12 -0
- package/dist/stories/InputText/InputText.settings.d.ts +53 -0
- package/dist/stories/argTypes.d.ts +13 -1
- package/package.json +126 -40
- package/src/Volver.ts +49 -22
- package/src/assets/icons/detailed.json +1 -1
- package/src/assets/icons/normal.json +1 -1
- package/src/assets/icons/simple.json +1 -1
- package/src/components/VvAccordion/VvAccordion.vue +19 -22
- package/src/components/VvAccordion/index.ts +12 -4
- package/src/components/VvAccordionGroup/VvAccordionGroup.vue +19 -10
- package/src/components/VvAccordionGroup/index.ts +8 -0
- package/src/components/VvAction/VvAction.vue +7 -7
- package/src/components/VvAction/index.ts +1 -1
- package/src/components/VvBadge/VvBadge.vue +2 -2
- package/src/components/VvBadge/index.ts +1 -1
- package/src/components/VvBreadcrumb/VvBreadcrumb.vue +3 -3
- package/src/components/VvButton/VvButton.vue +11 -11
- package/src/components/VvButton/index.ts +10 -9
- package/src/components/VvButtonGroup/VvButtonGroup.vue +4 -7
- package/src/components/VvButtonGroup/index.ts +1 -1
- package/src/components/VvCard/VvCard.vue +2 -2
- package/src/components/VvCheckbox/VvCheckbox.vue +3 -7
- package/src/components/VvCheckbox/index.ts +11 -7
- package/src/components/VvCheckboxGroup/VvCheckboxGroup.vue +7 -10
- package/src/components/VvCheckboxGroup/index.ts +1 -1
- package/src/components/VvCombobox/VvCombobox.vue +44 -26
- package/src/components/VvCombobox/index.ts +1 -1
- package/src/components/VvDialog/VvDialog.vue +28 -11
- package/src/components/VvDialog/index.ts +5 -2
- package/src/components/VvDropdown/VvDropdown.vue +7 -5
- package/src/components/VvDropdown/VvDropdownAction.vue +7 -5
- package/src/components/VvDropdown/VvDropdownOption.vue +17 -10
- package/src/components/VvDropdown/index.ts +3 -3
- package/src/components/VvIcon/VvIcon.vue +3 -3
- package/src/components/VvIcon/index.ts +3 -3
- package/src/components/VvInputText/VvInputClearAction.ts +2 -2
- package/src/components/VvInputText/VvInputPasswordAction.ts +3 -4
- package/src/components/VvInputText/VvInputStepAction.ts +3 -2
- package/src/components/VvInputText/VvInputText.vue +130 -37
- package/src/components/VvInputText/VvInputTextActions.ts +5 -8
- package/src/components/VvInputText/index.ts +62 -1
- package/src/components/VvProgress/VvProgress.vue +2 -2
- package/src/components/VvProgress/index.ts +1 -1
- package/src/components/VvRadio/VvRadio.vue +3 -7
- package/src/components/VvRadio/index.ts +11 -7
- package/src/components/VvRadioGroup/VvRadioGroup.vue +7 -10
- package/src/components/VvRadioGroup/index.ts +1 -1
- package/src/components/VvSelect/VvSelect.vue +4 -4
- package/src/components/VvSelect/index.ts +1 -1
- package/src/components/VvTextarea/VvTextarea.vue +6 -6
- package/src/components/VvTextarea/index.ts +1 -1
- package/src/components/VvTooltip/VvTooltip.vue +2 -2
- package/src/components/VvTooltip/index.ts +3 -3
- package/src/composables/dropdown/useInjectDropdown.ts +2 -2
- package/src/composables/dropdown/useProvideDropdown.ts +2 -2
- package/src/composables/group/useInjectedGroupState.ts +1 -1
- package/src/composables/group/useProvideGroupState.ts +1 -1
- package/src/composables/useComponentIcon.ts +1 -1
- package/src/composables/useDebouncedInput.ts +10 -3
- package/src/composables/useDefaults.ts +89 -0
- package/src/composables/useModifiers.ts +4 -2
- package/src/composables/useOptions.ts +1 -1
- package/src/composables/useVolver.ts +2 -2
- package/src/directives/index.ts +3 -1
- package/src/directives/v-contextmenu.ts +40 -0
- package/src/directives/v-tooltip.ts +2 -2
- package/src/icons.ts +1 -1
- package/src/index.ts +0 -2
- package/src/props/index.ts +20 -10
- package/src/resolvers/unplugin.ts +15 -1
- package/src/stories/Accordion/Accordion.stories.mdx +8 -2
- package/src/stories/Accordion/Accordion.test.ts +21 -15
- package/src/stories/Accordion/AccordionSlots.stories.mdx +8 -8
- package/src/stories/AccordionGroup/AccordionGroup.stories.mdx +17 -1
- package/src/stories/AccordionGroup/AccordionGroup.test.ts +18 -12
- package/src/stories/AccordionGroup/AccordionGroupSlots.stories.mdx +1 -1
- package/src/stories/Dropdown/DropdownContextmenuDirective.stories.mdx +41 -0
- package/src/stories/InputText/InputText.settings.ts +53 -0
- package/src/stories/InputText/InputText.stories.mdx +40 -0
- package/src/stories/InputText/InputText.test.ts +5 -2
- package/src/stories/Tooltip/TooltipDirective.stories.mdx +1 -1
- package/src/stories/argTypes.ts +12 -2
- package/src/types/group.d.ts +5 -0
|
@@ -1,6 +1,51 @@
|
|
|
1
|
-
import { inject
|
|
2
|
-
var
|
|
3
|
-
|
|
1
|
+
import { inject, defineComponent, ref, watch, computed, openBlock, createBlock, resolveDynamicComponent, unref, mergeProps, withCtx, renderSlot, createTextVNode, toDisplayString } from "vue";
|
|
2
|
+
var Side = /* @__PURE__ */ ((Side2) => {
|
|
3
|
+
Side2["left"] = "left";
|
|
4
|
+
Side2["right"] = "right";
|
|
5
|
+
Side2["top"] = "top";
|
|
6
|
+
Side2["bottom"] = "bottom";
|
|
7
|
+
return Side2;
|
|
8
|
+
})(Side || {});
|
|
9
|
+
var Placement = /* @__PURE__ */ ((Placement2) => {
|
|
10
|
+
Placement2["topStart"] = "top-start";
|
|
11
|
+
Placement2["topEnd"] = "top-end";
|
|
12
|
+
Placement2["bottomStart"] = "bottom-start";
|
|
13
|
+
Placement2["bottomEnd"] = "bottom-end";
|
|
14
|
+
Placement2["leftStart"] = "left-start";
|
|
15
|
+
Placement2["leftEnd"] = "left-end";
|
|
16
|
+
Placement2["rightStart"] = "right-start";
|
|
17
|
+
Placement2["rightEnd"] = "right-end";
|
|
18
|
+
return Placement2;
|
|
19
|
+
})(Placement || {});
|
|
20
|
+
var Position = /* @__PURE__ */ ((Position2) => {
|
|
21
|
+
Position2["before"] = "before";
|
|
22
|
+
Position2["after"] = "after";
|
|
23
|
+
return Position2;
|
|
24
|
+
})(Position || {});
|
|
25
|
+
var ButtonType = /* @__PURE__ */ ((ButtonType2) => {
|
|
26
|
+
ButtonType2["button"] = "button";
|
|
27
|
+
ButtonType2["submit"] = "submit";
|
|
28
|
+
ButtonType2["reset"] = "reset";
|
|
29
|
+
return ButtonType2;
|
|
30
|
+
})(ButtonType || {});
|
|
31
|
+
var ActionTag = /* @__PURE__ */ ((ActionTag2) => {
|
|
32
|
+
ActionTag2["nuxtLink"] = "nuxt-link";
|
|
33
|
+
ActionTag2["routerLink"] = "router-link";
|
|
34
|
+
ActionTag2["a"] = "a";
|
|
35
|
+
ActionTag2["button"] = "button";
|
|
36
|
+
return ActionTag2;
|
|
37
|
+
})(ActionTag || {});
|
|
38
|
+
var AnchorTarget = /* @__PURE__ */ ((AnchorTarget2) => {
|
|
39
|
+
AnchorTarget2["_blank"] = "_blank";
|
|
40
|
+
AnchorTarget2["_self"] = "_self";
|
|
41
|
+
AnchorTarget2["_parent"] = "_parent";
|
|
42
|
+
AnchorTarget2["_top"] = "_top";
|
|
43
|
+
return AnchorTarget2;
|
|
44
|
+
})(AnchorTarget || {});
|
|
45
|
+
const INJECTION_KEY_VOLVER = Symbol.for("volver");
|
|
46
|
+
const INJECTION_KEY_DROPDOWN_TRIGGER = Symbol.for("dropdownTrigger");
|
|
47
|
+
const INJECTION_KEY_DROPDOWN_ACTION = Symbol.for("dropdownAction");
|
|
48
|
+
const LinkProps = {
|
|
4
49
|
/**
|
|
5
50
|
* The router-link/nuxt-link property, if it is defined the button is rendered as a ruouter-link or nuxt-link.
|
|
6
51
|
* @see Documentation of [router-link](https://router.vuejs.org/api/#router-link) and [nuxt-link](https://nuxtjs.org/api/components-nuxt-link/)
|
|
@@ -17,7 +62,7 @@ const J = Symbol.for("volver"), K = Symbol.for("dropdownTrigger"), W = Symbol.fo
|
|
|
17
62
|
*/
|
|
18
63
|
target: {
|
|
19
64
|
type: String,
|
|
20
|
-
validator: (
|
|
65
|
+
validator: (value) => Object.values(AnchorTarget).includes(value)
|
|
21
66
|
},
|
|
22
67
|
/**
|
|
23
68
|
* Anchor rel
|
|
@@ -26,145 +71,278 @@ const J = Symbol.for("volver"), K = Symbol.for("dropdownTrigger"), W = Symbol.fo
|
|
|
26
71
|
type: String,
|
|
27
72
|
default: "noopener noreferrer"
|
|
28
73
|
}
|
|
29
|
-
}
|
|
74
|
+
};
|
|
75
|
+
const DisabledProps = {
|
|
30
76
|
/**
|
|
31
77
|
* Whether the form control is disabled
|
|
32
78
|
*/
|
|
33
79
|
disabled: Boolean
|
|
34
|
-
}
|
|
80
|
+
};
|
|
81
|
+
const ActiveProps = {
|
|
35
82
|
/**
|
|
36
83
|
* Whether the item is active
|
|
37
84
|
*/
|
|
38
85
|
active: Boolean
|
|
39
|
-
}
|
|
86
|
+
};
|
|
87
|
+
const PressedProps = {
|
|
40
88
|
/**
|
|
41
89
|
* Whether the item is pressed
|
|
42
90
|
*/
|
|
43
91
|
pressed: Boolean
|
|
44
|
-
}
|
|
92
|
+
};
|
|
93
|
+
const LabelProps = {
|
|
45
94
|
/**
|
|
46
95
|
* The item label
|
|
47
96
|
*/
|
|
48
97
|
label: [String, Number]
|
|
49
98
|
};
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
99
|
+
({
|
|
100
|
+
/**
|
|
101
|
+
* VvIcon name or props
|
|
102
|
+
* @see VVIcon
|
|
103
|
+
*/
|
|
104
|
+
icon: { type: [String, Object] },
|
|
105
|
+
/**
|
|
106
|
+
* VvIcon position
|
|
107
|
+
*/
|
|
108
|
+
iconPosition: {
|
|
109
|
+
type: String,
|
|
110
|
+
default: Position.before,
|
|
111
|
+
validation: (value) => Object.values(Position).includes(value)
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
({
|
|
115
|
+
/**
|
|
116
|
+
* Dropdown placement
|
|
117
|
+
*/
|
|
118
|
+
placement: {
|
|
119
|
+
type: String,
|
|
120
|
+
default: Side.bottom,
|
|
121
|
+
validator: (value) => {
|
|
122
|
+
return Object.values(Side).includes(value) || Object.values(Placement).includes(value);
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
/**
|
|
126
|
+
* Dropdown strategy
|
|
127
|
+
*/
|
|
128
|
+
strategy: {
|
|
129
|
+
type: String,
|
|
130
|
+
default: "absolute",
|
|
131
|
+
validator: (value) => {
|
|
132
|
+
return ["fixed", "absolute"].includes(value);
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
/**
|
|
136
|
+
* Dropdown show / hide transition name
|
|
137
|
+
*/
|
|
138
|
+
transitionName: {
|
|
139
|
+
type: String
|
|
140
|
+
},
|
|
141
|
+
/**
|
|
142
|
+
* Offset of the dropdown from the trigger
|
|
143
|
+
* @see https://floating-ui.com/docs/offset
|
|
144
|
+
*/
|
|
145
|
+
offset: {
|
|
146
|
+
type: [Number, String, Object],
|
|
147
|
+
default: 0
|
|
148
|
+
},
|
|
149
|
+
/**
|
|
150
|
+
* Move dropdown to the side if there is no space in the default position
|
|
151
|
+
* @see https://floating-ui.com/docs/shift
|
|
152
|
+
*/
|
|
153
|
+
shift: {
|
|
154
|
+
type: [Boolean, Object],
|
|
155
|
+
default: false
|
|
156
|
+
},
|
|
157
|
+
/**
|
|
158
|
+
* Flip dropdown position if there is no space in the default position
|
|
159
|
+
* @see https://floating-ui.com/docs/flip
|
|
160
|
+
*/
|
|
161
|
+
flip: {
|
|
162
|
+
type: [Boolean, Object],
|
|
163
|
+
default: true
|
|
164
|
+
},
|
|
165
|
+
/**
|
|
166
|
+
* Size of the dropdown
|
|
167
|
+
* @see https://floating-ui.com/docs/size
|
|
168
|
+
*/
|
|
169
|
+
size: {
|
|
170
|
+
type: [Boolean, Object],
|
|
171
|
+
default: () => ({ padding: 10 })
|
|
172
|
+
},
|
|
173
|
+
/**
|
|
174
|
+
* Automatically change the position of the dropdown
|
|
175
|
+
* @see https://floating-ui.com/docs/autoPlacement
|
|
176
|
+
*/
|
|
177
|
+
autoPlacement: {
|
|
178
|
+
type: [Boolean, Object],
|
|
179
|
+
default: false
|
|
180
|
+
},
|
|
181
|
+
/**
|
|
182
|
+
* Add arrow to the dropdown
|
|
183
|
+
* @see https://floating-ui.com/docs/arrow
|
|
184
|
+
*/
|
|
185
|
+
arrow: {
|
|
186
|
+
type: Boolean,
|
|
187
|
+
default: false
|
|
188
|
+
},
|
|
189
|
+
/**
|
|
190
|
+
* Close dropdown on click outside
|
|
191
|
+
*/
|
|
192
|
+
autoClose: {
|
|
193
|
+
type: Boolean,
|
|
194
|
+
default: true
|
|
195
|
+
},
|
|
196
|
+
/**
|
|
197
|
+
* Autofocus first item on dropdown open
|
|
198
|
+
*/
|
|
199
|
+
autofocusFirst: {
|
|
200
|
+
type: Boolean,
|
|
201
|
+
default: true
|
|
202
|
+
},
|
|
203
|
+
/**
|
|
204
|
+
* Set dropdown width to the same as the trigger
|
|
205
|
+
*/
|
|
206
|
+
triggerWidth: {
|
|
207
|
+
type: Boolean
|
|
208
|
+
}
|
|
209
|
+
});
|
|
210
|
+
const ActionProps = {
|
|
211
|
+
...DisabledProps,
|
|
212
|
+
...LabelProps,
|
|
213
|
+
...PressedProps,
|
|
214
|
+
...ActiveProps,
|
|
215
|
+
...LinkProps,
|
|
58
216
|
/**
|
|
59
217
|
* Button type
|
|
60
218
|
*/
|
|
61
219
|
type: {
|
|
62
220
|
type: String,
|
|
63
|
-
default:
|
|
64
|
-
validator: (
|
|
221
|
+
default: ButtonType.button,
|
|
222
|
+
validator: (value) => Object.values(ButtonType).includes(value)
|
|
65
223
|
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
|
|
224
|
+
};
|
|
225
|
+
const VvActionEvents = ["click", "mouseover", "mouseleave"];
|
|
226
|
+
const VvActionProps = ActionProps;
|
|
227
|
+
function useVolver() {
|
|
228
|
+
return inject(INJECTION_KEY_VOLVER);
|
|
69
229
|
}
|
|
70
|
-
function
|
|
71
|
-
return
|
|
230
|
+
function useInjectedDropdownTrigger() {
|
|
231
|
+
return inject(INJECTION_KEY_DROPDOWN_TRIGGER, {});
|
|
72
232
|
}
|
|
73
|
-
function
|
|
74
|
-
return
|
|
233
|
+
function useInjectedDropdownAction() {
|
|
234
|
+
return inject(INJECTION_KEY_DROPDOWN_ACTION, {});
|
|
75
235
|
}
|
|
76
|
-
const
|
|
236
|
+
const __default__ = {
|
|
77
237
|
name: "VvAction"
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
238
|
+
};
|
|
239
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
240
|
+
...__default__,
|
|
241
|
+
props: VvActionProps,
|
|
242
|
+
emits: VvActionEvents,
|
|
243
|
+
setup(__props, { expose, emit }) {
|
|
244
|
+
const props = __props;
|
|
245
|
+
const volver = useVolver();
|
|
246
|
+
const element = ref(null);
|
|
247
|
+
expose({ $el: element });
|
|
85
248
|
const {
|
|
86
|
-
reference:
|
|
87
|
-
bus:
|
|
88
|
-
aria:
|
|
89
|
-
expanded:
|
|
90
|
-
} =
|
|
91
|
-
|
|
92
|
-
() =>
|
|
93
|
-
(
|
|
94
|
-
|
|
249
|
+
reference: dropdownTriggerReference,
|
|
250
|
+
bus: dropdownEventBus,
|
|
251
|
+
aria: dropdownAria,
|
|
252
|
+
expanded: dropdownExpanded
|
|
253
|
+
} = useInjectedDropdownTrigger();
|
|
254
|
+
watch(
|
|
255
|
+
() => element.value,
|
|
256
|
+
(newValue) => {
|
|
257
|
+
if (dropdownTriggerReference) {
|
|
258
|
+
dropdownTriggerReference.value = newValue;
|
|
259
|
+
}
|
|
95
260
|
}
|
|
96
261
|
);
|
|
97
|
-
const
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
case
|
|
104
|
-
return
|
|
262
|
+
const pressed = computed(() => {
|
|
263
|
+
return props.pressed || (dropdownExpanded == null ? void 0 : dropdownExpanded.value);
|
|
264
|
+
});
|
|
265
|
+
const { role } = useInjectedDropdownAction();
|
|
266
|
+
const hasTag = computed(() => {
|
|
267
|
+
switch (true) {
|
|
268
|
+
case props.disabled:
|
|
269
|
+
return ActionTag.button;
|
|
270
|
+
case props.to !== void 0:
|
|
271
|
+
return (volver == null ? void 0 : volver.nuxt) ? ActionTag.nuxtLink : ActionTag.routerLink;
|
|
272
|
+
case props.href !== void 0:
|
|
273
|
+
return ActionTag.a;
|
|
105
274
|
default:
|
|
106
|
-
return
|
|
275
|
+
return ActionTag.button;
|
|
107
276
|
}
|
|
108
|
-
})
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
277
|
+
});
|
|
278
|
+
const hasProps = computed(() => {
|
|
279
|
+
const toReturn = {
|
|
280
|
+
...dropdownAria == null ? void 0 : dropdownAria.value,
|
|
281
|
+
"aria-pressed": pressed.value ? true : void 0,
|
|
282
|
+
role
|
|
113
283
|
};
|
|
114
|
-
switch (
|
|
115
|
-
case
|
|
284
|
+
switch (hasTag.value) {
|
|
285
|
+
case ActionTag.a:
|
|
116
286
|
return {
|
|
117
|
-
...
|
|
118
|
-
href:
|
|
119
|
-
target:
|
|
120
|
-
rel:
|
|
287
|
+
...toReturn,
|
|
288
|
+
href: props.href,
|
|
289
|
+
target: props.target,
|
|
290
|
+
rel: props.rel
|
|
121
291
|
};
|
|
122
|
-
case
|
|
123
|
-
case
|
|
292
|
+
case ActionTag.routerLink:
|
|
293
|
+
case ActionTag.nuxtLink:
|
|
124
294
|
return {
|
|
125
|
-
...
|
|
126
|
-
to:
|
|
127
|
-
target:
|
|
295
|
+
...toReturn,
|
|
296
|
+
to: props.to,
|
|
297
|
+
target: props.target
|
|
128
298
|
};
|
|
129
299
|
default:
|
|
130
300
|
return {
|
|
131
|
-
...
|
|
132
|
-
type:
|
|
133
|
-
disabled:
|
|
301
|
+
...toReturn,
|
|
302
|
+
type: props.type,
|
|
303
|
+
disabled: props.disabled
|
|
134
304
|
};
|
|
135
305
|
}
|
|
136
|
-
})
|
|
137
|
-
|
|
138
|
-
|
|
306
|
+
});
|
|
307
|
+
const onClick = (e) => {
|
|
308
|
+
if (props.disabled) {
|
|
309
|
+
e.preventDefault();
|
|
139
310
|
return;
|
|
140
311
|
}
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
312
|
+
dropdownEventBus == null ? void 0 : dropdownEventBus.emit("click", e);
|
|
313
|
+
emit("click", e);
|
|
314
|
+
};
|
|
315
|
+
const onMouseover = (e) => {
|
|
316
|
+
dropdownEventBus == null ? void 0 : dropdownEventBus.emit("mouseover", e);
|
|
317
|
+
emit("mouseover", e);
|
|
318
|
+
};
|
|
319
|
+
const onMouseleave = (e) => {
|
|
320
|
+
dropdownEventBus == null ? void 0 : dropdownEventBus.emit("mouseleave", e);
|
|
321
|
+
emit("mouseleave", e);
|
|
322
|
+
};
|
|
323
|
+
return (_ctx, _cache) => {
|
|
324
|
+
return openBlock(), createBlock(resolveDynamicComponent(unref(hasTag)), mergeProps(unref(hasProps), {
|
|
325
|
+
ref_key: "element",
|
|
326
|
+
ref: element,
|
|
327
|
+
class: {
|
|
328
|
+
active: _ctx.active,
|
|
329
|
+
pressed: unref(pressed),
|
|
330
|
+
disabled: _ctx.disabled
|
|
331
|
+
},
|
|
332
|
+
onClickPassive: onClick,
|
|
333
|
+
onMouseoverPassive: onMouseover,
|
|
334
|
+
onMouseleavePassive: onMouseleave
|
|
335
|
+
}), {
|
|
336
|
+
default: withCtx(() => [
|
|
337
|
+
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
338
|
+
createTextVNode(toDisplayString(_ctx.label), 1)
|
|
339
|
+
])
|
|
340
|
+
]),
|
|
341
|
+
_: 3
|
|
342
|
+
}, 16, ["class"]);
|
|
146
343
|
};
|
|
147
|
-
return (t, Z) => (P(), E(R(f(y)), V(f(h), {
|
|
148
|
-
ref_key: "element",
|
|
149
|
-
ref: l,
|
|
150
|
-
class: {
|
|
151
|
-
active: t.active,
|
|
152
|
-
pressed: f(g),
|
|
153
|
-
disabled: t.disabled
|
|
154
|
-
},
|
|
155
|
-
onClickPassive: j,
|
|
156
|
-
onMouseoverPassive: N,
|
|
157
|
-
onMouseleavePassive: C
|
|
158
|
-
}), {
|
|
159
|
-
default: B(() => [
|
|
160
|
-
x(t.$slots, "default", {}, () => [
|
|
161
|
-
M(w(t.label), 1)
|
|
162
|
-
])
|
|
163
|
-
]),
|
|
164
|
-
_: 3
|
|
165
|
-
}, 16, ["class"]));
|
|
166
344
|
}
|
|
167
345
|
});
|
|
168
346
|
export {
|
|
169
|
-
|
|
347
|
+
_sfc_main as default
|
|
170
348
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue")):"function"==typeof define&&define.amd?define(["vue"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VvAction=t(e.vue)}(this,(function(e){"use strict";var t=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(t||{}),o=(e=>(e.before="before",e.after="after",e))(o||{}),n=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(n||{}),r=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(r||{}),l=(e=>(e._blank="_blank",e._self="_self",e._parent="_parent",e._top="_top",e))(l||{});const a=Symbol.for("volver"),u=Symbol.for("dropdownTrigger"),i=Symbol.for("dropdownAction"),s={to:{type:[String,Object]},href:String,target:{type:String,validator:e=>Object.values(l).includes(e)},rel:{type:String,default:"noopener noreferrer"}},d={disabled:Boolean},c={active:Boolean},f={pressed:Boolean},p={label:[String,Number]};o.before,t.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const v={...d,...p,...f,...c,...s,type:{type:String,default:n.button,validator:e=>Object.values(n).includes(e)}};return e.defineComponent({name:"VvAction",props:v,emits:["click","mouseover","mouseleave"],setup(t,{expose:o,emit:n}){const l=t,s=e.inject(a),d=e.ref(null);o({$el:d});const{reference:c,bus:f,aria:p,expanded:v}=e.inject(u,{});e.watch((()=>d.value),(e=>{c&&(c.value=e)}));const b=e.computed((()=>l.pressed||(null==v?void 0:v.value))),{role:m}=e.inject(i,{}),g=e.computed((()=>{switch(!0){case l.disabled:return r.button;case void 0!==l.to:return(null==s?void 0:s.nuxt)?r.nuxtLink:r.routerLink;case void 0!==l.href:return r.a;default:return r.button}})),k=e.computed((()=>{const e={...null==p?void 0:p.value,"aria-pressed":!!b.value||void 0,role:m};switch(g.value){case r.a:return{...e,href:l.href,target:l.target,rel:l.rel};case r.routerLink:case r.nuxtLink:return{...e,to:l.to,target:l.target};default:return{...e,type:l.type,disabled:l.disabled}}})),y=e=>{l.disabled?e.preventDefault():(null==f||f.emit("click",e),n("click",e))},h=e=>{null==f||f.emit("mouseover",e),n("mouseover",e)},B=e=>{null==f||f.emit("mouseleave",e),n("mouseleave",e)};return(t,o)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(g)),e.mergeProps(e.unref(k),{ref_key:"element",ref:d,class:{active:t.active,pressed:e.unref(b),disabled:t.disabled},onClickPassive:y,onMouseoverPassive:h,onMouseleavePassive:B}),{default:e.withCtx((()=>[e.renderSlot(t.$slots,"default",{},(()=>[e.createTextVNode(e.toDisplayString(t.label),1)]))])),_:3},16,["class"]))}})}));
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
2
2
|
type: {
|
|
3
|
-
type:
|
|
4
|
-
default: import("
|
|
5
|
-
validator: (value: import("
|
|
3
|
+
type: globalThis.PropType<"button" | "submit" | "reset">;
|
|
4
|
+
default: import("../../constants").ButtonType;
|
|
5
|
+
validator: (value: import("../../constants").ButtonType) => boolean;
|
|
6
6
|
};
|
|
7
7
|
to: {
|
|
8
8
|
type: (StringConstructor | ObjectConstructor)[];
|
|
9
9
|
};
|
|
10
10
|
href: StringConstructor;
|
|
11
11
|
target: {
|
|
12
|
-
type:
|
|
13
|
-
validator: (value: import("
|
|
12
|
+
type: globalThis.PropType<"_blank" | "_self" | "_parent" | "_top">;
|
|
13
|
+
validator: (value: import("../../constants").AnchorTarget) => boolean;
|
|
14
14
|
};
|
|
15
15
|
rel: {
|
|
16
16
|
type: StringConstructor;
|
|
@@ -21,20 +21,20 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
21
21
|
label: (StringConstructor | NumberConstructor)[];
|
|
22
22
|
disabled: BooleanConstructor;
|
|
23
23
|
}, {
|
|
24
|
-
$el:
|
|
24
|
+
$el: globalThis.Ref<HTMLElement | null>;
|
|
25
25
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, string[], string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
26
26
|
type: {
|
|
27
|
-
type:
|
|
28
|
-
default: import("
|
|
29
|
-
validator: (value: import("
|
|
27
|
+
type: globalThis.PropType<"button" | "submit" | "reset">;
|
|
28
|
+
default: import("../../constants").ButtonType;
|
|
29
|
+
validator: (value: import("../../constants").ButtonType) => boolean;
|
|
30
30
|
};
|
|
31
31
|
to: {
|
|
32
32
|
type: (StringConstructor | ObjectConstructor)[];
|
|
33
33
|
};
|
|
34
34
|
href: StringConstructor;
|
|
35
35
|
target: {
|
|
36
|
-
type:
|
|
37
|
-
validator: (value: import("
|
|
36
|
+
type: globalThis.PropType<"_blank" | "_self" | "_parent" | "_top">;
|
|
37
|
+
validator: (value: import("../../constants").AnchorTarget) => boolean;
|
|
38
38
|
};
|
|
39
39
|
rel: {
|
|
40
40
|
type: StringConstructor;
|
|
@@ -48,7 +48,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
48
48
|
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
49
49
|
}, {
|
|
50
50
|
disabled: boolean;
|
|
51
|
-
type:
|
|
51
|
+
type: "button" | "submit" | "reset";
|
|
52
52
|
rel: string;
|
|
53
53
|
active: boolean;
|
|
54
54
|
pressed: boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export declare const VvActionEvents: string[];
|
|
2
2
|
export declare const VvActionProps: {
|
|
3
3
|
type: {
|
|
4
|
-
type:
|
|
4
|
+
type: globalThis.PropType<"button" | "submit" | "reset">;
|
|
5
5
|
default: import("../../constants").ButtonType;
|
|
6
6
|
validator: (value: import("../../constants").ButtonType) => boolean;
|
|
7
7
|
};
|
|
@@ -10,7 +10,7 @@ export declare const VvActionProps: {
|
|
|
10
10
|
};
|
|
11
11
|
href: StringConstructor;
|
|
12
12
|
target: {
|
|
13
|
-
type:
|
|
13
|
+
type: globalThis.PropType<"_blank" | "_self" | "_parent" | "_top">;
|
|
14
14
|
validator: (value: import("../../constants").AnchorTarget) => boolean;
|
|
15
15
|
};
|
|
16
16
|
rel: {
|