@volverjs/ui-vue 0.0.10-beta.2 → 0.0.10-beta.20
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 +98 -3
- package/auto-imports.d.ts +6 -2
- package/bin/icons.cjs +1 -1
- package/bin/icons.js +23 -16
- package/dist/Volver.d.ts +1 -1
- package/dist/components/VvAccordion/VvAccordion.es.js +67 -13
- package/dist/components/VvAccordion/VvAccordion.umd.js +1 -1
- package/dist/components/VvAccordion/VvAccordion.vue.d.ts +13 -6
- package/dist/components/VvAccordion/index.d.ts +4 -1
- package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +111 -37
- package/dist/components/VvAccordionGroup/VvAccordionGroup.umd.js +1 -1
- package/dist/components/VvAccordionGroup/VvAccordionGroup.vue.d.ts +15 -8
- package/dist/components/VvAccordionGroup/index.d.ts +4 -1
- package/dist/components/VvAction/VvAction.es.js +56 -12
- package/dist/components/VvAction/VvAction.umd.js +1 -1
- package/dist/components/VvAction/VvAction.vue.d.ts +59 -12
- package/dist/components/VvAction/index.d.ts +25 -4
- package/dist/components/VvAlert/VvAlert.es.js +188 -152
- package/dist/components/VvAlert/VvAlert.umd.js +1 -1
- package/dist/components/VvAlert/VvAlert.vue.d.ts +18 -8
- package/dist/components/VvAlert/index.d.ts +9 -5
- package/dist/components/VvAlertGroup/VvAlertGroup.es.js +230 -174
- package/dist/components/VvAlertGroup/VvAlertGroup.umd.js +1 -1
- package/dist/components/VvAlertGroup/VvAlertGroup.vue.d.ts +13 -6
- package/dist/components/VvAlertGroup/index.d.ts +6 -2
- package/dist/components/VvAvatar/VvAvatar.es.js +54 -9
- package/dist/components/VvAvatar/VvAvatar.umd.js +1 -1
- package/dist/components/VvAvatar/VvAvatar.vue.d.ts +12 -4
- package/dist/components/VvAvatar/index.d.ts +4 -1
- package/dist/components/VvAvatarGroup/VvAvatarGroup.es.js +111 -36
- package/dist/components/VvAvatarGroup/VvAvatarGroup.umd.js +1 -1
- package/dist/components/VvAvatarGroup/VvAvatarGroup.vue.d.ts +10 -3
- package/dist/components/VvAvatarGroup/index.d.ts +4 -1
- package/dist/components/VvBadge/VvBadge.es.js +71 -16
- package/dist/components/VvBadge/VvBadge.umd.js +1 -1
- package/dist/components/VvBadge/VvBadge.vue.d.ts +12 -4
- package/dist/components/VvBadge/index.d.ts +4 -1
- package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +257 -49
- package/dist/components/VvBreadcrumb/VvBreadcrumb.umd.js +1 -1
- package/dist/components/VvBreadcrumb/VvBreadcrumb.vue.d.ts +27 -7
- package/dist/components/VvBreadcrumb/index.d.ts +6 -10
- package/dist/components/VvButton/VvButton.es.js +165 -137
- package/dist/components/VvButton/VvButton.umd.js +1 -1
- package/dist/components/VvButton/VvButton.vue.d.ts +101 -27
- package/dist/components/VvButton/index.d.ts +41 -14
- package/dist/components/VvButtonGroup/VvButtonGroup.es.js +67 -15
- package/dist/components/VvButtonGroup/VvButtonGroup.umd.js +1 -1
- package/dist/components/VvButtonGroup/VvButtonGroup.vue.d.ts +23 -10
- package/dist/components/VvButtonGroup/index.d.ts +8 -2
- package/dist/components/VvCard/VvCard.es.js +79 -24
- package/dist/components/VvCard/VvCard.umd.js +1 -1
- package/dist/components/VvCard/VvCard.vue.d.ts +12 -4
- package/dist/components/VvCard/index.d.ts +4 -1
- package/dist/components/VvCheckbox/VvCheckbox.es.js +89 -21
- package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -1
- package/dist/components/VvCheckbox/VvCheckbox.vue.d.ts +104 -32
- package/dist/components/VvCheckbox/index.d.ts +45 -12
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +168 -66
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.vue.d.ts +100 -29
- package/dist/components/VvCheckboxGroup/index.d.ts +45 -12
- package/dist/components/VvCombobox/VvCombobox.es.js +721 -527
- package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
- package/dist/components/VvCombobox/VvCombobox.vue.d.ts +145 -72
- package/dist/components/VvCombobox/index.d.ts +53 -22
- package/dist/components/VvDialog/VvDialog.es.js +133 -141
- package/dist/components/VvDialog/VvDialog.umd.js +1 -1
- package/dist/components/VvDialog/VvDialog.vue.d.ts +4 -4
- package/dist/components/VvDropdown/VvDropdown.es.js +121 -55
- package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
- package/dist/components/VvDropdown/VvDropdown.vue.d.ts +61 -35
- package/dist/components/VvDropdown/VvDropdownAction.vue.d.ts +72 -11
- package/dist/components/VvDropdown/VvDropdownItem.vue.d.ts +1 -1
- package/dist/components/VvDropdown/VvDropdownOptgroup.vue.d.ts +12 -4
- package/dist/components/VvDropdown/VvDropdownOption.vue.d.ts +26 -7
- package/dist/components/VvDropdown/index.d.ts +16 -11
- package/dist/components/VvDropdownAction/VvDropdownAction.es.js +80 -21
- package/dist/components/VvDropdownAction/VvDropdownAction.umd.js +1 -1
- package/dist/components/VvDropdownItem/VvDropdownItem.es.js +13 -7
- package/dist/components/VvDropdownOptgroup/VvDropdownOptgroup.es.js +56 -8
- package/dist/components/VvDropdownOptgroup/VvDropdownOptgroup.umd.js +1 -1
- package/dist/components/VvDropdownOption/VvDropdownOption.es.js +76 -17
- package/dist/components/VvDropdownOption/VvDropdownOption.umd.js +1 -1
- package/dist/components/VvIcon/VvIcon.es.js +23 -96
- package/dist/components/VvIcon/VvIcon.umd.js +1 -1
- package/dist/components/VvIcon/VvIcon.vue.d.ts +23 -66
- package/dist/components/VvIcon/index.d.ts +21 -48
- package/dist/components/VvInputFile/VvInputFile.es.js +1558 -0
- package/dist/components/VvInputFile/VvInputFile.umd.js +1 -0
- package/dist/components/VvInputFile/VvInputFile.vue.d.ts +190 -0
- package/dist/components/VvInputFile/index.d.ts +74 -0
- package/dist/components/VvInputText/VvInputClearAction.d.ts +2 -2
- package/dist/components/VvInputText/VvInputPasswordAction.d.ts +1 -1
- package/dist/components/VvInputText/VvInputStepAction.d.ts +1 -1
- package/dist/components/VvInputText/VvInputText.es.js +266 -242
- package/dist/components/VvInputText/VvInputText.umd.js +1 -1
- package/dist/components/VvInputText/VvInputText.vue.d.ts +153 -46
- package/dist/components/VvInputText/index.d.ts +69 -18
- package/dist/components/VvNav/VvNav.es.js +150 -73
- package/dist/components/VvNav/VvNav.umd.js +1 -1
- package/dist/components/VvNav/VvNav.vue.d.ts +41 -14
- package/dist/components/VvNav/VvNavItem.vue.d.ts +9 -0
- package/dist/components/VvNav/{VvNavSeparator.d.ts → VvNavSeparator.vue.d.ts} +1 -1
- package/dist/components/VvNav/index.d.ts +5 -13
- package/dist/components/VvNavItem/VvNavItem.es.js +435 -0
- package/dist/components/VvNavItem/VvNavItem.umd.js +1 -0
- package/dist/components/VvNavSeparator/VvNavSeparator.es.js +24 -0
- package/dist/components/VvNavSeparator/VvNavSeparator.umd.js +1 -0
- package/dist/components/VvProgress/VvProgress.es.js +65 -14
- package/dist/components/VvProgress/VvProgress.umd.js +1 -1
- package/dist/components/VvProgress/VvProgress.vue.d.ts +10 -3
- package/dist/components/VvProgress/index.d.ts +4 -1
- package/dist/components/VvRadio/VvRadio.es.js +89 -21
- package/dist/components/VvRadio/VvRadio.umd.js +1 -1
- package/dist/components/VvRadio/VvRadio.vue.d.ts +102 -30
- package/dist/components/VvRadio/index.d.ts +44 -11
- package/dist/components/VvRadioGroup/VvRadioGroup.es.js +168 -66
- package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
- package/dist/components/VvRadioGroup/VvRadioGroup.vue.d.ts +100 -29
- package/dist/components/VvRadioGroup/index.d.ts +45 -12
- package/dist/components/VvSelect/VvSelect.es.js +244 -226
- package/dist/components/VvSelect/VvSelect.umd.js +1 -1
- package/dist/components/VvSelect/VvSelect.vue.d.ts +112 -39
- package/dist/components/VvSelect/index.d.ts +48 -14
- package/dist/components/VvTab/VvTab.es.js +251 -110
- package/dist/components/VvTab/VvTab.umd.js +1 -1
- package/dist/components/VvTab/VvTab.vue.d.ts +50 -13
- package/dist/components/VvTab/index.d.ts +13 -4
- package/dist/components/VvTextarea/VvTextarea.es.js +225 -212
- package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
- package/dist/components/VvTextarea/VvTextarea.vue.d.ts +155 -48
- package/dist/components/VvTextarea/index.d.ts +68 -19
- package/dist/components/VvTooltip/VvTooltip.es.js +72 -17
- package/dist/components/VvTooltip/VvTooltip.umd.js +1 -1
- package/dist/components/VvTooltip/VvTooltip.vue.d.ts +10 -3
- package/dist/components/VvTooltip/index.d.ts +4 -1
- package/dist/components/index.d.ts +10 -0
- package/dist/components/index.es.js +2635 -1301
- package/dist/components/index.umd.js +1 -1
- package/dist/composables/alert/useAlert.d.ts +37 -4
- package/dist/composables/dropdown/useProvideDropdown.d.ts +1 -1
- package/dist/composables/index.d.ts +1 -0
- package/dist/composables/index.es.js +88 -1
- package/dist/composables/index.umd.js +1 -1
- package/dist/composables/useBlurhash.d.ts +7 -0
- package/dist/composables/useComponentIcon.d.ts +9 -8
- package/dist/composables/useVolver.d.ts +1 -1
- package/dist/directives/index.d.ts +3 -5
- package/dist/directives/index.es.js +92 -31
- package/dist/directives/index.umd.js +1 -1
- package/dist/directives/v-tooltip.es.js +90 -26
- package/dist/directives/v-tooltip.umd.js +1 -1
- package/dist/icons.es.js +6 -6
- package/dist/icons.umd.js +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.es.js +81 -16
- package/dist/index.umd.js +1 -1
- package/dist/props/index.d.ts +287 -73
- package/dist/resolvers/unplugin.d.ts +6 -1
- package/dist/resolvers/unplugin.es.js +78 -10
- package/dist/resolvers/unplugin.umd.js +1 -1
- package/dist/stories/AccordionGroup/AccordionGroup.stories.d.ts +72 -84
- package/dist/stories/AccordionGroup/AccordionGroupSlots.stories.d.ts +623 -461
- package/dist/stories/AlertGroup/AlertGroupWithComposable.stories.d.ts +1 -1
- package/dist/stories/Blurhash/BlurhashComposable.stories.d.ts +4 -0
- package/dist/stories/Combobox/Combobox.settings.d.ts +8 -0
- package/dist/stories/Icon/Icon.settings.d.ts +1 -0
- package/dist/stories/InputFile/InputFile.settings.d.ts +56 -0
- package/dist/stories/InputFile/InputFile.stories.d.ts +13 -0
- package/dist/stories/InputFile/InputFileModifiers.stories.d.ts +9 -0
- package/dist/stories/InputFile/InputFileSlots.stories.d.ts +6 -0
- package/dist/stories/Tab/Tab.settings.d.ts +4 -37
- package/dist/types/alert.d.ts +13 -0
- package/dist/types/blurhash.d.ts +12 -0
- package/dist/types/floating-ui.d.ts +6 -0
- package/dist/types/generic.d.ts +4 -0
- package/dist/types/group.d.ts +37 -0
- package/dist/types/index.d.ts +7 -0
- package/dist/types/input-file.d.ts +14 -0
- package/dist/types/nav.d.ts +18 -0
- package/dist/utils/ObjectUtilities.d.ts +0 -1
- package/dist/workers/blurhash.d.ts +1 -0
- package/package.json +91 -74
- package/src/Volver.ts +31 -20
- 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 +2 -2
- package/src/components/VvAction/VvAction.vue +5 -2
- package/src/components/VvAlert/index.ts +1 -3
- package/src/components/VvAlertGroup/index.ts +2 -1
- package/src/components/VvBreadcrumb/VvBreadcrumb.vue +20 -19
- package/src/components/VvBreadcrumb/index.ts +2 -8
- package/src/components/VvButton/VvButton.vue +6 -6
- package/src/components/VvButton/index.ts +2 -4
- package/src/components/VvCombobox/VvCombobox.vue +24 -16
- package/src/components/VvCombobox/index.ts +4 -0
- package/src/components/VvIcon/VvIcon.vue +2 -2
- package/src/components/VvIcon/index.ts +22 -48
- package/src/components/VvInputFile/VvInputFile.vue +302 -0
- package/src/components/VvInputFile/index.ts +38 -0
- package/src/components/VvInputText/VvInputText.vue +13 -14
- package/src/components/VvNav/VvNav.vue +30 -50
- package/src/components/VvNav/VvNavItem.vue +18 -0
- package/src/components/VvNav/VvNavSeparator.vue +11 -0
- package/src/components/VvNav/index.ts +2 -15
- package/src/components/VvSelect/VvSelect.vue +5 -8
- package/src/components/VvTab/VvTab.vue +63 -35
- package/src/components/VvTab/index.ts +10 -4
- package/src/components/VvTextarea/VvTextarea.vue +6 -9
- package/src/components/index.ts +10 -0
- package/src/composables/index.ts +1 -0
- package/src/composables/useBlurhash.ts +76 -0
- package/src/composables/useComponentIcon.ts +15 -14
- package/src/composables/useUniqueId.ts +2 -2
- package/src/directives/index.ts +3 -6
- package/src/directives/v-tooltip.ts +19 -10
- package/src/index.ts +3 -1
- package/src/props/index.ts +115 -27
- package/src/resolvers/unplugin.ts +24 -14
- package/src/stories/AlertGroup/AlertGroupWithComposable.stories.ts +2 -2
- package/src/stories/Blurhash/BlurhashComposable.stories.ts +195 -0
- package/src/stories/Combobox/Combobox.settings.ts +8 -0
- package/src/stories/Icon/Icon.settings.ts +3 -3
- package/src/stories/InputFile/InputFile.settings.ts +36 -0
- package/src/stories/InputFile/InputFile.stories.ts +98 -0
- package/src/stories/InputFile/InputFileModifiers.stories.ts +51 -0
- package/src/stories/InputFile/InputFileSlots.stories.ts +25 -0
- package/src/stories/Nav/Nav.settings.ts +3 -4
- package/src/stories/Nav/Nav.test.ts +4 -15
- package/src/stories/Tab/Tab.settings.ts +9 -9
- package/src/stories/Tab/Tab.stories.ts +2 -2
- package/src/stories/Tab/Tab.test.ts +6 -14
- package/src/stories/argTypes.ts +1 -1
- package/src/types/blurhash.ts +21 -0
- package/src/types/generic.ts +6 -0
- package/src/types/index.ts +7 -0
- package/src/types/input-file.ts +16 -0
- package/src/types/nav.ts +20 -0
- package/src/utils/ObjectUtilities.ts +0 -11
- package/src/workers/blurhash.ts +9 -0
- package/dist/components/VvNav/VvNavItemTitle.vue.d.ts +0 -6
- package/dist/components/VvNavItemTitle/VvNavItemTitle.es.js +0 -19
- package/dist/components/VvNavItemTitle/VvNavItemTitle.umd.js +0 -1
- package/src/components/VvNav/VvNavItemTitle.vue +0 -11
- package/src/components/VvNav/VvNavSeparator.ts +0 -8
- package/src/types/generic.d.ts +0 -6
- /package/src/types/{alert.d.ts → alert.ts} +0 -0
- /package/src/types/{floating-ui.d.ts → floating-ui.ts} +0 -0
- /package/src/types/{group.d.ts → group.ts} +0 -0
|
@@ -82,6 +82,7 @@ const LinkProps = {
|
|
|
82
82
|
*/
|
|
83
83
|
target: {
|
|
84
84
|
type: String,
|
|
85
|
+
default: void 0,
|
|
85
86
|
validator: (value) => Object.values(AnchorTarget).includes(value)
|
|
86
87
|
},
|
|
87
88
|
/**
|
|
@@ -96,38 +97,65 @@ const DisabledProps = {
|
|
|
96
97
|
/**
|
|
97
98
|
* Whether the form control is disabled
|
|
98
99
|
*/
|
|
99
|
-
disabled:
|
|
100
|
+
disabled: {
|
|
101
|
+
type: Boolean,
|
|
102
|
+
default: false
|
|
103
|
+
}
|
|
100
104
|
};
|
|
101
105
|
const ActiveProps = {
|
|
102
106
|
/**
|
|
103
107
|
* Whether the item is active
|
|
104
108
|
*/
|
|
105
|
-
active:
|
|
109
|
+
active: {
|
|
110
|
+
type: Boolean,
|
|
111
|
+
default: false
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
const CurrentProps = {
|
|
115
|
+
/**
|
|
116
|
+
* Whether the item is current
|
|
117
|
+
*/
|
|
118
|
+
current: {
|
|
119
|
+
type: Boolean,
|
|
120
|
+
default: false
|
|
121
|
+
}
|
|
106
122
|
};
|
|
107
123
|
const PressedProps = {
|
|
108
124
|
/**
|
|
109
125
|
* Whether the item is pressed
|
|
110
126
|
*/
|
|
111
|
-
pressed:
|
|
127
|
+
pressed: {
|
|
128
|
+
type: Boolean,
|
|
129
|
+
default: false
|
|
130
|
+
}
|
|
112
131
|
};
|
|
113
132
|
const LabelProps = {
|
|
114
133
|
/**
|
|
115
134
|
* The item label
|
|
116
135
|
*/
|
|
117
|
-
label:
|
|
136
|
+
label: {
|
|
137
|
+
type: [String, Number],
|
|
138
|
+
default: void 0
|
|
139
|
+
}
|
|
118
140
|
};
|
|
119
141
|
const ModifiersProps = {
|
|
120
142
|
/**
|
|
121
143
|
* Component BEM modifiers
|
|
122
144
|
*/
|
|
123
|
-
modifiers:
|
|
145
|
+
modifiers: {
|
|
146
|
+
type: [String, Array],
|
|
147
|
+
default: void 0
|
|
148
|
+
}
|
|
124
149
|
};
|
|
125
150
|
({
|
|
126
151
|
/**
|
|
127
152
|
* VvIcon name or props
|
|
128
153
|
* @see VVIcon
|
|
129
154
|
*/
|
|
130
|
-
icon: {
|
|
155
|
+
icon: {
|
|
156
|
+
type: [String, Object],
|
|
157
|
+
default: void 0
|
|
158
|
+
},
|
|
131
159
|
/**
|
|
132
160
|
* VvIcon position
|
|
133
161
|
*/
|
|
@@ -158,7 +186,8 @@ const ModifiersProps = {
|
|
|
158
186
|
* Dropdown show / hide transition name
|
|
159
187
|
*/
|
|
160
188
|
transitionName: {
|
|
161
|
-
type: String
|
|
189
|
+
type: String,
|
|
190
|
+
default: void 0
|
|
162
191
|
},
|
|
163
192
|
/**
|
|
164
193
|
* Offset of the dropdown from the trigger
|
|
@@ -226,7 +255,8 @@ const ModifiersProps = {
|
|
|
226
255
|
* Set dropdown width to the same as the trigger
|
|
227
256
|
*/
|
|
228
257
|
triggerWidth: {
|
|
229
|
-
type: Boolean
|
|
258
|
+
type: Boolean,
|
|
259
|
+
default: false
|
|
230
260
|
}
|
|
231
261
|
});
|
|
232
262
|
const ActionProps = {
|
|
@@ -234,6 +264,7 @@ const ActionProps = {
|
|
|
234
264
|
...LabelProps,
|
|
235
265
|
...PressedProps,
|
|
236
266
|
...ActiveProps,
|
|
267
|
+
...CurrentProps,
|
|
237
268
|
...LinkProps,
|
|
238
269
|
/**
|
|
239
270
|
* Button type
|
|
@@ -249,6 +280,13 @@ const ActionProps = {
|
|
|
249
280
|
ariaLabel: {
|
|
250
281
|
type: String,
|
|
251
282
|
default: void 0
|
|
283
|
+
},
|
|
284
|
+
/**
|
|
285
|
+
* Default tag for the action
|
|
286
|
+
*/
|
|
287
|
+
defaultTag: {
|
|
288
|
+
type: String,
|
|
289
|
+
default: ActionTag.button
|
|
252
290
|
}
|
|
253
291
|
};
|
|
254
292
|
const VvActionEvents = ["click", "mouseover", "mouseleave"];
|
|
@@ -272,8 +310,9 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
272
310
|
...__default__$2,
|
|
273
311
|
props: VvActionProps,
|
|
274
312
|
emits: VvActionEvents,
|
|
275
|
-
setup(__props, { expose: __expose, emit }) {
|
|
313
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
276
314
|
const props = __props;
|
|
315
|
+
const emit = __emit;
|
|
277
316
|
const volver = useVolver();
|
|
278
317
|
const element = ref(null);
|
|
279
318
|
__expose({ $el: element });
|
|
@@ -304,7 +343,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
304
343
|
case props.href !== void 0:
|
|
305
344
|
return ActionTag.a;
|
|
306
345
|
default:
|
|
307
|
-
return
|
|
346
|
+
return props.defaultTag;
|
|
308
347
|
}
|
|
309
348
|
});
|
|
310
349
|
const hasProps = computed(() => {
|
|
@@ -329,12 +368,14 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
329
368
|
to: props.to,
|
|
330
369
|
target: props.target
|
|
331
370
|
};
|
|
332
|
-
|
|
371
|
+
case ActionTag.button:
|
|
333
372
|
return {
|
|
334
373
|
...toReturn,
|
|
335
374
|
type: props.type,
|
|
336
375
|
disabled: props.disabled
|
|
337
376
|
};
|
|
377
|
+
default:
|
|
378
|
+
return toReturn;
|
|
338
379
|
}
|
|
339
380
|
});
|
|
340
381
|
const onClick = (e) => {
|
|
@@ -360,7 +401,8 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
360
401
|
class: {
|
|
361
402
|
active: _ctx.active,
|
|
362
403
|
pressed: unref(pressed),
|
|
363
|
-
disabled: _ctx.disabled
|
|
404
|
+
disabled: _ctx.disabled,
|
|
405
|
+
current: _ctx.current
|
|
364
406
|
},
|
|
365
407
|
onClickPassive: onClick,
|
|
366
408
|
onMouseoverPassive: onMouseover,
|
|
@@ -368,10 +410,15 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
368
410
|
}), {
|
|
369
411
|
default: withCtx(() => [
|
|
370
412
|
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
371
|
-
createTextVNode(
|
|
413
|
+
createTextVNode(
|
|
414
|
+
toDisplayString(_ctx.label),
|
|
415
|
+
1
|
|
416
|
+
/* TEXT */
|
|
417
|
+
)
|
|
372
418
|
])
|
|
373
419
|
]),
|
|
374
420
|
_: 3
|
|
421
|
+
/* FORWARDED */
|
|
375
422
|
}, 16, ["class"]);
|
|
376
423
|
};
|
|
377
424
|
}
|
|
@@ -402,13 +449,19 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
402
449
|
}
|
|
403
450
|
});
|
|
404
451
|
return (_ctx, _cache) => {
|
|
405
|
-
return openBlock(), createElementBlock(
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
452
|
+
return openBlock(), createElementBlock(
|
|
453
|
+
"div",
|
|
454
|
+
mergeProps({ role: unref(role) }, {
|
|
455
|
+
ref_key: "element",
|
|
456
|
+
ref: element,
|
|
457
|
+
class: ["vv-dropdown__item", { "focus-visible": unref(focused) || unref(focusedWithin) }]
|
|
458
|
+
}),
|
|
459
|
+
[
|
|
460
|
+
renderSlot(_ctx.$slots, "default")
|
|
461
|
+
],
|
|
462
|
+
16
|
|
463
|
+
/* FULL_PROPS */
|
|
464
|
+
);
|
|
412
465
|
};
|
|
413
466
|
}
|
|
414
467
|
});
|
|
@@ -463,13 +516,19 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
463
516
|
}, { class: unref(bemCssClasses) }), {
|
|
464
517
|
default: withCtx(() => [
|
|
465
518
|
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
466
|
-
createTextVNode(
|
|
519
|
+
createTextVNode(
|
|
520
|
+
toDisplayString(_ctx.label),
|
|
521
|
+
1
|
|
522
|
+
/* TEXT */
|
|
523
|
+
)
|
|
467
524
|
])
|
|
468
525
|
]),
|
|
469
526
|
_: 3
|
|
527
|
+
/* FORWARDED */
|
|
470
528
|
}, 16, ["class"])
|
|
471
529
|
]),
|
|
472
530
|
_: 3
|
|
531
|
+
/* FORWARDED */
|
|
473
532
|
});
|
|
474
533
|
};
|
|
475
534
|
}
|
|
@@ -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||{}),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={
|
|
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,default:void 0,validator:e=>Object.values(i).includes(e)},rel:{type:String,default:"noopener noreferrer"}},v={disabled:{type:Boolean,default:!1}},m={active:{type:Boolean,default:!1}},b={current:{type:Boolean,default:!1}},y={pressed:{type:Boolean,default:!1}},g={label:{type:[String,Number],default:void 0}},k={modifiers:{type:[String,Array],default:void 0}};n.before,r.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const h={...v,...g,...y,...m,...b,...p,type:{type:String,default:l.button,validator:e=>Object.values(l).includes(e)},ariaLabel:{type:String,default:void 0},defaultTag:{type:String,default:a.button}},x=h;const B=e.defineComponent({name:"VvAction",props:x,emits:["click","mouseover","mouseleave"],setup(t,{expose:o,emit:r}){const n=t,l=r,u=e.inject(s),i=e.ref(null);o({$el:i});const{reference:c,bus:p,aria:v,expanded:m}=e.inject(d,{});e.watch((()=>i.value),(e=>{c&&(c.value=e)}));const b=e.computed((()=>n.pressed||(null==m?void 0:m.value))),{role:y}=e.inject(f,{}),g=e.computed((()=>{switch(!0){case n.disabled:return a.button;case void 0!==n.to:return(null==u?void 0:u.nuxt)?a.nuxtLink:a.routerLink;case void 0!==n.href:return a.a;default:return n.defaultTag}})),k=e.computed((()=>{const e={...null==v?void 0:v.value,ariaPressed:!!b.value||void 0,ariaLabel:n.ariaLabel,role:null==y?void 0:y.value};switch(g.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};case a.button:return{...e,type:n.type,disabled:n.disabled};default:return e}})),h=e=>{n.disabled?e.preventDefault():(null==p||p.emit("click",e),l("click",e))},x=e=>{null==p||p.emit("mouseover",e),l("mouseover",e)},B=e=>{null==p||p.emit("mouseleave",e),l("mouseleave",e)};return(t,o)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(g)),e.mergeProps(e.unref(k),{ref_key:"element",ref:i,class:{active:t.active,pressed:e.unref(b),disabled:t.disabled,current:t.current},onClickPassive:h,onMouseoverPassive:x,onMouseleavePassive:B}),{default:e.withCtx((()=>[e.renderSlot(t.$slots,"default",{},(()=>[e.createTextVNode(e.toDisplayString(t.label),1)]))])),_:3},16,["class"]))}});const S=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:{...h,...k},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(S,null,{default:e.withCtx((()=>[e.createVNode(B,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}))}})}));
|
|
@@ -42,13 +42,19 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
42
42
|
}
|
|
43
43
|
});
|
|
44
44
|
return (_ctx, _cache) => {
|
|
45
|
-
return openBlock(), createElementBlock(
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
45
|
+
return openBlock(), createElementBlock(
|
|
46
|
+
"div",
|
|
47
|
+
mergeProps({ role: unref(role) }, {
|
|
48
|
+
ref_key: "element",
|
|
49
|
+
ref: element,
|
|
50
|
+
class: ["vv-dropdown__item", { "focus-visible": unref(focused) || unref(focusedWithin) }]
|
|
51
|
+
}),
|
|
52
|
+
[
|
|
53
|
+
renderSlot(_ctx.$slots, "default")
|
|
54
|
+
],
|
|
55
|
+
16
|
|
56
|
+
/* FULL_PROPS */
|
|
57
|
+
);
|
|
52
58
|
};
|
|
53
59
|
}
|
|
54
60
|
});
|
|
@@ -33,6 +33,13 @@ var ButtonType = /* @__PURE__ */ ((ButtonType2) => {
|
|
|
33
33
|
ButtonType2["reset"] = "reset";
|
|
34
34
|
return ButtonType2;
|
|
35
35
|
})(ButtonType || {});
|
|
36
|
+
var ActionTag = /* @__PURE__ */ ((ActionTag2) => {
|
|
37
|
+
ActionTag2["nuxtLink"] = "nuxt-link";
|
|
38
|
+
ActionTag2["routerLink"] = "router-link";
|
|
39
|
+
ActionTag2["a"] = "a";
|
|
40
|
+
ActionTag2["button"] = "button";
|
|
41
|
+
return ActionTag2;
|
|
42
|
+
})(ActionTag || {});
|
|
36
43
|
var AnchorTarget = /* @__PURE__ */ ((AnchorTarget2) => {
|
|
37
44
|
AnchorTarget2["_blank"] = "_blank";
|
|
38
45
|
AnchorTarget2["_self"] = "_self";
|
|
@@ -57,6 +64,7 @@ const LinkProps = {
|
|
|
57
64
|
*/
|
|
58
65
|
target: {
|
|
59
66
|
type: String,
|
|
67
|
+
default: void 0,
|
|
60
68
|
validator: (value) => Object.values(AnchorTarget).includes(value)
|
|
61
69
|
},
|
|
62
70
|
/**
|
|
@@ -71,32 +79,56 @@ const DisabledProps = {
|
|
|
71
79
|
/**
|
|
72
80
|
* Whether the form control is disabled
|
|
73
81
|
*/
|
|
74
|
-
disabled:
|
|
82
|
+
disabled: {
|
|
83
|
+
type: Boolean,
|
|
84
|
+
default: false
|
|
85
|
+
}
|
|
75
86
|
};
|
|
76
87
|
const ActiveProps = {
|
|
77
88
|
/**
|
|
78
89
|
* Whether the item is active
|
|
79
90
|
*/
|
|
80
|
-
active:
|
|
91
|
+
active: {
|
|
92
|
+
type: Boolean,
|
|
93
|
+
default: false
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
const CurrentProps = {
|
|
97
|
+
/**
|
|
98
|
+
* Whether the item is current
|
|
99
|
+
*/
|
|
100
|
+
current: {
|
|
101
|
+
type: Boolean,
|
|
102
|
+
default: false
|
|
103
|
+
}
|
|
81
104
|
};
|
|
82
105
|
const PressedProps = {
|
|
83
106
|
/**
|
|
84
107
|
* Whether the item is pressed
|
|
85
108
|
*/
|
|
86
|
-
pressed:
|
|
109
|
+
pressed: {
|
|
110
|
+
type: Boolean,
|
|
111
|
+
default: false
|
|
112
|
+
}
|
|
87
113
|
};
|
|
88
114
|
const LabelProps = {
|
|
89
115
|
/**
|
|
90
116
|
* The item label
|
|
91
117
|
*/
|
|
92
|
-
label:
|
|
118
|
+
label: {
|
|
119
|
+
type: [String, Number],
|
|
120
|
+
default: void 0
|
|
121
|
+
}
|
|
93
122
|
};
|
|
94
123
|
({
|
|
95
124
|
/**
|
|
96
125
|
* VvIcon name or props
|
|
97
126
|
* @see VVIcon
|
|
98
127
|
*/
|
|
99
|
-
icon: {
|
|
128
|
+
icon: {
|
|
129
|
+
type: [String, Object],
|
|
130
|
+
default: void 0
|
|
131
|
+
},
|
|
100
132
|
/**
|
|
101
133
|
* VvIcon position
|
|
102
134
|
*/
|
|
@@ -127,7 +159,8 @@ const LabelProps = {
|
|
|
127
159
|
* Dropdown show / hide transition name
|
|
128
160
|
*/
|
|
129
161
|
transitionName: {
|
|
130
|
-
type: String
|
|
162
|
+
type: String,
|
|
163
|
+
default: void 0
|
|
131
164
|
},
|
|
132
165
|
/**
|
|
133
166
|
* Offset of the dropdown from the trigger
|
|
@@ -195,7 +228,8 @@ const LabelProps = {
|
|
|
195
228
|
* Set dropdown width to the same as the trigger
|
|
196
229
|
*/
|
|
197
230
|
triggerWidth: {
|
|
198
|
-
type: Boolean
|
|
231
|
+
type: Boolean,
|
|
232
|
+
default: false
|
|
199
233
|
}
|
|
200
234
|
});
|
|
201
235
|
({
|
|
@@ -203,6 +237,7 @@ const LabelProps = {
|
|
|
203
237
|
...LabelProps,
|
|
204
238
|
...PressedProps,
|
|
205
239
|
...ActiveProps,
|
|
240
|
+
...CurrentProps,
|
|
206
241
|
...LinkProps,
|
|
207
242
|
/**
|
|
208
243
|
* Button type
|
|
@@ -218,6 +253,13 @@ const LabelProps = {
|
|
|
218
253
|
ariaLabel: {
|
|
219
254
|
type: String,
|
|
220
255
|
default: void 0
|
|
256
|
+
},
|
|
257
|
+
/**
|
|
258
|
+
* Default tag for the action
|
|
259
|
+
*/
|
|
260
|
+
defaultTag: {
|
|
261
|
+
type: String,
|
|
262
|
+
default: ActionTag.button
|
|
221
263
|
}
|
|
222
264
|
});
|
|
223
265
|
const _hoisted_1 = {
|
|
@@ -236,7 +278,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
236
278
|
setup(__props) {
|
|
237
279
|
const props = __props;
|
|
238
280
|
return (_ctx, _cache) => {
|
|
239
|
-
return openBlock(), createElementBlock(
|
|
281
|
+
return openBlock(), createElementBlock(
|
|
282
|
+
"li",
|
|
283
|
+
_hoisted_1,
|
|
284
|
+
toDisplayString(props.label),
|
|
285
|
+
1
|
|
286
|
+
/* TEXT */
|
|
287
|
+
);
|
|
240
288
|
};
|
|
241
289
|
}
|
|
242
290
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(o,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("vue")):"function"==typeof define&&define.amd?define(["vue"],e):(o="undefined"!=typeof globalThis?globalThis:o||self).VvDropdownOptgroup=e(o.vue)}(this,(function(o){"use strict";var e=(o=>(o.left="left",o.right="right",o.top="top",o.bottom="bottom",o))(e||{}),t=(o=>(o.before="before",o.after="after",o))(t||{}),n=(o=>(o.button="button",o.submit="submit",o.reset="reset",o))(n||{});Boolean,Boolean,Boolean;const
|
|
1
|
+
!function(o,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("vue")):"function"==typeof define&&define.amd?define(["vue"],e):(o="undefined"!=typeof globalThis?globalThis:o||self).VvDropdownOptgroup=e(o.vue)}(this,(function(o){"use strict";var e=(o=>(o.left="left",o.right="right",o.top="top",o.bottom="bottom",o))(e||{}),t=(o=>(o.before="before",o.after="after",o))(t||{}),n=(o=>(o.button="button",o.submit="submit",o.reset="reset",o))(n||{}),r=(o=>(o.nuxtLink="nuxt-link",o.routerLink="router-link",o.a="a",o.button="button",o))(r||{});Boolean,Boolean,Boolean,Boolean;const l={label:{type:[String,Number],default:void 0}};t.before,e.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,n.button,r.button;const u={class:"vv-dropdown-optgroup",role:"presentation",tabindex:"-1"};return o.defineComponent({name:"VvDropdownOptgroup",props:{...l},setup(e){const t=e;return(e,n)=>(o.openBlock(),o.createElementBlock("li",u,o.toDisplayString(t.label),1))}})}));
|
|
@@ -35,6 +35,13 @@ var ButtonType = /* @__PURE__ */ ((ButtonType2) => {
|
|
|
35
35
|
ButtonType2["reset"] = "reset";
|
|
36
36
|
return ButtonType2;
|
|
37
37
|
})(ButtonType || {});
|
|
38
|
+
var ActionTag = /* @__PURE__ */ ((ActionTag2) => {
|
|
39
|
+
ActionTag2["nuxtLink"] = "nuxt-link";
|
|
40
|
+
ActionTag2["routerLink"] = "router-link";
|
|
41
|
+
ActionTag2["a"] = "a";
|
|
42
|
+
ActionTag2["button"] = "button";
|
|
43
|
+
return ActionTag2;
|
|
44
|
+
})(ActionTag || {});
|
|
38
45
|
var ActionRoles = /* @__PURE__ */ ((ActionRoles2) => {
|
|
39
46
|
ActionRoles2["button"] = "button";
|
|
40
47
|
ActionRoles2["link"] = "link";
|
|
@@ -83,13 +90,19 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
83
90
|
}
|
|
84
91
|
});
|
|
85
92
|
return (_ctx, _cache) => {
|
|
86
|
-
return openBlock(), createElementBlock(
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
+
return openBlock(), createElementBlock(
|
|
94
|
+
"div",
|
|
95
|
+
mergeProps({ role: unref(role) }, {
|
|
96
|
+
ref_key: "element",
|
|
97
|
+
ref: element,
|
|
98
|
+
class: ["vv-dropdown__item", { "focus-visible": unref(focused) || unref(focusedWithin) }]
|
|
99
|
+
}),
|
|
100
|
+
[
|
|
101
|
+
renderSlot(_ctx.$slots, "default")
|
|
102
|
+
],
|
|
103
|
+
16
|
|
104
|
+
/* FULL_PROPS */
|
|
105
|
+
);
|
|
93
106
|
};
|
|
94
107
|
}
|
|
95
108
|
});
|
|
@@ -110,6 +123,7 @@ const LinkProps = {
|
|
|
110
123
|
*/
|
|
111
124
|
target: {
|
|
112
125
|
type: String,
|
|
126
|
+
default: void 0,
|
|
113
127
|
validator: (value) => Object.values(AnchorTarget).includes(value)
|
|
114
128
|
},
|
|
115
129
|
/**
|
|
@@ -124,44 +138,74 @@ const DisabledProps = {
|
|
|
124
138
|
/**
|
|
125
139
|
* Whether the form control is disabled
|
|
126
140
|
*/
|
|
127
|
-
disabled:
|
|
141
|
+
disabled: {
|
|
142
|
+
type: Boolean,
|
|
143
|
+
default: false
|
|
144
|
+
}
|
|
128
145
|
};
|
|
129
146
|
const SelectedProps = {
|
|
130
147
|
/**
|
|
131
148
|
* Whether the item is selected
|
|
132
149
|
*/
|
|
133
|
-
selected:
|
|
150
|
+
selected: {
|
|
151
|
+
type: Boolean,
|
|
152
|
+
default: false
|
|
153
|
+
}
|
|
134
154
|
};
|
|
135
155
|
const ActiveProps = {
|
|
136
156
|
/**
|
|
137
157
|
* Whether the item is active
|
|
138
158
|
*/
|
|
139
|
-
active:
|
|
159
|
+
active: {
|
|
160
|
+
type: Boolean,
|
|
161
|
+
default: false
|
|
162
|
+
}
|
|
163
|
+
};
|
|
164
|
+
const CurrentProps = {
|
|
165
|
+
/**
|
|
166
|
+
* Whether the item is current
|
|
167
|
+
*/
|
|
168
|
+
current: {
|
|
169
|
+
type: Boolean,
|
|
170
|
+
default: false
|
|
171
|
+
}
|
|
140
172
|
};
|
|
141
173
|
const PressedProps = {
|
|
142
174
|
/**
|
|
143
175
|
* Whether the item is pressed
|
|
144
176
|
*/
|
|
145
|
-
pressed:
|
|
177
|
+
pressed: {
|
|
178
|
+
type: Boolean,
|
|
179
|
+
default: false
|
|
180
|
+
}
|
|
146
181
|
};
|
|
147
182
|
const LabelProps = {
|
|
148
183
|
/**
|
|
149
184
|
* The item label
|
|
150
185
|
*/
|
|
151
|
-
label:
|
|
186
|
+
label: {
|
|
187
|
+
type: [String, Number],
|
|
188
|
+
default: void 0
|
|
189
|
+
}
|
|
152
190
|
};
|
|
153
191
|
const ModifiersProps = {
|
|
154
192
|
/**
|
|
155
193
|
* Component BEM modifiers
|
|
156
194
|
*/
|
|
157
|
-
modifiers:
|
|
195
|
+
modifiers: {
|
|
196
|
+
type: [String, Array],
|
|
197
|
+
default: void 0
|
|
198
|
+
}
|
|
158
199
|
};
|
|
159
200
|
({
|
|
160
201
|
/**
|
|
161
202
|
* VvIcon name or props
|
|
162
203
|
* @see VVIcon
|
|
163
204
|
*/
|
|
164
|
-
icon: {
|
|
205
|
+
icon: {
|
|
206
|
+
type: [String, Object],
|
|
207
|
+
default: void 0
|
|
208
|
+
},
|
|
165
209
|
/**
|
|
166
210
|
* VvIcon position
|
|
167
211
|
*/
|
|
@@ -198,7 +242,8 @@ const UnselectableProps = {
|
|
|
198
242
|
* Dropdown show / hide transition name
|
|
199
243
|
*/
|
|
200
244
|
transitionName: {
|
|
201
|
-
type: String
|
|
245
|
+
type: String,
|
|
246
|
+
default: void 0
|
|
202
247
|
},
|
|
203
248
|
/**
|
|
204
249
|
* Offset of the dropdown from the trigger
|
|
@@ -266,7 +311,8 @@ const UnselectableProps = {
|
|
|
266
311
|
* Set dropdown width to the same as the trigger
|
|
267
312
|
*/
|
|
268
313
|
triggerWidth: {
|
|
269
|
-
type: Boolean
|
|
314
|
+
type: Boolean,
|
|
315
|
+
default: false
|
|
270
316
|
}
|
|
271
317
|
});
|
|
272
318
|
({
|
|
@@ -274,6 +320,7 @@ const UnselectableProps = {
|
|
|
274
320
|
...LabelProps,
|
|
275
321
|
...PressedProps,
|
|
276
322
|
...ActiveProps,
|
|
323
|
+
...CurrentProps,
|
|
277
324
|
...LinkProps,
|
|
278
325
|
/**
|
|
279
326
|
* Button type
|
|
@@ -289,6 +336,13 @@ const UnselectableProps = {
|
|
|
289
336
|
ariaLabel: {
|
|
290
337
|
type: String,
|
|
291
338
|
default: void 0
|
|
339
|
+
},
|
|
340
|
+
/**
|
|
341
|
+
* Default tag for the action
|
|
342
|
+
*/
|
|
343
|
+
defaultTag: {
|
|
344
|
+
type: String,
|
|
345
|
+
default: ActionTag.button
|
|
292
346
|
}
|
|
293
347
|
});
|
|
294
348
|
function useModifiers(prefix, modifiers, others) {
|
|
@@ -369,11 +423,16 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
369
423
|
title: unref(hintLabel)
|
|
370
424
|
}, [
|
|
371
425
|
renderSlot(_ctx.$slots, "hint", normalizeProps(guardReactiveProps({ disabled: _ctx.disabled, selected: _ctx.selected, unselectable: _ctx.unselectable })), () => [
|
|
372
|
-
createTextVNode(
|
|
426
|
+
createTextVNode(
|
|
427
|
+
toDisplayString(unref(hintLabel)),
|
|
428
|
+
1
|
|
429
|
+
/* TEXT */
|
|
430
|
+
)
|
|
373
431
|
])
|
|
374
432
|
], 8, _hoisted_1)
|
|
375
433
|
]),
|
|
376
434
|
_: 3
|
|
435
|
+
/* FORWARDED */
|
|
377
436
|
}, 8, ["class", "tabindex", "aria-selected", "aria-disabled"]);
|
|
378
437
|
};
|
|
379
438
|
}
|
|
@@ -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).VvDropdownOption=t(e.vue,null,e.core)}(this,(function(e,t,o){"use strict";var n=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(n||{}),l=(e=>(e.before="before",e.after="after",e))(l||{}),r=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(r||{}),
|
|
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).VvDropdownOption=t(e.vue,null,e.core)}(this,(function(e,t,o){"use strict";var n=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(n||{}),l=(e=>(e.before="before",e.after="after",e))(l||{}),r=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(r||{}),d=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(d||{}),a=(e=>(e.button="button",e.link="link",e.menuitem="menuitem",e))(a||{});const i=Symbol.for("dropdownItem"),s=Symbol.for("dropdownAction");const u=e.defineComponent({name:"VvDropdownItem",setup(t){const{role:n,expanded:l}=e.inject(i,{}),r=e.ref(null);!function({expanded:t}){e.provide(s,{role:e.ref(a.menuitem),expanded:t})}({expanded:l});const d=o.useElementHover(r),{focused:u}=o.useFocus(r),{focused:c}=o.useFocusWithin(r);return e.watch(d,(e=>{e&&(u.value=!0)})),(t,o)=>(e.openBlock(),e.createElementBlock("div",e.mergeProps({role:e.unref(n)},{ref_key:"element",ref:r,class:["vv-dropdown__item",{"focus-visible":e.unref(u)||e.unref(c)}]}),[e.renderSlot(t.$slots,"default")],16))}}),c={disabled:{type:Boolean,default:!1}},f={selected:{type:Boolean,default:!1}},p=(Boolean,Boolean,Boolean,{modifiers:{type:[String,Array],default:void 0}});l.before;const b={unselectable:{type:Boolean,default:!0}};n.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,r.button,d.button;const m=["title"];return e.defineComponent({name:"VvDropdownOption",props:{...c,...f,...b,...p,deselectHintLabel:{type:String},selectHintLabel:{type:String},selectedHintLabel:{type:String}},setup(t){const o=t,{modifiers:n}=e.toRefs(o),l=function(t,o,n){return e.computed((()=>{const l={[t]:!0},r="string"==typeof(null==o?void 0:o.value)?o.value.split(" "):null==o?void 0:o.value;return r&&Array.isArray(r)&&r.forEach((e=>{e&&(l[`${t}--${e}`]=!0)})),n&&Object.keys(n.value).forEach((o=>{l[`${t}--${o}`]=e.unref(n.value[o])})),l}))}("vv-dropdown-option",n,e.computed((()=>({disabled:o.disabled,selected:o.selected,unselectable:o.unselectable&&o.selected})))),r=e.computed((()=>o.selected?o.unselectable?o.deselectHintLabel:o.selectedHintLabel:o.disabled?void 0:o.selectHintLabel));return(t,o)=>(e.openBlock(),e.createBlock(u,{class:e.normalizeClass(e.unref(l)),tabindex:t.disabled?-1:0,"aria-selected":t.selected,"aria-disabled":t.disabled},{default:e.withCtx((()=>[e.renderSlot(t.$slots,"default"),e.createElementVNode("span",{class:"vv-dropdown-option__hint",title:e.unref(r)},[e.renderSlot(t.$slots,"hint",e.normalizeProps(e.guardReactiveProps({disabled:t.disabled,selected:t.selected,unselectable:t.unselectable})),(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)),1)]))],8,m)])),_:3},8,["class","tabindex","aria-selected","aria-disabled"]))}})}));
|