@volverjs/ui-vue 0.0.9-beta.2 → 0.0.9-beta.21
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 +3 -3
- package/auto-imports.d.ts +2 -0
- package/dist/components/VvAccordion/VvAccordion.es.js +15 -7
- package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +15 -7
- package/dist/components/VvAction/VvAction.es.js +17 -8
- package/dist/components/VvAction/VvAction.umd.js +1 -1
- package/dist/components/VvAction/VvAction.vue.d.ts +9 -0
- package/dist/components/VvAction/index.d.ts +4 -0
- package/dist/components/VvAlert/VvAlert.es.js +22 -13
- package/dist/components/VvAlert/VvAlert.umd.js +1 -1
- package/dist/components/VvAlert/VvAlert.vue.d.ts +6 -6
- package/dist/components/VvAlert/index.d.ts +3 -3
- package/dist/components/VvAlertGroup/VvAlertGroup.es.js +22 -13
- package/dist/components/VvAlertGroup/VvAlertGroup.umd.js +1 -1
- package/dist/components/VvAlertGroup/VvAlertGroup.vue.d.ts +6 -6
- package/dist/components/VvAlertGroup/index.d.ts +2 -2
- package/dist/components/VvAvatar/VvAvatar.es.js +15 -7
- package/dist/components/VvAvatarGroup/VvAvatarGroup.es.js +15 -7
- package/dist/components/VvBadge/VvBadge.es.js +15 -7
- package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +15 -7
- package/dist/components/VvButton/VvButton.es.js +19 -9
- package/dist/components/VvButton/VvButton.umd.js +1 -1
- package/dist/components/VvButton/VvButton.vue.d.ts +9 -0
- package/dist/components/VvButton/index.d.ts +4 -0
- package/dist/components/VvButtonGroup/VvButtonGroup.es.js +15 -7
- package/dist/components/VvCard/VvCard.es.js +15 -7
- package/dist/components/VvCheckbox/VvCheckbox.es.js +99 -21
- package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -1
- package/dist/components/VvCheckbox/VvCheckbox.vue.d.ts +4 -4
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +105 -22
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.vue.d.ts +4 -4
- package/dist/components/VvCombobox/VvCombobox.es.js +256 -191
- package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
- package/dist/components/VvCombobox/VvCombobox.vue.d.ts +329 -101
- package/dist/components/VvCombobox/index.d.ts +123 -37
- package/dist/components/VvDialog/VvDialog.es.js +50 -37
- package/dist/components/VvDialog/VvDialog.umd.js +1 -1
- package/dist/components/VvDropdown/VvDropdown.es.js +32 -18
- package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
- package/dist/components/VvDropdown/VvDropdown.vue.d.ts +300 -92
- package/dist/components/VvDropdown/VvDropdownAction.vue.d.ts +9 -0
- package/dist/components/VvDropdown/index.d.ts +99 -30
- package/dist/components/VvDropdownAction/VvDropdownAction.es.js +17 -8
- package/dist/components/VvDropdownAction/VvDropdownAction.umd.js +1 -1
- package/dist/components/VvDropdownOptgroup/VvDropdownOptgroup.es.js +15 -7
- package/dist/components/VvDropdownOption/VvDropdownOption.es.js +15 -7
- package/dist/components/VvInputText/VvInputText.es.js +279 -116
- package/dist/components/VvInputText/VvInputText.umd.js +1 -1
- package/dist/components/VvInputText/VvInputText.vue.d.ts +23 -41
- package/dist/components/VvInputText/index.d.ts +15 -33
- package/dist/components/VvNav/VvNav.es.js +18 -9
- package/dist/components/VvNav/VvNav.umd.js +1 -1
- package/dist/components/VvNav/index.d.ts +1 -1
- package/dist/components/VvProgress/VvProgress.es.js +15 -7
- package/dist/components/VvRadio/VvRadio.es.js +99 -21
- package/dist/components/VvRadio/VvRadio.umd.js +1 -1
- package/dist/components/VvRadio/VvRadio.vue.d.ts +4 -4
- package/dist/components/VvRadioGroup/VvRadioGroup.es.js +105 -22
- package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
- package/dist/components/VvRadioGroup/VvRadioGroup.vue.d.ts +4 -4
- package/dist/components/VvSelect/VvSelect.es.js +95 -21
- package/dist/components/VvSelect/VvSelect.umd.js +1 -1
- package/dist/components/VvSelect/VvSelect.vue.d.ts +5 -5
- package/dist/components/VvTab/VvTab.es.js +18 -9
- package/dist/components/VvTab/VvTab.umd.js +1 -1
- package/dist/components/VvTextarea/VvTextarea.es.js +103 -26
- package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
- package/dist/components/VvTextarea/VvTextarea.vue.d.ts +4 -4
- package/dist/components/VvTooltip/VvTooltip.es.js +15 -7
- package/dist/components/common/HintSlot.d.ts +4 -3
- package/dist/components/index.d.ts +5 -0
- package/dist/components/index.es.js +1212 -626
- package/dist/components/index.umd.js +1 -1
- package/dist/composables/alert/useAlert.d.ts +27 -0
- package/dist/composables/index.d.ts +1 -0
- package/dist/composables/index.es.js +81 -0
- package/dist/composables/index.umd.js +1 -0
- package/dist/constants.d.ts +14 -0
- package/dist/directives/index.es.js +15 -7
- package/dist/directives/v-tooltip.es.js +15 -7
- package/dist/icons.es.js +3 -3
- package/dist/icons.umd.js +1 -1
- package/dist/props/index.d.ts +107 -31
- package/dist/resolvers/unplugin.es.js +3 -0
- package/dist/resolvers/unplugin.umd.js +1 -1
- package/dist/stories/AccordionGroup/AccordionGroup.stories.d.ts +2 -2
- package/dist/stories/AccordionGroup/AccordionGroupSlots.stories.d.ts +54 -269
- package/dist/stories/Alert/Alert.settings.d.ts +3 -7
- package/dist/stories/AlertGroup/AlertGroupSlots.stories.d.ts +2 -2
- package/dist/stories/AlertGroup/AlertGroupWithComposable.stories.d.ts +6 -0
- package/dist/stories/Button/Button.settings.d.ts +3 -13
- package/dist/stories/Combobox/Combobox.settings.d.ts +117 -19
- package/dist/stories/InputText/InputText.settings.d.ts +31 -9
- package/dist/stories/InputText/InputText.stories.d.ts +0 -1
- package/dist/stories/InputText/InputTextMask.stories.d.ts +12 -0
- package/dist/stories/Nav/Nav.settings.d.ts +3 -21
- package/package.json +75 -66
- 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 +2 -1
- package/src/components/VvAlert/VvAlert.vue +5 -1
- package/src/components/VvAlert/index.ts +3 -3
- package/src/components/VvAlertGroup/VvAlertGroup.vue +2 -0
- package/src/components/VvButton/VvButton.vue +1 -0
- package/src/components/VvCheckbox/VvCheckbox.vue +8 -1
- package/src/components/VvCheckboxGroup/VvCheckboxGroup.vue +8 -1
- package/src/components/VvCombobox/VvCombobox.vue +43 -23
- package/src/components/VvCombobox/index.ts +24 -0
- package/src/components/VvDialog/VvDialog.vue +22 -19
- package/src/components/VvDropdown/VvDropdown.vue +24 -18
- package/src/components/VvInputText/VvInputText.vue +177 -55
- package/src/components/VvInputText/index.ts +32 -34
- package/src/components/VvNav/VvNav.vue +1 -1
- package/src/components/VvNav/index.ts +1 -1
- package/src/components/VvRadio/VvRadio.vue +8 -1
- package/src/components/VvRadioGroup/VvRadioGroup.vue +8 -1
- package/src/components/VvSelect/VvSelect.vue +8 -1
- package/src/components/VvTextarea/VvTextarea.vue +16 -6
- package/src/components/common/HintSlot.ts +26 -13
- package/src/components/index.ts +5 -0
- package/src/composables/alert/useAlert.ts +103 -0
- package/src/composables/index.ts +1 -0
- package/src/constants.ts +26 -0
- package/src/props/index.ts +14 -11
- package/src/resolvers/unplugin.ts +3 -0
- package/src/stories/Alert/Alert.settings.ts +3 -1
- package/src/stories/AlertGroup/AlertGroup.test.ts +13 -0
- package/src/stories/AlertGroup/AlertGroupSlots.stories.ts +3 -3
- package/src/stories/AlertGroup/AlertGroupWithComposable.stories.ts +118 -0
- package/src/stories/Button/Button.settings.ts +5 -3
- package/src/stories/Combobox/Combobox.settings.ts +119 -2
- package/src/stories/Combobox/Combobox.test.ts +1 -1
- package/src/stories/InputText/InputText.settings.ts +36 -15
- package/src/stories/InputText/InputText.stories.ts +4 -12
- package/src/stories/InputText/InputText.test.ts +31 -15
- package/src/stories/InputText/InputTextMask.stories.ts +122 -0
- package/src/stories/Nav/Nav.settings.ts +3 -1
- package/src/stories/Tab/Tab.stories.ts +3 -3
- package/src/stories/Textarea/TextareaLength.stories.ts +1 -1
- package/src/types/alert.d.ts +20 -0
- /package/dist/components/{VvNavItemTitle → VvNav}/VvNavItemTitle.vue.d.ts +0 -0
- /package/dist/components/{VvNavSeparator → VvNav}/VvNavSeparator.d.ts +0 -0
- /package/src/components/{VvNavItemTitle → VvNav}/VvNavItemTitle.vue +0 -0
- /package/src/components/{VvNavSeparator → VvNav}/VvNavSeparator.ts +0 -0
|
@@ -30,9 +30,9 @@ export declare const VvDropdownProps: {
|
|
|
30
30
|
validator: (value: never) => boolean;
|
|
31
31
|
};
|
|
32
32
|
strategy: {
|
|
33
|
-
type: PropType<"
|
|
34
|
-
default:
|
|
35
|
-
validator: (value: "
|
|
33
|
+
type: PropType<"absolute" | "fixed">;
|
|
34
|
+
default: undefined;
|
|
35
|
+
validator: (value: import("../../constants").Strategy) => boolean;
|
|
36
36
|
};
|
|
37
37
|
transitionName: {
|
|
38
38
|
type: StringConstructor;
|
|
@@ -42,33 +42,94 @@ export declare const VvDropdownProps: {
|
|
|
42
42
|
default: number;
|
|
43
43
|
};
|
|
44
44
|
shift: {
|
|
45
|
-
type: PropType<boolean |
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
45
|
+
type: PropType<boolean | {
|
|
46
|
+
mainAxis?: boolean | undefined;
|
|
47
|
+
crossAxis?: boolean | undefined;
|
|
48
|
+
rootBoundary?: import("@floating-ui/core").RootBoundary | undefined;
|
|
49
|
+
elementContext?: import("@floating-ui/core").ElementContext | undefined;
|
|
50
|
+
altBoundary?: boolean | undefined;
|
|
51
|
+
padding?: import("@floating-ui/core").Padding | undefined;
|
|
52
|
+
limiter?: {
|
|
53
|
+
fn: (state: import("@floating-ui/core").MiddlewareState) => import("@floating-ui/core").Coords;
|
|
54
|
+
options?: any;
|
|
55
|
+
} | undefined;
|
|
56
|
+
boundary?: import("@floating-ui/dom").Boundary | undefined;
|
|
57
|
+
} | import("@floating-ui/dom").Derivable<{
|
|
58
|
+
mainAxis?: boolean | undefined;
|
|
59
|
+
crossAxis?: boolean | undefined;
|
|
60
|
+
rootBoundary?: import("@floating-ui/core").RootBoundary | undefined;
|
|
61
|
+
elementContext?: import("@floating-ui/core").ElementContext | undefined;
|
|
62
|
+
altBoundary?: boolean | undefined;
|
|
63
|
+
padding?: import("@floating-ui/core").Padding | undefined;
|
|
64
|
+
limiter?: {
|
|
65
|
+
fn: (state: import("@floating-ui/core").MiddlewareState) => import("@floating-ui/core").Coords;
|
|
66
|
+
options?: any;
|
|
67
|
+
} | undefined;
|
|
68
|
+
boundary?: import("@floating-ui/dom").Boundary | undefined;
|
|
51
69
|
}> | undefined>;
|
|
52
70
|
default: boolean;
|
|
53
71
|
};
|
|
54
72
|
flip: {
|
|
55
|
-
type: PropType<boolean |
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
73
|
+
type: PropType<boolean | {
|
|
74
|
+
mainAxis?: boolean | undefined;
|
|
75
|
+
crossAxis?: boolean | undefined;
|
|
76
|
+
rootBoundary?: import("@floating-ui/core").RootBoundary | undefined;
|
|
77
|
+
elementContext?: import("@floating-ui/core").ElementContext | undefined;
|
|
78
|
+
altBoundary?: boolean | undefined;
|
|
79
|
+
padding?: import("@floating-ui/core").Padding | undefined;
|
|
80
|
+
fallbackPlacements?: import("@floating-ui/core").Placement[] | undefined;
|
|
81
|
+
fallbackStrategy?: "initialPlacement" | "bestFit" | undefined;
|
|
82
|
+
fallbackAxisSideDirection?: "start" | "end" | "none" | undefined;
|
|
83
|
+
flipAlignment?: boolean | undefined;
|
|
84
|
+
boundary?: import("@floating-ui/dom").Boundary | undefined;
|
|
85
|
+
} | import("@floating-ui/dom").Derivable<{
|
|
86
|
+
mainAxis?: boolean | undefined;
|
|
87
|
+
crossAxis?: boolean | undefined;
|
|
88
|
+
rootBoundary?: import("@floating-ui/core").RootBoundary | undefined;
|
|
89
|
+
elementContext?: import("@floating-ui/core").ElementContext | undefined;
|
|
90
|
+
altBoundary?: boolean | undefined;
|
|
91
|
+
padding?: import("@floating-ui/core").Padding | undefined;
|
|
92
|
+
fallbackPlacements?: import("@floating-ui/core").Placement[] | undefined;
|
|
93
|
+
fallbackStrategy?: "initialPlacement" | "bestFit" | undefined;
|
|
94
|
+
fallbackAxisSideDirection?: "start" | "end" | "none" | undefined;
|
|
95
|
+
flipAlignment?: boolean | undefined;
|
|
96
|
+
boundary?: import("@floating-ui/dom").Boundary | undefined;
|
|
61
97
|
}> | undefined>;
|
|
62
98
|
default: boolean;
|
|
63
99
|
};
|
|
64
100
|
size: {
|
|
65
|
-
type: PropType<boolean |
|
|
66
|
-
|
|
101
|
+
type: PropType<boolean | {
|
|
102
|
+
rootBoundary?: import("@floating-ui/core").RootBoundary | undefined;
|
|
103
|
+
elementContext?: import("@floating-ui/core").ElementContext | undefined;
|
|
104
|
+
altBoundary?: boolean | undefined;
|
|
105
|
+
padding?: import("@floating-ui/core").Padding | undefined;
|
|
106
|
+
boundary?: import("@floating-ui/dom").Boundary | undefined;
|
|
107
|
+
apply?: ((args: {
|
|
67
108
|
x: number;
|
|
68
109
|
y: number;
|
|
110
|
+
initialPlacement: import("@floating-ui/core").Placement;
|
|
69
111
|
placement: import("@floating-ui/core").Placement;
|
|
70
112
|
strategy: import("@floating-ui/core").Strategy;
|
|
113
|
+
middlewareData: import("@floating-ui/core").MiddlewareData;
|
|
114
|
+
rects: import("@floating-ui/core").ElementRects;
|
|
115
|
+
platform: import("@floating-ui/core").Platform;
|
|
116
|
+
elements: import("@floating-ui/dom").Elements;
|
|
117
|
+
} & {
|
|
118
|
+
availableWidth: number;
|
|
119
|
+
availableHeight: number;
|
|
120
|
+
}) => void | Promise<void>) | undefined;
|
|
121
|
+
} | import("@floating-ui/dom").Derivable<{
|
|
122
|
+
rootBoundary?: import("@floating-ui/core").RootBoundary | undefined;
|
|
123
|
+
elementContext?: import("@floating-ui/core").ElementContext | undefined;
|
|
124
|
+
altBoundary?: boolean | undefined;
|
|
125
|
+
padding?: import("@floating-ui/core").Padding | undefined;
|
|
126
|
+
boundary?: import("@floating-ui/dom").Boundary | undefined;
|
|
127
|
+
apply?: ((args: {
|
|
128
|
+
x: number;
|
|
129
|
+
y: number;
|
|
71
130
|
initialPlacement: import("@floating-ui/core").Placement;
|
|
131
|
+
placement: import("@floating-ui/core").Placement;
|
|
132
|
+
strategy: import("@floating-ui/core").Strategy;
|
|
72
133
|
middlewareData: import("@floating-ui/core").MiddlewareData;
|
|
73
134
|
rects: import("@floating-ui/core").ElementRects;
|
|
74
135
|
platform: import("@floating-ui/core").Platform;
|
|
@@ -76,25 +137,33 @@ export declare const VvDropdownProps: {
|
|
|
76
137
|
} & {
|
|
77
138
|
availableWidth: number;
|
|
78
139
|
availableHeight: number;
|
|
79
|
-
}) => void | Promise<void
|
|
80
|
-
} & {
|
|
81
|
-
rootBoundary: import("@floating-ui/core").RootBoundary;
|
|
82
|
-
elementContext: import("@floating-ui/core").ElementContext;
|
|
83
|
-
altBoundary: boolean;
|
|
84
|
-
padding: import("@floating-ui/core").Padding;
|
|
85
|
-
boundary: import("@floating-ui/dom").Boundary;
|
|
140
|
+
}) => void | Promise<void>) | undefined;
|
|
86
141
|
}> | undefined>;
|
|
87
142
|
default: () => {
|
|
88
143
|
padding: number;
|
|
89
144
|
};
|
|
90
145
|
};
|
|
91
146
|
autoPlacement: {
|
|
92
|
-
type: PropType<boolean |
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
147
|
+
type: PropType<boolean | {
|
|
148
|
+
crossAxis?: boolean | undefined;
|
|
149
|
+
rootBoundary?: import("@floating-ui/core").RootBoundary | undefined;
|
|
150
|
+
elementContext?: import("@floating-ui/core").ElementContext | undefined;
|
|
151
|
+
altBoundary?: boolean | undefined;
|
|
152
|
+
padding?: import("@floating-ui/core").Padding | undefined;
|
|
153
|
+
alignment?: import("@floating-ui/core").Alignment | null | undefined;
|
|
154
|
+
autoAlignment?: boolean | undefined;
|
|
155
|
+
allowedPlacements?: import("@floating-ui/core").Placement[] | undefined;
|
|
156
|
+
boundary?: import("@floating-ui/dom").Boundary | undefined;
|
|
157
|
+
} | import("@floating-ui/dom").Derivable<{
|
|
158
|
+
crossAxis?: boolean | undefined;
|
|
159
|
+
rootBoundary?: import("@floating-ui/core").RootBoundary | undefined;
|
|
160
|
+
elementContext?: import("@floating-ui/core").ElementContext | undefined;
|
|
161
|
+
altBoundary?: boolean | undefined;
|
|
162
|
+
padding?: import("@floating-ui/core").Padding | undefined;
|
|
163
|
+
alignment?: import("@floating-ui/core").Alignment | null | undefined;
|
|
164
|
+
autoAlignment?: boolean | undefined;
|
|
165
|
+
allowedPlacements?: import("@floating-ui/core").Placement[] | undefined;
|
|
166
|
+
boundary?: import("@floating-ui/dom").Boundary | undefined;
|
|
98
167
|
}> | undefined>;
|
|
99
168
|
default: boolean;
|
|
100
169
|
};
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { inject, defineComponent, ref, watch, computed, openBlock, createBlock, resolveDynamicComponent, unref, mergeProps, withCtx, renderSlot, createTextVNode, toDisplayString, provide, createElementBlock, toRefs, createVNode } from "vue";
|
|
2
2
|
import "mitt";
|
|
3
3
|
import { useElementHover, useFocus, useFocusWithin } from "@vueuse/core";
|
|
4
|
+
var Strategy = /* @__PURE__ */ ((Strategy2) => {
|
|
5
|
+
Strategy2["absolute"] = "absolute";
|
|
6
|
+
Strategy2["fixed"] = "fixed";
|
|
7
|
+
return Strategy2;
|
|
8
|
+
})(Strategy || {});
|
|
4
9
|
var Side = /* @__PURE__ */ ((Side2) => {
|
|
5
10
|
Side2["left"] = "left";
|
|
6
11
|
Side2["right"] = "right";
|
|
@@ -139,19 +144,15 @@ const ModifiersProps = {
|
|
|
139
144
|
placement: {
|
|
140
145
|
type: String,
|
|
141
146
|
default: Side.bottom,
|
|
142
|
-
validator: (value) =>
|
|
143
|
-
return Object.values(Side).includes(value) || Object.values(Placement).includes(value);
|
|
144
|
-
}
|
|
147
|
+
validator: (value) => Object.values(Side).includes(value) || Object.values(Placement).includes(value)
|
|
145
148
|
},
|
|
146
149
|
/**
|
|
147
150
|
* Dropdown strategy
|
|
148
151
|
*/
|
|
149
152
|
strategy: {
|
|
150
153
|
type: String,
|
|
151
|
-
default:
|
|
152
|
-
validator: (value) =>
|
|
153
|
-
return ["fixed", "absolute"].includes(value);
|
|
154
|
-
}
|
|
154
|
+
default: void 0,
|
|
155
|
+
validator: (value) => Object.values(Strategy).includes(value)
|
|
155
156
|
},
|
|
156
157
|
/**
|
|
157
158
|
* Dropdown show / hide transition name
|
|
@@ -241,6 +242,13 @@ const ActionProps = {
|
|
|
241
242
|
type: String,
|
|
242
243
|
default: ButtonType.button,
|
|
243
244
|
validator: (value) => Object.values(ButtonType).includes(value)
|
|
245
|
+
},
|
|
246
|
+
/**
|
|
247
|
+
* Button aria-label
|
|
248
|
+
*/
|
|
249
|
+
ariaLabel: {
|
|
250
|
+
type: String,
|
|
251
|
+
default: void 0
|
|
244
252
|
}
|
|
245
253
|
};
|
|
246
254
|
const VvActionEvents = ["click", "mouseover", "mouseleave"];
|
|
@@ -302,7 +310,8 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
302
310
|
const hasProps = computed(() => {
|
|
303
311
|
const toReturn = {
|
|
304
312
|
...dropdownAria == null ? void 0 : dropdownAria.value,
|
|
305
|
-
|
|
313
|
+
ariaPressed: pressed.value ? true : void 0,
|
|
314
|
+
ariaLabel: props.ariaLabel,
|
|
306
315
|
role: role == null ? void 0 : role.value
|
|
307
316
|
};
|
|
308
317
|
switch (hasTag.value) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue"),require("mitt"),require("@vueuse/core")):"function"==typeof define&&define.amd?define(["vue","mitt","@vueuse/core"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VvDropdownAction=t(e.vue,null,e.core)}(this,(function(e,t,o){"use strict";var r=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(r||{}),n=(e=>(e.before="before",e.after="after",e))(n||{}),l=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(l||{}),
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue"),require("mitt"),require("@vueuse/core")):"function"==typeof define&&define.amd?define(["vue","mitt","@vueuse/core"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VvDropdownAction=t(e.vue,null,e.core)}(this,(function(e,t,o){"use strict";var r=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(r||{}),n=(e=>(e.before="before",e.after="after",e))(n||{}),l=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(l||{}),a=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(a||{}),u=(e=>(e.button="button",e.link="link",e.menuitem="menuitem",e))(u||{}),i=(e=>(e._blank="_blank",e._self="_self",e._parent="_parent",e._top="_top",e))(i||{});const s=Symbol.for("volver"),d=Symbol.for("dropdownTrigger"),c=Symbol.for("dropdownItem"),f=Symbol.for("dropdownAction"),p={to:{type:[String,Object]},href:String,target:{type:String,validator:e=>Object.values(i).includes(e)},rel:{type:String,default:"noopener noreferrer"}},v={disabled:Boolean},m={active:Boolean},b={pressed:Boolean},y={label:[String,Number]},g={modifiers:[String,Array]};n.before,r.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const k={...v,...y,...b,...m,...p,type:{type:String,default:l.button,validator:e=>Object.values(l).includes(e)},ariaLabel:{type:String,default:void 0}},h=k;const x=e.defineComponent({name:"VvAction",props:h,emits:["click","mouseover","mouseleave"],setup(t,{expose:o,emit:r}){const n=t,l=e.inject(s),u=e.ref(null);o({$el:u});const{reference:i,bus:c,aria:p,expanded:v}=e.inject(d,{});e.watch((()=>u.value),(e=>{i&&(i.value=e)}));const m=e.computed((()=>n.pressed||(null==v?void 0:v.value))),{role:b}=e.inject(f,{}),y=e.computed((()=>{switch(!0){case n.disabled:return a.button;case void 0!==n.to:return(null==l?void 0:l.nuxt)?a.nuxtLink:a.routerLink;case void 0!==n.href:return a.a;default:return a.button}})),g=e.computed((()=>{const e={...null==p?void 0:p.value,ariaPressed:!!m.value||void 0,ariaLabel:n.ariaLabel,role:null==b?void 0:b.value};switch(y.value){case a.a:return{...e,href:n.href,target:n.target,rel:n.rel};case a.routerLink:case a.nuxtLink:return{...e,to:n.to,target:n.target};default:return{...e,type:n.type,disabled:n.disabled}}})),k=e=>{n.disabled?e.preventDefault():(null==c||c.emit("click",e),r("click",e))},h=e=>{null==c||c.emit("mouseover",e),r("mouseover",e)},x=e=>{null==c||c.emit("mouseleave",e),r("mouseleave",e)};return(t,o)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(y)),e.mergeProps(e.unref(g),{ref_key:"element",ref:u,class:{active:t.active,pressed:e.unref(m),disabled:t.disabled},onClickPassive:k,onMouseoverPassive:h,onMouseleavePassive:x}),{default:e.withCtx((()=>[e.renderSlot(t.$slots,"default",{},(()=>[e.createTextVNode(e.toDisplayString(t.label),1)]))])),_:3},16,["class"]))}});const B=e.defineComponent({name:"VvDropdownItem",setup(t){const{role:r,expanded:n}=e.inject(c,{}),l=e.ref(null);!function({expanded:t}){e.provide(f,{role:e.ref(u.menuitem),expanded:t})}({expanded:n});const a=o.useElementHover(l),{focused:i}=o.useFocus(l),{focused:s}=o.useFocusWithin(l);return e.watch(a,(e=>{e&&(i.value=!0)})),(t,o)=>(e.openBlock(),e.createElementBlock("div",e.mergeProps({role:e.unref(r)},{ref_key:"element",ref:l,class:["vv-dropdown__item",{"focus-visible":e.unref(i)||e.unref(s)}]}),[e.renderSlot(t.$slots,"default")],16))}});return e.defineComponent({name:"VvDropdownAction",props:{...k,...g},setup(t){const o=t,{modifiers:r}=e.toRefs(o),n=function(t,o,r){return e.computed((()=>{const n={[t]:!0},l="string"==typeof(null==o?void 0:o.value)?o.value.split(" "):null==o?void 0:o.value;return l&&Array.isArray(l)&&l.forEach((e=>{e&&(n[`${t}--${e}`]=!0)})),r&&Object.keys(r.value).forEach((o=>{n[`${t}--${o}`]=e.unref(r.value[o])})),n}))}("vv-dropdown-action",r);return(t,o)=>(e.openBlock(),e.createBlock(B,null,{default:e.withCtx((()=>[e.createVNode(x,e.mergeProps({disabled:t.disabled,pressed:t.pressed,active:t.active,type:t.type,to:t.to,href:t.href,target:t.target,rel:t.rel},{class:e.unref(n)}),{default:e.withCtx((()=>[e.renderSlot(t.$slots,"default",{},(()=>[e.createTextVNode(e.toDisplayString(t.label),1)]))])),_:3},16,["class"])])),_:3}))}})}));
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import { defineComponent, openBlock, createElementBlock, toDisplayString } from "vue";
|
|
2
|
+
var Strategy = /* @__PURE__ */ ((Strategy2) => {
|
|
3
|
+
Strategy2["absolute"] = "absolute";
|
|
4
|
+
Strategy2["fixed"] = "fixed";
|
|
5
|
+
return Strategy2;
|
|
6
|
+
})(Strategy || {});
|
|
2
7
|
var Side = /* @__PURE__ */ ((Side2) => {
|
|
3
8
|
Side2["left"] = "left";
|
|
4
9
|
Side2["right"] = "right";
|
|
@@ -108,19 +113,15 @@ const LabelProps = {
|
|
|
108
113
|
placement: {
|
|
109
114
|
type: String,
|
|
110
115
|
default: Side.bottom,
|
|
111
|
-
validator: (value) =>
|
|
112
|
-
return Object.values(Side).includes(value) || Object.values(Placement).includes(value);
|
|
113
|
-
}
|
|
116
|
+
validator: (value) => Object.values(Side).includes(value) || Object.values(Placement).includes(value)
|
|
114
117
|
},
|
|
115
118
|
/**
|
|
116
119
|
* Dropdown strategy
|
|
117
120
|
*/
|
|
118
121
|
strategy: {
|
|
119
122
|
type: String,
|
|
120
|
-
default:
|
|
121
|
-
validator: (value) =>
|
|
122
|
-
return ["fixed", "absolute"].includes(value);
|
|
123
|
-
}
|
|
123
|
+
default: void 0,
|
|
124
|
+
validator: (value) => Object.values(Strategy).includes(value)
|
|
124
125
|
},
|
|
125
126
|
/**
|
|
126
127
|
* Dropdown show / hide transition name
|
|
@@ -210,6 +211,13 @@ const LabelProps = {
|
|
|
210
211
|
type: String,
|
|
211
212
|
default: ButtonType.button,
|
|
212
213
|
validator: (value) => Object.values(ButtonType).includes(value)
|
|
214
|
+
},
|
|
215
|
+
/**
|
|
216
|
+
* Button aria-label
|
|
217
|
+
*/
|
|
218
|
+
ariaLabel: {
|
|
219
|
+
type: String,
|
|
220
|
+
default: void 0
|
|
213
221
|
}
|
|
214
222
|
});
|
|
215
223
|
const _hoisted_1 = {
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { inject, provide, ref, defineComponent, watch, openBlock, createElementBlock, mergeProps, unref, renderSlot, computed, toRefs, createBlock, normalizeClass, withCtx, createElementVNode, normalizeProps, guardReactiveProps, createTextVNode, toDisplayString } from "vue";
|
|
2
2
|
import "mitt";
|
|
3
3
|
import { useElementHover, useFocus, useFocusWithin } from "@vueuse/core";
|
|
4
|
+
var Strategy = /* @__PURE__ */ ((Strategy2) => {
|
|
5
|
+
Strategy2["absolute"] = "absolute";
|
|
6
|
+
Strategy2["fixed"] = "fixed";
|
|
7
|
+
return Strategy2;
|
|
8
|
+
})(Strategy || {});
|
|
4
9
|
var Side = /* @__PURE__ */ ((Side2) => {
|
|
5
10
|
Side2["left"] = "left";
|
|
6
11
|
Side2["right"] = "right";
|
|
@@ -179,19 +184,15 @@ const UnselectableProps = {
|
|
|
179
184
|
placement: {
|
|
180
185
|
type: String,
|
|
181
186
|
default: Side.bottom,
|
|
182
|
-
validator: (value) =>
|
|
183
|
-
return Object.values(Side).includes(value) || Object.values(Placement).includes(value);
|
|
184
|
-
}
|
|
187
|
+
validator: (value) => Object.values(Side).includes(value) || Object.values(Placement).includes(value)
|
|
185
188
|
},
|
|
186
189
|
/**
|
|
187
190
|
* Dropdown strategy
|
|
188
191
|
*/
|
|
189
192
|
strategy: {
|
|
190
193
|
type: String,
|
|
191
|
-
default:
|
|
192
|
-
validator: (value) =>
|
|
193
|
-
return ["fixed", "absolute"].includes(value);
|
|
194
|
-
}
|
|
194
|
+
default: void 0,
|
|
195
|
+
validator: (value) => Object.values(Strategy).includes(value)
|
|
195
196
|
},
|
|
196
197
|
/**
|
|
197
198
|
* Dropdown show / hide transition name
|
|
@@ -281,6 +282,13 @@ const UnselectableProps = {
|
|
|
281
282
|
type: String,
|
|
282
283
|
default: ButtonType.button,
|
|
283
284
|
validator: (value) => Object.values(ButtonType).includes(value)
|
|
285
|
+
},
|
|
286
|
+
/**
|
|
287
|
+
* Button aria-label
|
|
288
|
+
*/
|
|
289
|
+
ariaLabel: {
|
|
290
|
+
type: String,
|
|
291
|
+
default: void 0
|
|
284
292
|
}
|
|
285
293
|
});
|
|
286
294
|
function useModifiers(prefix, modifiers, others) {
|