@volverjs/ui-vue 0.0.3 → 0.0.4
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/LICENSE +1 -1
- package/README.md +52 -13
- package/dist/Volver.d.ts +5 -1
- package/dist/components/VvAccordion/VvAccordion.es.js +113 -66
- package/dist/components/VvAccordion/VvAccordion.umd.js +1 -1
- package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +159 -101
- package/dist/components/VvAccordionGroup/VvAccordionGroup.umd.js +1 -1
- package/dist/components/VvAction/VvAction.es.js +170 -0
- package/dist/components/VvAction/VvAction.umd.js +1 -0
- package/dist/components/VvAction/VvAction.vue.d.ts +63 -0
- package/dist/components/VvAction/index.d.ts +24 -0
- package/dist/components/VvBadge/VvBadge.es.js +86 -16
- package/dist/components/VvBadge/VvBadge.umd.js +1 -1
- package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +97 -41
- package/dist/components/VvBreadcrumb/VvBreadcrumb.umd.js +1 -1
- package/dist/components/VvButton/VvButton.es.js +434 -251
- package/dist/components/VvButton/VvButton.umd.js +1 -1
- package/dist/components/VvButton/VvButton.vue.d.ts +50 -50
- package/dist/components/VvButton/index.d.ts +22 -67
- package/dist/components/VvButtonGroup/VvButtonGroup.es.js +118 -43
- package/dist/components/VvButtonGroup/VvButtonGroup.umd.js +1 -1
- package/dist/components/VvCard/VvCard.es.js +38 -25
- package/dist/components/VvCard/VvCard.umd.js +1 -1
- package/dist/components/VvCheckbox/VvCheckbox.es.js +334 -154
- 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 +1 -1
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +401 -204
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.vue.d.ts +2 -2
- package/dist/components/VvCheckboxGroup/index.d.ts +1 -1
- package/dist/components/VvCombobox/VvCombobox.es.js +950 -594
- package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
- package/dist/components/VvCombobox/VvCombobox.vue.d.ts +54 -30
- package/dist/components/VvCombobox/index.d.ts +18 -13
- package/dist/components/VvDialog/VvDialog.es.js +139 -64
- package/dist/components/VvDialog/VvDialog.umd.js +1 -1
- package/dist/components/VvDropdown/VvDropdown.es.js +276 -158
- package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
- package/dist/components/VvDropdown/VvDropdown.vue.d.ts +9 -9
- package/dist/components/VvDropdown/VvDropdownAction.vue.d.ts +61 -0
- package/dist/components/VvDropdown/VvDropdownOption.vue.d.ts +52 -0
- package/dist/components/VvDropdown/index.d.ts +6 -9
- package/dist/components/VvDropdownAction/VvDropdownAction.es.js +251 -0
- package/dist/components/VvDropdownAction/VvDropdownAction.umd.js +1 -0
- package/dist/components/VvDropdownItem/VvDropdownItem.es.js +30 -15
- package/dist/components/VvDropdownItem/VvDropdownItem.umd.js +1 -1
- package/dist/components/VvDropdownOption/VvDropdownOption.es.js +176 -0
- package/dist/components/VvDropdownOption/VvDropdownOption.umd.js +1 -0
- package/dist/components/VvIcon/VvIcon.es.js +48 -32
- package/dist/components/VvIcon/VvIcon.umd.js +1 -1
- package/dist/components/VvInputText/VvInputText.es.js +508 -344
- package/dist/components/VvInputText/VvInputText.umd.js +1 -1
- package/dist/components/VvInputText/VvInputText.vue.d.ts +11 -4
- package/dist/components/VvInputText/index.d.ts +13 -2
- package/dist/components/VvProgress/VvProgress.es.js +90 -20
- package/dist/components/VvProgress/VvProgress.umd.js +1 -1
- package/dist/components/VvRadio/VvRadio.es.js +305 -125
- 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 +1 -1
- package/dist/components/VvRadioGroup/VvRadioGroup.es.js +372 -175
- package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
- package/dist/components/VvRadioGroup/VvRadioGroup.vue.d.ts +2 -2
- package/dist/components/VvRadioGroup/index.d.ts +1 -1
- package/dist/components/VvSelect/VvSelect.es.js +371 -216
- package/dist/components/VvSelect/VvSelect.umd.js +1 -1
- package/dist/components/VvSelect/VvSelect.vue.d.ts +11 -4
- package/dist/components/VvSelect/index.d.ts +5 -5
- package/dist/components/VvTextarea/VvTextarea.es.js +408 -244
- package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
- package/dist/components/VvTextarea/VvTextarea.vue.d.ts +11 -4
- package/dist/components/VvTextarea/index.d.ts +5 -5
- package/dist/components/VvTooltip/VvTooltip.es.js +88 -18
- package/dist/components/VvTooltip/VvTooltip.umd.js +1 -1
- package/dist/components/index.es.js +1913 -1521
- package/dist/components/index.umd.js +1 -1
- package/dist/composables/dropdown/useInjectDropdown.d.ts +1 -1
- package/dist/composables/dropdown/useProvideDropdown.d.ts +2 -2
- package/dist/constants.d.ts +30 -0
- package/dist/directives/index.es.js +128 -0
- package/dist/directives/index.umd.js +1 -0
- package/dist/directives/v-tooltip.es.js +126 -0
- package/dist/directives/v-tooltip.umd.js +1 -0
- package/dist/icons.es.js +3 -3
- package/dist/icons.umd.js +1 -1
- package/dist/index.es.js +2102 -1761
- package/dist/index.umd.js +1 -1
- package/dist/props/index.d.ts +179 -11
- package/dist/resolvers/unplugin.d.ts +8 -8
- package/dist/resolvers/unplugin.es.js +51 -30
- package/dist/resolvers/unplugin.umd.js +1 -1
- package/dist/stories/Combobox/Combobox.settings.d.ts +44 -0
- package/dist/stories/Dropdown/Dropdown.settings.d.ts +3 -2
- package/package.json +60 -34
- package/src/Volver.ts +12 -5
- 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/VvAction/VvAction.vue +144 -0
- package/src/components/VvAction/index.ts +5 -0
- package/src/components/VvButton/VvButton.vue +31 -114
- package/src/components/VvButton/index.ts +6 -79
- package/src/components/VvCombobox/VvCombobox.vue +54 -42
- package/src/components/VvCombobox/index.ts +11 -9
- package/src/components/VvDropdown/VvDropdownAction.vue +44 -0
- package/src/components/VvDropdown/VvDropdownOption.vue +65 -0
- package/src/components/VvDropdown/index.ts +4 -9
- package/src/components/VvSelect/index.ts +2 -4
- package/src/composables/dropdown/useInjectDropdown.ts +1 -1
- package/src/composables/dropdown/useProvideDropdown.ts +7 -9
- package/src/composables/useModifiers.ts +4 -7
- package/src/constants.ts +36 -0
- package/src/props/index.ts +106 -14
- package/src/resolvers/unplugin.ts +81 -48
- package/src/stories/Accordion/AccordionSlots.stories.mdx +2 -2
- package/src/stories/AccordionGroup/AccordionGroupSlots.stories.mdx +2 -1
- package/src/stories/Breadcrumb/Breadcrumb.stories.mdx +2 -1
- package/src/stories/Button/Button.stories.mdx +4 -2
- package/src/stories/Button/Button.test.ts +3 -1
- package/src/stories/Button/ButtonModifiers.stories.mdx +2 -2
- package/src/stories/Button/ButtonSlots.stories.mdx +8 -7
- package/src/stories/Button/ButtonState.stories.mdx +2 -11
- package/src/stories/Card/Card.stories.mdx +2 -1
- package/src/stories/Checkbox/Checkbox.stories.mdx +2 -1
- package/src/stories/CheckboxGroup/CheckboxGroup.stories.mdx +2 -1
- package/src/stories/CheckboxGroup/CheckboxGroupSlots.stories.mdx +2 -1
- package/src/stories/Combobox/Combobox.settings.ts +44 -0
- package/src/stories/Combobox/Combobox.stories.mdx +40 -1
- package/src/stories/Dialog/Dialog.stories.mdx +2 -1
- package/src/stories/Dropdown/Dropdown.settings.ts +3 -2
- package/src/stories/Dropdown/Dropdown.stories.mdx +14 -12
- package/src/stories/Dropdown/DropdownMultilevel.stories.mdx +56 -0
- package/src/stories/Dropdown/DropdownSlots.stories.mdx +14 -13
- package/src/stories/Icon/Icon.stories.mdx +2 -1
- package/src/stories/Icon/IconsCollection.stories.mdx +2 -1
- package/src/stories/InputText/InputText.stories.mdx +2 -1
- package/src/stories/Progress/Progress.stories.mdx +2 -1
- package/src/stories/Radio/Radio.stories.mdx +2 -1
- package/src/stories/RadioGroup/RadioGroup.stories.mdx +2 -1
- package/src/stories/RadioGroup/RadioGroupSlots.stories.mdx +2 -1
- package/src/stories/Select/Select.stories.mdx +2 -1
- package/src/stories/Textarea/Textarea.stories.mdx +2 -1
- package/src/stories/Tooltip/Tooltip.stories.mdx +2 -1
- package/src/stories/Tooltip/TooltipDirective.stories.mdx +2 -1
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
2
|
+
modifiers: import("vue").PropType<string | string[]>;
|
|
3
|
+
type: {
|
|
4
|
+
type: StringConstructor;
|
|
5
|
+
default: import("../../constants.js").ButtonType;
|
|
6
|
+
validator: (value: import("../../constants.js").ButtonType) => boolean;
|
|
7
|
+
};
|
|
8
|
+
to: {
|
|
9
|
+
type: (StringConstructor | ObjectConstructor)[];
|
|
10
|
+
};
|
|
11
|
+
href: StringConstructor;
|
|
12
|
+
target: {
|
|
13
|
+
type: import("vue").PropType<import("../../constants.js").AnchorTarget>;
|
|
14
|
+
validator: (value: import("../../constants.js").AnchorTarget) => boolean;
|
|
15
|
+
};
|
|
16
|
+
rel: {
|
|
17
|
+
type: StringConstructor;
|
|
18
|
+
default: string;
|
|
19
|
+
};
|
|
20
|
+
active: BooleanConstructor;
|
|
21
|
+
pressed: BooleanConstructor;
|
|
22
|
+
label: (StringConstructor | NumberConstructor)[];
|
|
23
|
+
disabled: BooleanConstructor;
|
|
24
|
+
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
25
|
+
modifiers: import("vue").PropType<string | string[]>;
|
|
26
|
+
type: {
|
|
27
|
+
type: StringConstructor;
|
|
28
|
+
default: import("../../constants.js").ButtonType;
|
|
29
|
+
validator: (value: import("../../constants.js").ButtonType) => boolean;
|
|
30
|
+
};
|
|
31
|
+
to: {
|
|
32
|
+
type: (StringConstructor | ObjectConstructor)[];
|
|
33
|
+
};
|
|
34
|
+
href: StringConstructor;
|
|
35
|
+
target: {
|
|
36
|
+
type: import("vue").PropType<import("../../constants.js").AnchorTarget>;
|
|
37
|
+
validator: (value: import("../../constants.js").AnchorTarget) => boolean;
|
|
38
|
+
};
|
|
39
|
+
rel: {
|
|
40
|
+
type: StringConstructor;
|
|
41
|
+
default: string;
|
|
42
|
+
};
|
|
43
|
+
active: BooleanConstructor;
|
|
44
|
+
pressed: BooleanConstructor;
|
|
45
|
+
label: (StringConstructor | NumberConstructor)[];
|
|
46
|
+
disabled: BooleanConstructor;
|
|
47
|
+
}>>, {
|
|
48
|
+
disabled: boolean;
|
|
49
|
+
type: string;
|
|
50
|
+
rel: string;
|
|
51
|
+
active: boolean;
|
|
52
|
+
pressed: boolean;
|
|
53
|
+
}>, {
|
|
54
|
+
default: (_: {}) => any;
|
|
55
|
+
}>;
|
|
56
|
+
export default _default;
|
|
57
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
58
|
+
new (): {
|
|
59
|
+
$slots: S;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
2
|
+
deselectHintLabel: {
|
|
3
|
+
type: StringConstructor;
|
|
4
|
+
};
|
|
5
|
+
selectHintLabel: {
|
|
6
|
+
type: StringConstructor;
|
|
7
|
+
};
|
|
8
|
+
selectedHintLabel: {
|
|
9
|
+
type: StringConstructor;
|
|
10
|
+
};
|
|
11
|
+
modifiers: import("vue").PropType<string | string[]>;
|
|
12
|
+
unselectable: {
|
|
13
|
+
type: BooleanConstructor;
|
|
14
|
+
default: boolean;
|
|
15
|
+
};
|
|
16
|
+
selected: BooleanConstructor;
|
|
17
|
+
disabled: BooleanConstructor;
|
|
18
|
+
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
19
|
+
deselectHintLabel: {
|
|
20
|
+
type: StringConstructor;
|
|
21
|
+
};
|
|
22
|
+
selectHintLabel: {
|
|
23
|
+
type: StringConstructor;
|
|
24
|
+
};
|
|
25
|
+
selectedHintLabel: {
|
|
26
|
+
type: StringConstructor;
|
|
27
|
+
};
|
|
28
|
+
modifiers: import("vue").PropType<string | string[]>;
|
|
29
|
+
unselectable: {
|
|
30
|
+
type: BooleanConstructor;
|
|
31
|
+
default: boolean;
|
|
32
|
+
};
|
|
33
|
+
selected: BooleanConstructor;
|
|
34
|
+
disabled: BooleanConstructor;
|
|
35
|
+
}>>, {
|
|
36
|
+
disabled: boolean;
|
|
37
|
+
unselectable: boolean;
|
|
38
|
+
selected: boolean;
|
|
39
|
+
}>, {
|
|
40
|
+
default: (_: {}) => any;
|
|
41
|
+
hint: (_: {
|
|
42
|
+
disabled: boolean;
|
|
43
|
+
selected: boolean;
|
|
44
|
+
unselectable: boolean;
|
|
45
|
+
}) => any;
|
|
46
|
+
}>;
|
|
47
|
+
export default _default;
|
|
48
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
49
|
+
new (): {
|
|
50
|
+
$slots: S;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import type { PropType } from 'vue';
|
|
2
|
-
|
|
3
|
-
export declare const DROPDOWN_ITEM_ROLES: readonly ["option", "presentation"];
|
|
4
|
-
export type DropdownRole = (typeof DROPDOWN_ROLES)[number];
|
|
5
|
-
export type DropdownItemRole = (typeof DROPDOWN_ITEM_ROLES)[number];
|
|
2
|
+
import { DropdownRole } from '@/constants';
|
|
6
3
|
export declare const VvDropdownProps: {
|
|
7
4
|
/**
|
|
8
5
|
* Show / hide dropdown programmatically
|
|
@@ -22,13 +19,13 @@ export declare const VvDropdownProps: {
|
|
|
22
19
|
* Dropdown role
|
|
23
20
|
*/
|
|
24
21
|
role: {
|
|
25
|
-
type: PropType<
|
|
26
|
-
default:
|
|
27
|
-
validator: (value:
|
|
22
|
+
type: PropType<DropdownRole>;
|
|
23
|
+
default: DropdownRole;
|
|
24
|
+
validator: (value: DropdownRole) => boolean;
|
|
28
25
|
};
|
|
29
26
|
placement: {
|
|
30
|
-
type: PropType<import("
|
|
31
|
-
default: import("
|
|
27
|
+
type: PropType<import("@/constants").Side | import("@/constants").Placement>;
|
|
28
|
+
default: import("@/constants").Side;
|
|
32
29
|
validator: (value: never) => boolean;
|
|
33
30
|
};
|
|
34
31
|
transitionName: {
|
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
import { inject as p, defineComponent as g, ref as I, watch as N, computed as f, openBlock as O, createBlock as D, resolveDynamicComponent as W, unref as i, mergeProps as h, withCtx as b, renderSlot as k, createTextVNode as A, toDisplayString as J, provide as K, createElementBlock as T, toRefs as Y, createVNode as F } from "vue";
|
|
2
|
+
import "mitt";
|
|
3
|
+
import { useElementHover as G, useFocus as z, useFocusWithin as H } from "@vueuse/core";
|
|
4
|
+
var m = /* @__PURE__ */ ((e) => (e.left = "left", e.right = "right", e.top = "top", e.bottom = "bottom", e))(m || {}), E = /* @__PURE__ */ ((e) => (e.topStart = "top-start", e.topEnd = "top-end", e.bottomStart = "bottom-start", e.bottomEnd = "bottom-end", e.leftStart = "left-start", e.leftEnd = "left-end", e.rightStart = "right-start", e.rightEnd = "right-end", e))(E || {}), _ = /* @__PURE__ */ ((e) => (e.before = "before", e.after = "after", e))(_ || {}), y = /* @__PURE__ */ ((e) => (e.button = "button", e.submit = "submit", e.reset = "reset", e))(y || {}), l = /* @__PURE__ */ ((e) => (e.nuxtLink = "nuxt-link", e.routerLink = "router-link", e.a = "a", e.button = "button", e))(l || {}), C = /* @__PURE__ */ ((e) => (e.button = "button", e.link = "link", e.menuitem = "menuitem", e))(C || {}), P = /* @__PURE__ */ ((e) => (e._blank = "_blank", e._self = "_self", e._parent = "_parent", e._top = "_top", e))(P || {});
|
|
5
|
+
const q = Symbol.for("volver"), Q = Symbol.for("dropdownTrigger"), U = Symbol.for("dropdownItem"), $ = Symbol.for("dropdownAction"), X = {
|
|
6
|
+
/**
|
|
7
|
+
* The router-link/nuxt-link property, if it is defined the button is rendered as a ruouter-link or nuxt-link.
|
|
8
|
+
* @see Documentation of [router-link](https://router.vuejs.org/api/#router-link) and [nuxt-link](https://nuxtjs.org/api/components-nuxt-link/)
|
|
9
|
+
*/
|
|
10
|
+
to: {
|
|
11
|
+
type: [String, Object]
|
|
12
|
+
},
|
|
13
|
+
/**
|
|
14
|
+
* Anchor href
|
|
15
|
+
*/
|
|
16
|
+
href: String,
|
|
17
|
+
/**
|
|
18
|
+
* Anchor target
|
|
19
|
+
*/
|
|
20
|
+
target: {
|
|
21
|
+
type: String,
|
|
22
|
+
validator: (e) => Object.values(P).includes(e)
|
|
23
|
+
},
|
|
24
|
+
/**
|
|
25
|
+
* Anchor rel
|
|
26
|
+
*/
|
|
27
|
+
rel: {
|
|
28
|
+
type: String,
|
|
29
|
+
default: "noopener noreferrer"
|
|
30
|
+
}
|
|
31
|
+
}, Z = {
|
|
32
|
+
/**
|
|
33
|
+
* Whether the form control is disabled
|
|
34
|
+
*/
|
|
35
|
+
disabled: Boolean
|
|
36
|
+
}, x = {
|
|
37
|
+
/**
|
|
38
|
+
* Whether the item is active
|
|
39
|
+
*/
|
|
40
|
+
active: Boolean
|
|
41
|
+
}, ee = {
|
|
42
|
+
/**
|
|
43
|
+
* Whether the item is pressed
|
|
44
|
+
*/
|
|
45
|
+
pressed: Boolean
|
|
46
|
+
}, te = {
|
|
47
|
+
/**
|
|
48
|
+
* The item label
|
|
49
|
+
*/
|
|
50
|
+
label: [String, Number]
|
|
51
|
+
}, re = {
|
|
52
|
+
/**
|
|
53
|
+
* Component BEM modifiers
|
|
54
|
+
*/
|
|
55
|
+
modifiers: [String, Array]
|
|
56
|
+
};
|
|
57
|
+
_.before;
|
|
58
|
+
m.bottom;
|
|
59
|
+
const w = {
|
|
60
|
+
...Z,
|
|
61
|
+
...te,
|
|
62
|
+
...ee,
|
|
63
|
+
...x,
|
|
64
|
+
...X,
|
|
65
|
+
/**
|
|
66
|
+
* Button type
|
|
67
|
+
*/
|
|
68
|
+
type: {
|
|
69
|
+
type: String,
|
|
70
|
+
default: y.button,
|
|
71
|
+
validator: (e) => Object.values(y).includes(e)
|
|
72
|
+
}
|
|
73
|
+
}, oe = ["click", "mouseover", "mouseleave"], ne = w;
|
|
74
|
+
function se() {
|
|
75
|
+
return p(q);
|
|
76
|
+
}
|
|
77
|
+
function ae() {
|
|
78
|
+
return p(Q, {});
|
|
79
|
+
}
|
|
80
|
+
function ue() {
|
|
81
|
+
return p(U, {});
|
|
82
|
+
}
|
|
83
|
+
function le() {
|
|
84
|
+
return p($, {});
|
|
85
|
+
}
|
|
86
|
+
const ie = {
|
|
87
|
+
name: "VvAction"
|
|
88
|
+
}, ce = /* @__PURE__ */ g({
|
|
89
|
+
...ie,
|
|
90
|
+
props: ne,
|
|
91
|
+
emits: oe,
|
|
92
|
+
setup(e, { expose: n, emit: u }) {
|
|
93
|
+
const t = e, o = se(), a = I(null);
|
|
94
|
+
n({ $el: a });
|
|
95
|
+
const {
|
|
96
|
+
reference: c,
|
|
97
|
+
bus: s,
|
|
98
|
+
aria: d,
|
|
99
|
+
expanded: v
|
|
100
|
+
} = ae();
|
|
101
|
+
N(
|
|
102
|
+
() => a.value,
|
|
103
|
+
(r) => {
|
|
104
|
+
c && (c.value = r);
|
|
105
|
+
}
|
|
106
|
+
);
|
|
107
|
+
const S = f(() => t.pressed || (v == null ? void 0 : v.value)), { role: V } = le(), j = f(() => {
|
|
108
|
+
switch (!0) {
|
|
109
|
+
case t.disabled:
|
|
110
|
+
return l.button;
|
|
111
|
+
case t.to !== void 0:
|
|
112
|
+
return o != null && o.nuxt ? l.nuxtLink : l.routerLink;
|
|
113
|
+
case t.href !== void 0:
|
|
114
|
+
return l.a;
|
|
115
|
+
default:
|
|
116
|
+
return l.button;
|
|
117
|
+
}
|
|
118
|
+
}), L = f(() => {
|
|
119
|
+
const r = {
|
|
120
|
+
...d == null ? void 0 : d.value,
|
|
121
|
+
"aria-pressed": S.value ? !0 : void 0,
|
|
122
|
+
role: V
|
|
123
|
+
};
|
|
124
|
+
switch (j.value) {
|
|
125
|
+
case l.a:
|
|
126
|
+
return {
|
|
127
|
+
...r,
|
|
128
|
+
href: t.href,
|
|
129
|
+
target: t.target,
|
|
130
|
+
rel: t.rel
|
|
131
|
+
};
|
|
132
|
+
case l.routerLink:
|
|
133
|
+
case l.nuxtLink:
|
|
134
|
+
return {
|
|
135
|
+
...r,
|
|
136
|
+
to: t.to,
|
|
137
|
+
target: t.target
|
|
138
|
+
};
|
|
139
|
+
default:
|
|
140
|
+
return {
|
|
141
|
+
...r,
|
|
142
|
+
type: t.type,
|
|
143
|
+
disabled: t.disabled
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
}), B = (r) => {
|
|
147
|
+
if (t.disabled) {
|
|
148
|
+
r.preventDefault();
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
s == null || s.emit("click", r), u("click", r);
|
|
152
|
+
}, R = (r) => {
|
|
153
|
+
s == null || s.emit("mouseover", r), u("mouseover", r);
|
|
154
|
+
}, M = (r) => {
|
|
155
|
+
s == null || s.emit("mouseleave", r), u("mouseleave", r);
|
|
156
|
+
};
|
|
157
|
+
return (r, me) => (O(), D(W(i(j)), h(i(L), {
|
|
158
|
+
ref_key: "element",
|
|
159
|
+
ref: a,
|
|
160
|
+
class: {
|
|
161
|
+
active: r.active,
|
|
162
|
+
pressed: i(S),
|
|
163
|
+
disabled: r.disabled
|
|
164
|
+
},
|
|
165
|
+
onClickPassive: B,
|
|
166
|
+
onMouseoverPassive: R,
|
|
167
|
+
onMouseleavePassive: M
|
|
168
|
+
}), {
|
|
169
|
+
default: b(() => [
|
|
170
|
+
k(r.$slots, "default", {}, () => [
|
|
171
|
+
A(J(r.label), 1)
|
|
172
|
+
])
|
|
173
|
+
]),
|
|
174
|
+
_: 3
|
|
175
|
+
}, 16, ["class"]));
|
|
176
|
+
}
|
|
177
|
+
});
|
|
178
|
+
function de({
|
|
179
|
+
expanded: e
|
|
180
|
+
}) {
|
|
181
|
+
K($, {
|
|
182
|
+
role: C.menuitem,
|
|
183
|
+
expanded: e
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
const fe = {
|
|
187
|
+
name: "VvDropdownItem"
|
|
188
|
+
}, pe = /* @__PURE__ */ g({
|
|
189
|
+
...fe,
|
|
190
|
+
setup(e) {
|
|
191
|
+
const { role: n, expanded: u } = ue(), t = I(null);
|
|
192
|
+
de({ expanded: u });
|
|
193
|
+
const o = G(t), { focused: a } = z(t), { focused: c } = H(t);
|
|
194
|
+
return N(o, (s) => {
|
|
195
|
+
s && (a.value = !0);
|
|
196
|
+
}), (s, d) => (O(), T("li", h({ role: i(n) }, {
|
|
197
|
+
ref_key: "element",
|
|
198
|
+
ref: t,
|
|
199
|
+
class: ["vv-dropdown__item", { "focus-visible": i(a) || i(c) }]
|
|
200
|
+
}), [
|
|
201
|
+
k(s.$slots, "default")
|
|
202
|
+
], 16));
|
|
203
|
+
}
|
|
204
|
+
});
|
|
205
|
+
function ve(e, n, u) {
|
|
206
|
+
return f(() => {
|
|
207
|
+
const t = {
|
|
208
|
+
[e]: !0
|
|
209
|
+
}, o = typeof (n == null ? void 0 : n.value) == "string" ? n.value.split(" ") : n == null ? void 0 : n.value;
|
|
210
|
+
return o && Array.isArray(o) && o.forEach((a) => {
|
|
211
|
+
t[`${e}--${a}`] = !0;
|
|
212
|
+
}), u && Object.keys(u.value).forEach((a) => {
|
|
213
|
+
t[`${e}--${a}`] = i(u.value[a]);
|
|
214
|
+
}), t;
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
const be = {
|
|
218
|
+
name: "VvDropdownAction"
|
|
219
|
+
}, Oe = /* @__PURE__ */ g({
|
|
220
|
+
...be,
|
|
221
|
+
props: {
|
|
222
|
+
...w,
|
|
223
|
+
...re
|
|
224
|
+
},
|
|
225
|
+
setup(e) {
|
|
226
|
+
const n = e, { modifiers: u } = Y(n), t = ve("vv-dropdown-action", u);
|
|
227
|
+
return (o, a) => (O(), D(pe, null, {
|
|
228
|
+
default: b(() => [
|
|
229
|
+
F(ce, h({
|
|
230
|
+
disabled: o.disabled,
|
|
231
|
+
pressed: o.pressed,
|
|
232
|
+
active: o.active,
|
|
233
|
+
type: o.type,
|
|
234
|
+
to: o.to,
|
|
235
|
+
href: o.href,
|
|
236
|
+
target: o.target,
|
|
237
|
+
rel: o.rel
|
|
238
|
+
}, { class: i(t) }), {
|
|
239
|
+
default: b(() => [
|
|
240
|
+
k(o.$slots, "default")
|
|
241
|
+
]),
|
|
242
|
+
_: 3
|
|
243
|
+
}, 16, ["class"])
|
|
244
|
+
]),
|
|
245
|
+
_: 3
|
|
246
|
+
}));
|
|
247
|
+
}
|
|
248
|
+
});
|
|
249
|
+
export {
|
|
250
|
+
Oe as default
|
|
251
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(t,c){typeof exports=="object"&&typeof module<"u"?module.exports=c(require("vue"),require("mitt"),require("@vueuse/core")):typeof define=="function"&&define.amd?define(["vue","mitt","@vueuse/core"],c):(t=typeof globalThis<"u"?globalThis:t||self,t.VvDropdownAction=c(t.vue,null,t.core))})(this,function(t,c,p){"use strict";var b=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(b||{}),g=(e=>(e.topStart="top-start",e.topEnd="top-end",e.bottomStart="bottom-start",e.bottomEnd="bottom-end",e.leftStart="left-start",e.leftEnd="left-end",e.rightStart="right-start",e.rightEnd="right-end",e))(g||{}),m=(e=>(e.before="before",e.after="after",e))(m||{}),_=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(_||{}),u=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(u||{}),h=(e=>(e.button="button",e.link="link",e.menuitem="menuitem",e))(h||{}),k=(e=>(e._blank="_blank",e._self="_self",e._parent="_parent",e._top="_top",e))(k||{});const C=Symbol.for("volver"),D=Symbol.for("dropdownTrigger"),I=Symbol.for("dropdownItem"),v=Symbol.for("dropdownAction"),N={to:{type:[String,Object]},href:String,target:{type:String,validator:e=>Object.values(k).includes(e)},rel:{type:String,default:"noopener noreferrer"}},w={disabled:Boolean},E={active:Boolean},P={pressed:Boolean},$={label:[String,Number]},B={modifiers:[String,Array]};m.before,b.bottom;const O={...w,...$,...P,...E,...N,type:{type:String,default:_.button,validator:e=>Object.values(_).includes(e)}},V=["click","mouseover","mouseleave"],L=O;function R(){return t.inject(C)}function M(){return t.inject(D,{})}function A(){return t.inject(I,{})}function T(){return t.inject(v,{})}const W={name:"VvAction"},J=t.defineComponent({...W,props:L,emits:V,setup(e,{expose:s,emit:i}){const r=e,n=R(),l=t.ref(null);s({$el:l});const{reference:d,bus:a,aria:f,expanded:y}=M();t.watch(()=>l.value,o=>{d&&(d.value=o)});const j=t.computed(()=>r.pressed||(y==null?void 0:y.value)),{role:z}=T(),S=t.computed(()=>{switch(!0){case r.disabled:return u.button;case r.to!==void 0:return n!=null&&n.nuxt?u.nuxtLink:u.routerLink;case r.href!==void 0:return u.a;default:return u.button}}),H=t.computed(()=>{const o={...f==null?void 0:f.value,"aria-pressed":j.value?!0:void 0,role:z};switch(S.value){case u.a:return{...o,href:r.href,target:r.target,rel:r.rel};case u.routerLink:case u.nuxtLink:return{...o,to:r.to,target:r.target};default:return{...o,type:r.type,disabled:r.disabled}}}),Q=o=>{if(r.disabled){o.preventDefault();return}a==null||a.emit("click",o),i("click",o)},U=o=>{a==null||a.emit("mouseover",o),i("mouseover",o)},X=o=>{a==null||a.emit("mouseleave",o),i("mouseleave",o)};return(o,x)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(t.unref(S)),t.mergeProps(t.unref(H),{ref_key:"element",ref:l,class:{active:o.active,pressed:t.unref(j),disabled:o.disabled},onClickPassive:Q,onMouseoverPassive:U,onMouseleavePassive:X}),{default:t.withCtx(()=>[t.renderSlot(o.$slots,"default",{},()=>[t.createTextVNode(t.toDisplayString(o.label),1)])]),_:3},16,["class"]))}});function K({expanded:e}){t.provide(v,{role:h.menuitem,expanded:e})}const Y={name:"VvDropdownItem"},q=t.defineComponent({...Y,setup(e){const{role:s,expanded:i}=A(),r=t.ref(null);K({expanded:i});const n=p.useElementHover(r),{focused:l}=p.useFocus(r),{focused:d}=p.useFocusWithin(r);return t.watch(n,a=>{a&&(l.value=!0)}),(a,f)=>(t.openBlock(),t.createElementBlock("li",t.mergeProps({role:t.unref(s)},{ref_key:"element",ref:r,class:["vv-dropdown__item",{"focus-visible":t.unref(l)||t.unref(d)}]}),[t.renderSlot(a.$slots,"default")],16))}});function F(e,s,i){return t.computed(()=>{const r={[e]:!0},n=typeof(s==null?void 0:s.value)=="string"?s.value.split(" "):s==null?void 0:s.value;return n&&Array.isArray(n)&&n.forEach(l=>{r[`${e}--${l}`]=!0}),i&&Object.keys(i.value).forEach(l=>{r[`${e}--${l}`]=t.unref(i.value[l])}),r})}const G={name:"VvDropdownAction"};return t.defineComponent({...G,props:{...O,...B},setup(e){const s=e,{modifiers:i}=t.toRefs(s),r=F("vv-dropdown-action",i);return(n,l)=>(t.openBlock(),t.createBlock(q,null,{default:t.withCtx(()=>[t.createVNode(J,t.mergeProps({disabled:n.disabled,pressed:n.pressed,active:n.active,type:n.type,to:n.to,href:n.href,target:n.target,rel:n.rel},{class:t.unref(r)}),{default:t.withCtx(()=>[t.renderSlot(n.$slots,"default")]),_:3},16,["class"])]),_:3}))}})});
|
|
@@ -1,23 +1,38 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { inject as d, provide as l, defineComponent as f, ref as p, watch as _, openBlock as a, createElementBlock as v, mergeProps as I, unref as t, renderSlot as w } from "vue";
|
|
2
|
+
import "mitt";
|
|
3
|
+
import { useElementHover as D, useFocus as E, useFocusWithin as N } from "@vueuse/core";
|
|
4
|
+
var u = /* @__PURE__ */ ((e) => (e.button = "button", e.link = "link", e.menuitem = "menuitem", e))(u || {});
|
|
5
|
+
const O = Symbol.for("dropdownItem"), b = Symbol.for("dropdownAction");
|
|
6
|
+
function h() {
|
|
7
|
+
return d(O, {});
|
|
8
|
+
}
|
|
9
|
+
function k({
|
|
10
|
+
expanded: e
|
|
11
|
+
}) {
|
|
12
|
+
l(b, {
|
|
13
|
+
role: u.menuitem,
|
|
14
|
+
expanded: e
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
const C = {
|
|
3
18
|
name: "VvDropdownItem"
|
|
4
|
-
},
|
|
5
|
-
...
|
|
6
|
-
setup(
|
|
7
|
-
const { role: s, expanded:
|
|
8
|
-
|
|
9
|
-
const
|
|
10
|
-
return
|
|
11
|
-
|
|
12
|
-
}), (
|
|
19
|
+
}, S = /* @__PURE__ */ f({
|
|
20
|
+
...C,
|
|
21
|
+
setup(e) {
|
|
22
|
+
const { role: s, expanded: c } = h(), o = p(null);
|
|
23
|
+
k({ expanded: c });
|
|
24
|
+
const m = D(o), { focused: r } = E(o), { focused: i } = N(o);
|
|
25
|
+
return _(m, (n) => {
|
|
26
|
+
n && (r.value = !0);
|
|
27
|
+
}), (n, P) => (a(), v("li", I({ role: t(s) }, {
|
|
13
28
|
ref_key: "element",
|
|
14
|
-
ref:
|
|
15
|
-
class: ["vv-dropdown__item", { "focus-visible": t(
|
|
29
|
+
ref: o,
|
|
30
|
+
class: ["vv-dropdown__item", { "focus-visible": t(r) || t(i) }]
|
|
16
31
|
}), [
|
|
17
|
-
|
|
32
|
+
w(n.$slots, "default")
|
|
18
33
|
], 16));
|
|
19
34
|
}
|
|
20
35
|
});
|
|
21
36
|
export {
|
|
22
|
-
|
|
37
|
+
S as default
|
|
23
38
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,
|
|
1
|
+
(function(e,t){typeof exports=="object"&&typeof module<"u"?module.exports=t(require("vue"),require("mitt"),require("@vueuse/core")):typeof define=="function"&&define.amd?define(["vue","mitt","@vueuse/core"],t):(e=typeof globalThis<"u"?globalThis:e||self,e.VvDropdownItem=t(e.vue,null,e.core))})(this,function(e,t,r){"use strict";var u=(n=>(n.button="button",n.link="link",n.menuitem="menuitem",n))(u||{});const d=Symbol.for("dropdownItem"),c=Symbol.for("dropdownAction");function f(){return e.inject(d,{})}function m({expanded:n}){e.provide(c,{role:u.menuitem,expanded:n})}const l={name:"VvDropdownItem"};return e.defineComponent({...l,setup(n){const{role:p,expanded:_}=f(),o=e.ref(null);m({expanded:_});const I=r.useElementHover(o),{focused:s}=r.useFocus(o),{focused:a}=r.useFocusWithin(o);return e.watch(I,i=>{i&&(s.value=!0)}),(i,w)=>(e.openBlock(),e.createElementBlock("li",e.mergeProps({role:e.unref(p)},{ref_key:"element",ref:o,class:["vv-dropdown__item",{"focus-visible":e.unref(s)||e.unref(a)}]}),[e.renderSlot(i.$slots,"default")],16))}})});
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import { inject as B, provide as E, defineComponent as y, ref as N, watch as w, openBlock as s, createElementBlock as i, mergeProps as k, unref as a, renderSlot as u, computed as g, toRefs as C, createBlock as D, normalizeClass as I, withCtx as P, createElementVNode as $, normalizeProps as L, guardReactiveProps as H, Fragment as f, createTextVNode as m, toDisplayString as v, createCommentVNode as V } from "vue";
|
|
2
|
+
import "mitt";
|
|
3
|
+
import { useElementHover as W, useFocus as F, useFocusWithin as z } from "@vueuse/core";
|
|
4
|
+
var c = /* @__PURE__ */ ((e) => (e.left = "left", e.right = "right", e.top = "top", e.bottom = "bottom", e))(c || {}), _ = /* @__PURE__ */ ((e) => (e.topStart = "top-start", e.topEnd = "top-end", e.bottomStart = "bottom-start", e.bottomEnd = "bottom-end", e.leftStart = "left-start", e.leftEnd = "left-end", e.rightStart = "right-start", e.rightEnd = "right-end", e))(_ || {}), p = /* @__PURE__ */ ((e) => (e.before = "before", e.after = "after", e))(p || {}), b = /* @__PURE__ */ ((e) => (e.button = "button", e.submit = "submit", e.reset = "reset", e))(b || {}), O = /* @__PURE__ */ ((e) => (e.button = "button", e.link = "link", e.menuitem = "menuitem", e))(O || {}), S = /* @__PURE__ */ ((e) => (e._blank = "_blank", e._self = "_self", e._parent = "_parent", e._top = "_top", e))(S || {});
|
|
5
|
+
const A = Symbol.for("dropdownItem"), M = Symbol.for("dropdownAction");
|
|
6
|
+
function R() {
|
|
7
|
+
return B(A, {});
|
|
8
|
+
}
|
|
9
|
+
function J({
|
|
10
|
+
expanded: e
|
|
11
|
+
}) {
|
|
12
|
+
E(M, {
|
|
13
|
+
role: O.menuitem,
|
|
14
|
+
expanded: e
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
const K = {
|
|
18
|
+
name: "VvDropdownItem"
|
|
19
|
+
}, Y = /* @__PURE__ */ y({
|
|
20
|
+
...K,
|
|
21
|
+
setup(e) {
|
|
22
|
+
const { role: o, expanded: l } = R(), n = N(null);
|
|
23
|
+
J({ expanded: l });
|
|
24
|
+
const t = W(n), { focused: r } = F(n), { focused: j } = z(n);
|
|
25
|
+
return w(t, (d) => {
|
|
26
|
+
d && (r.value = !0);
|
|
27
|
+
}), (d, oe) => (s(), i("li", k({ role: a(o) }, {
|
|
28
|
+
ref_key: "element",
|
|
29
|
+
ref: n,
|
|
30
|
+
class: ["vv-dropdown__item", { "focus-visible": a(r) || a(j) }]
|
|
31
|
+
}), [
|
|
32
|
+
u(d.$slots, "default")
|
|
33
|
+
], 16));
|
|
34
|
+
}
|
|
35
|
+
}), U = {
|
|
36
|
+
/**
|
|
37
|
+
* The router-link/nuxt-link property, if it is defined the button is rendered as a ruouter-link or nuxt-link.
|
|
38
|
+
* @see Documentation of [router-link](https://router.vuejs.org/api/#router-link) and [nuxt-link](https://nuxtjs.org/api/components-nuxt-link/)
|
|
39
|
+
*/
|
|
40
|
+
to: {
|
|
41
|
+
type: [String, Object]
|
|
42
|
+
},
|
|
43
|
+
/**
|
|
44
|
+
* Anchor href
|
|
45
|
+
*/
|
|
46
|
+
href: String,
|
|
47
|
+
/**
|
|
48
|
+
* Anchor target
|
|
49
|
+
*/
|
|
50
|
+
target: {
|
|
51
|
+
type: String,
|
|
52
|
+
validator: (e) => Object.values(S).includes(e)
|
|
53
|
+
},
|
|
54
|
+
/**
|
|
55
|
+
* Anchor rel
|
|
56
|
+
*/
|
|
57
|
+
rel: {
|
|
58
|
+
type: String,
|
|
59
|
+
default: "noopener noreferrer"
|
|
60
|
+
}
|
|
61
|
+
}, h = {
|
|
62
|
+
/**
|
|
63
|
+
* Whether the form control is disabled
|
|
64
|
+
*/
|
|
65
|
+
disabled: Boolean
|
|
66
|
+
}, q = {
|
|
67
|
+
/**
|
|
68
|
+
* Whether the item is selected
|
|
69
|
+
*/
|
|
70
|
+
selected: Boolean
|
|
71
|
+
}, G = {
|
|
72
|
+
/**
|
|
73
|
+
* Whether the item is active
|
|
74
|
+
*/
|
|
75
|
+
active: Boolean
|
|
76
|
+
}, Q = {
|
|
77
|
+
/**
|
|
78
|
+
* Whether the item is pressed
|
|
79
|
+
*/
|
|
80
|
+
pressed: Boolean
|
|
81
|
+
}, T = {
|
|
82
|
+
/**
|
|
83
|
+
* The item label
|
|
84
|
+
*/
|
|
85
|
+
label: [String, Number]
|
|
86
|
+
}, X = {
|
|
87
|
+
/**
|
|
88
|
+
* Component BEM modifiers
|
|
89
|
+
*/
|
|
90
|
+
modifiers: [String, Array]
|
|
91
|
+
};
|
|
92
|
+
p.before;
|
|
93
|
+
const Z = {
|
|
94
|
+
/**
|
|
95
|
+
* If true the input will be unselectable
|
|
96
|
+
*/
|
|
97
|
+
unselectable: { type: Boolean, default: !0 }
|
|
98
|
+
};
|
|
99
|
+
c.bottom;
|
|
100
|
+
({
|
|
101
|
+
...h,
|
|
102
|
+
...T,
|
|
103
|
+
...Q,
|
|
104
|
+
...G,
|
|
105
|
+
...U,
|
|
106
|
+
/**
|
|
107
|
+
* Button type
|
|
108
|
+
*/
|
|
109
|
+
type: b.button
|
|
110
|
+
});
|
|
111
|
+
function x(e, o, l) {
|
|
112
|
+
return g(() => {
|
|
113
|
+
const n = {
|
|
114
|
+
[e]: !0
|
|
115
|
+
}, t = typeof (o == null ? void 0 : o.value) == "string" ? o.value.split(" ") : o == null ? void 0 : o.value;
|
|
116
|
+
return t && Array.isArray(t) && t.forEach((r) => {
|
|
117
|
+
n[`${e}--${r}`] = !0;
|
|
118
|
+
}), l && Object.keys(l.value).forEach((r) => {
|
|
119
|
+
n[`${e}--${r}`] = a(l.value[r]);
|
|
120
|
+
}), n;
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
const ee = { class: "vv-dropdown-option__hint" }, te = {
|
|
124
|
+
name: "VvDropdownOption"
|
|
125
|
+
}, ae = /* @__PURE__ */ y({
|
|
126
|
+
...te,
|
|
127
|
+
props: {
|
|
128
|
+
...h,
|
|
129
|
+
...q,
|
|
130
|
+
...Z,
|
|
131
|
+
...X,
|
|
132
|
+
deselectHintLabel: {
|
|
133
|
+
type: String
|
|
134
|
+
},
|
|
135
|
+
selectHintLabel: {
|
|
136
|
+
type: String
|
|
137
|
+
},
|
|
138
|
+
selectedHintLabel: {
|
|
139
|
+
type: String
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
setup(e) {
|
|
143
|
+
const o = e, { modifiers: l } = C(o), n = x(
|
|
144
|
+
"vv-dropdown-option",
|
|
145
|
+
l,
|
|
146
|
+
g(() => ({
|
|
147
|
+
disabled: o.disabled,
|
|
148
|
+
selected: o.selected,
|
|
149
|
+
unselectable: o.unselectable && o.selected
|
|
150
|
+
}))
|
|
151
|
+
);
|
|
152
|
+
return (t, r) => (s(), D(Y, {
|
|
153
|
+
class: I(a(n)),
|
|
154
|
+
tabindex: t.disabled ? -1 : 0,
|
|
155
|
+
"aria-selected": t.selected,
|
|
156
|
+
"aria-disabled": t.disabled
|
|
157
|
+
}, {
|
|
158
|
+
default: P(() => [
|
|
159
|
+
u(t.$slots, "default"),
|
|
160
|
+
$("span", ee, [
|
|
161
|
+
u(t.$slots, "hint", L(H({ disabled: t.disabled, selected: t.selected, unselectable: t.unselectable })), () => [
|
|
162
|
+
t.selected ? (s(), i(f, { key: 0 }, [
|
|
163
|
+
m(v(t.unselectable ? e.deselectHintLabel : e.selectedHintLabel), 1)
|
|
164
|
+
], 64)) : t.disabled ? V("", !0) : (s(), i(f, { key: 1 }, [
|
|
165
|
+
m(v(e.selectHintLabel), 1)
|
|
166
|
+
], 64))
|
|
167
|
+
])
|
|
168
|
+
])
|
|
169
|
+
]),
|
|
170
|
+
_: 3
|
|
171
|
+
}, 8, ["class", "tabindex", "aria-selected", "aria-disabled"]));
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
export {
|
|
175
|
+
ae as default
|
|
176
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(t,a){typeof exports=="object"&&typeof module<"u"?module.exports=a(require("vue"),require("mitt"),require("@vueuse/core")):typeof define=="function"&&define.amd?define(["vue","mitt","@vueuse/core"],a):(t=typeof globalThis<"u"?globalThis:t||self,t.VvDropdownOption=a(t.vue,null,t.core))})(this,function(t,a,i){"use strict";var d=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(d||{}),f=(e=>(e.topStart="top-start",e.topEnd="top-end",e.bottomStart="bottom-start",e.bottomEnd="bottom-end",e.leftStart="left-start",e.leftEnd="left-end",e.rightStart="right-start",e.rightEnd="right-end",e))(f||{}),c=(e=>(e.before="before",e.after="after",e))(c||{}),u=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(u||{}),b=(e=>(e.button="button",e.link="link",e.menuitem="menuitem",e))(b||{}),m=(e=>(e._blank="_blank",e._self="_self",e._parent="_parent",e._top="_top",e))(m||{});const g=Symbol.for("dropdownItem"),S=Symbol.for("dropdownAction");function _(){return t.inject(g,{})}function O({expanded:e}){t.provide(S,{role:b.menuitem,expanded:e})}const B={name:"VvDropdownItem"},h=t.defineComponent({...B,setup(e){const{role:o,expanded:s}=_(),r=t.ref(null);O({expanded:s});const n=i.useElementHover(r),{focused:l}=i.useFocus(r),{focused:L}=i.useFocusWithin(r);return t.watch(n,p=>{p&&(l.value=!0)}),(p,V)=>(t.openBlock(),t.createElementBlock("li",t.mergeProps({role:t.unref(o)},{ref_key:"element",ref:r,class:["vv-dropdown__item",{"focus-visible":t.unref(l)||t.unref(L)}]}),[t.renderSlot(p.$slots,"default")],16))}}),j={to:{type:[String,Object]},href:String,target:{type:String,validator:e=>Object.values(m).includes(e)},rel:{type:String,default:"noopener noreferrer"}},y={disabled:Boolean},k={selected:Boolean},E={active:Boolean},N={pressed:Boolean},w={label:[String,Number]},D={modifiers:[String,Array]};c.before;const C={unselectable:{type:Boolean,default:!0}};d.bottom,{...y,...w,...N,...E,...j,type:u.button};function I(e,o,s){return t.computed(()=>{const r={[e]:!0},n=typeof(o==null?void 0:o.value)=="string"?o.value.split(" "):o==null?void 0:o.value;return n&&Array.isArray(n)&&n.forEach(l=>{r[`${e}--${l}`]=!0}),s&&Object.keys(s.value).forEach(l=>{r[`${e}--${l}`]=t.unref(s.value[l])}),r})}const P={class:"vv-dropdown-option__hint"},$={name:"VvDropdownOption"};return t.defineComponent({...$,props:{...y,...k,...C,...D,deselectHintLabel:{type:String},selectHintLabel:{type:String},selectedHintLabel:{type:String}},setup(e){const o=e,{modifiers:s}=t.toRefs(o),r=I("vv-dropdown-option",s,t.computed(()=>({disabled:o.disabled,selected:o.selected,unselectable:o.unselectable&&o.selected})));return(n,l)=>(t.openBlock(),t.createBlock(h,{class:t.normalizeClass(t.unref(r)),tabindex:n.disabled?-1:0,"aria-selected":n.selected,"aria-disabled":n.disabled},{default:t.withCtx(()=>[t.renderSlot(n.$slots,"default"),t.createElementVNode("span",P,[t.renderSlot(n.$slots,"hint",t.normalizeProps(t.guardReactiveProps({disabled:n.disabled,selected:n.selected,unselectable:n.unselectable})),()=>[n.selected?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createTextVNode(t.toDisplayString(n.unselectable?e.deselectHintLabel:e.selectedHintLabel),1)],64)):n.disabled?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createTextVNode(t.toDisplayString(e.selectHintLabel),1)],64))])])]),_:3},8,["class","tabindex","aria-selected","aria-disabled"]))}})});
|