@volverjs/ui-vue 0.0.10-beta.14 → 0.0.10-beta.16
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 +96 -2
- package/auto-imports.d.ts +2 -0
- package/dist/components/VvAccordion/VvAccordion.es.js +33 -9
- package/dist/components/VvAccordion/VvAccordion.umd.js +1 -1
- package/dist/components/VvAccordion/VvAccordion.vue.d.ts +9 -2
- package/dist/components/VvAccordion/index.d.ts +4 -1
- package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +33 -9
- package/dist/components/VvAccordionGroup/VvAccordionGroup.umd.js +1 -1
- package/dist/components/VvAccordionGroup/VvAccordionGroup.vue.d.ts +9 -2
- package/dist/components/VvAccordionGroup/index.d.ts +4 -1
- package/dist/components/VvAction/VvAction.es.js +29 -8
- package/dist/components/VvAction/VvAction.umd.js +1 -1
- package/dist/components/VvAction/VvAction.vue.d.ts +44 -10
- package/dist/components/VvAction/index.d.ts +21 -5
- package/dist/components/VvAlert/VvAlert.es.js +91 -107
- package/dist/components/VvAlert/VvAlert.umd.js +1 -1
- package/dist/components/VvAlert/VvAlert.vue.d.ts +14 -4
- package/dist/components/VvAlert/index.d.ts +7 -3
- package/dist/components/VvAlertGroup/VvAlertGroup.es.js +91 -107
- package/dist/components/VvAlertGroup/VvAlertGroup.umd.js +1 -1
- package/dist/components/VvAlertGroup/VvAlertGroup.vue.d.ts +9 -2
- package/dist/components/VvAlertGroup/index.d.ts +6 -2
- package/dist/components/VvAvatar/VvAvatar.es.js +33 -9
- package/dist/components/VvAvatar/VvAvatar.umd.js +1 -1
- package/dist/components/VvAvatar/VvAvatar.vue.d.ts +11 -3
- package/dist/components/VvAvatar/index.d.ts +4 -1
- package/dist/components/VvAvatarGroup/VvAvatarGroup.es.js +33 -9
- package/dist/components/VvAvatarGroup/VvAvatarGroup.umd.js +1 -1
- package/dist/components/VvAvatarGroup/VvAvatarGroup.vue.d.ts +9 -2
- package/dist/components/VvAvatarGroup/index.d.ts +4 -1
- package/dist/components/VvBadge/VvBadge.es.js +33 -9
- package/dist/components/VvBadge/VvBadge.umd.js +1 -1
- package/dist/components/VvBadge/VvBadge.vue.d.ts +11 -3
- package/dist/components/VvBadge/index.d.ts +4 -1
- package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +33 -9
- package/dist/components/VvBreadcrumb/VvBreadcrumb.umd.js +1 -1
- package/dist/components/VvBreadcrumb/VvBreadcrumb.vue.d.ts +11 -3
- package/dist/components/VvBreadcrumb/index.d.ts +4 -1
- package/dist/components/VvButton/VvButton.es.js +100 -119
- package/dist/components/VvButton/VvButton.umd.js +1 -1
- package/dist/components/VvButton/VvButton.vue.d.ts +78 -20
- package/dist/components/VvButton/index.d.ts +34 -12
- package/dist/components/VvButtonGroup/VvButtonGroup.es.js +33 -9
- package/dist/components/VvButtonGroup/VvButtonGroup.umd.js +1 -1
- package/dist/components/VvButtonGroup/VvButtonGroup.vue.d.ts +17 -4
- package/dist/components/VvButtonGroup/index.d.ts +8 -2
- package/dist/components/VvCard/VvCard.es.js +33 -9
- package/dist/components/VvCard/VvCard.umd.js +1 -1
- package/dist/components/VvCard/VvCard.vue.d.ts +11 -3
- package/dist/components/VvCard/index.d.ts +4 -1
- package/dist/components/VvCheckbox/VvCheckbox.es.js +56 -17
- package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -1
- package/dist/components/VvCheckbox/VvCheckbox.vue.d.ts +94 -22
- package/dist/components/VvCheckbox/index.d.ts +44 -11
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +64 -19
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.vue.d.ts +93 -22
- package/dist/components/VvCheckboxGroup/index.d.ts +44 -11
- package/dist/components/VvCombobox/VvCombobox.es.js +108 -165
- package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
- package/dist/components/VvCombobox/VvCombobox.vue.d.ts +97 -24
- package/dist/components/VvCombobox/index.d.ts +42 -11
- package/dist/components/VvDialog/VvDialog.es.js +51 -103
- package/dist/components/VvDialog/VvDialog.umd.js +1 -1
- package/dist/components/VvDropdown/VvDropdown.es.js +33 -9
- package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
- package/dist/components/VvDropdown/VvDropdown.vue.d.ts +14 -2
- package/dist/components/VvDropdown/VvDropdownAction.vue.d.ts +61 -12
- package/dist/components/VvDropdown/VvDropdownOptgroup.vue.d.ts +11 -3
- package/dist/components/VvDropdown/VvDropdownOption.vue.d.ts +25 -6
- package/dist/components/VvDropdown/index.d.ts +6 -1
- package/dist/components/VvDropdownAction/VvDropdownAction.es.js +33 -9
- package/dist/components/VvDropdownAction/VvDropdownAction.umd.js +1 -1
- package/dist/components/VvDropdownOptgroup/VvDropdownOptgroup.es.js +29 -8
- package/dist/components/VvDropdownOptgroup/VvDropdownOptgroup.umd.js +1 -1
- package/dist/components/VvDropdownOption/VvDropdownOption.es.js +37 -10
- package/dist/components/VvDropdownOption/VvDropdownOption.umd.js +1 -1
- package/dist/components/VvIcon/VvIcon.es.js +22 -95
- package/dist/components/VvIcon/VvIcon.umd.js +1 -1
- package/dist/components/VvIcon/VvIcon.vue.d.ts +81 -44
- package/dist/components/VvIcon/index.d.ts +21 -48
- package/dist/components/VvInputFile/VvInputFile.es.js +108 -124
- package/dist/components/VvInputFile/VvInputFile.umd.js +1 -1
- package/dist/components/VvInputFile/VvInputFile.vue.d.ts +52 -12
- package/dist/components/VvInputFile/index.d.ts +24 -6
- package/dist/components/VvInputText/VvInputText.es.js +115 -147
- package/dist/components/VvInputText/VvInputText.umd.js +1 -1
- package/dist/components/VvInputText/VvInputText.vue.d.ts +141 -34
- package/dist/components/VvInputText/index.d.ts +71 -26
- package/dist/components/VvNav/VvNav.es.js +33 -9
- package/dist/components/VvNav/VvNav.umd.js +1 -1
- package/dist/components/VvNav/VvNav.vue.d.ts +9 -2
- package/dist/components/VvNav/index.d.ts +4 -1
- package/dist/components/VvNavItem/VvNavItem.es.js +29 -8
- package/dist/components/VvNavItem/VvNavItem.umd.js +1 -1
- package/dist/components/VvProgress/VvProgress.es.js +33 -9
- package/dist/components/VvProgress/VvProgress.umd.js +1 -1
- package/dist/components/VvProgress/VvProgress.vue.d.ts +9 -2
- package/dist/components/VvProgress/index.d.ts +4 -1
- package/dist/components/VvRadio/VvRadio.es.js +56 -17
- package/dist/components/VvRadio/VvRadio.umd.js +1 -1
- package/dist/components/VvRadio/VvRadio.vue.d.ts +94 -22
- package/dist/components/VvRadio/index.d.ts +44 -11
- package/dist/components/VvRadioGroup/VvRadioGroup.es.js +64 -19
- package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
- package/dist/components/VvRadioGroup/VvRadioGroup.vue.d.ts +93 -22
- package/dist/components/VvRadioGroup/index.d.ts +44 -11
- package/dist/components/VvSelect/VvSelect.es.js +95 -138
- package/dist/components/VvSelect/VvSelect.umd.js +1 -1
- package/dist/components/VvSelect/VvSelect.vue.d.ts +97 -24
- package/dist/components/VvSelect/index.d.ts +46 -12
- package/dist/components/VvTab/VvTab.es.js +33 -9
- package/dist/components/VvTab/VvTab.umd.js +1 -1
- package/dist/components/VvTab/VvTab.vue.d.ts +9 -2
- package/dist/components/VvTab/index.d.ts +4 -1
- package/dist/components/VvTextarea/VvTextarea.es.js +109 -143
- package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
- package/dist/components/VvTextarea/VvTextarea.vue.d.ts +141 -34
- package/dist/components/VvTextarea/index.d.ts +66 -17
- package/dist/components/VvTooltip/VvTooltip.es.js +33 -9
- package/dist/components/VvTooltip/VvTooltip.umd.js +1 -1
- package/dist/components/VvTooltip/VvTooltip.vue.d.ts +9 -2
- package/dist/components/VvTooltip/index.d.ts +4 -1
- package/dist/components/index.es.js +179 -233
- package/dist/components/index.umd.js +1 -1
- package/dist/composables/useComponentIcon.d.ts +9 -8
- package/dist/directives/index.es.js +33 -9
- package/dist/directives/index.umd.js +1 -1
- package/dist/directives/v-tooltip.es.js +33 -9
- package/dist/directives/v-tooltip.umd.js +1 -1
- package/dist/icons.es.js +3 -3
- package/dist/icons.umd.js +1 -1
- package/dist/props/index.d.ts +251 -61
- package/dist/stories/AccordionGroup/AccordionGroup.stories.d.ts +15 -4
- package/dist/stories/AccordionGroup/AccordionGroupSlots.stories.d.ts +77 -22
- package/dist/stories/Icon/Icon.settings.d.ts +1 -0
- package/package.json +33 -33
- 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/VvAlert/index.ts +1 -3
- package/src/components/VvAlertGroup/index.ts +2 -1
- package/src/components/VvButton/VvButton.vue +6 -6
- package/src/components/VvButton/index.ts +2 -4
- package/src/components/VvCombobox/VvCombobox.vue +5 -8
- package/src/components/VvIcon/VvIcon.vue +2 -2
- package/src/components/VvIcon/index.ts +22 -48
- package/src/components/VvInputFile/VvInputFile.vue +1 -1
- package/src/components/VvInputText/VvInputText.vue +11 -12
- package/src/components/VvSelect/VvSelect.vue +5 -8
- package/src/components/VvTextarea/VvTextarea.vue +5 -8
- package/src/composables/useComponentIcon.ts +15 -14
- package/src/props/index.ts +89 -25
- package/src/stories/Icon/Icon.settings.ts +3 -3
package/README.md
CHANGED
|
@@ -219,7 +219,100 @@ function showSuccess() {
|
|
|
219
219
|
</div>
|
|
220
220
|
```
|
|
221
221
|
|
|
222
|
-
###
|
|
222
|
+
### useBlurhash
|
|
223
|
+
|
|
224
|
+
Used to create blurred preview image ([blurhash](https://blurha.sh/))
|
|
225
|
+
|
|
226
|
+
##### Example
|
|
227
|
+
|
|
228
|
+
```typescript
|
|
229
|
+
import { useBlurhash } from '@volverjs/ui-vue/composables'
|
|
230
|
+
|
|
231
|
+
const { encode, decode, loadImage } = useBlurhash()
|
|
232
|
+
|
|
233
|
+
const isLoading = ref(false)
|
|
234
|
+
const file = ref({})
|
|
235
|
+
const canvas = ref()
|
|
236
|
+
const isImgLoaded = ref(false)
|
|
237
|
+
const blurhash = ref('')
|
|
238
|
+
const imageUrl = ref('')
|
|
239
|
+
const image = ref()
|
|
240
|
+
|
|
241
|
+
watch(
|
|
242
|
+
file,
|
|
243
|
+
async (newValue) => {
|
|
244
|
+
if (newValue?.size) {
|
|
245
|
+
this.imageUrl = URL.createObjectURL(newValue)
|
|
246
|
+
this.image = await this.loadImage(this.imageUrl)
|
|
247
|
+
this.blurhash = await this.encode(newValue)
|
|
248
|
+
} else {
|
|
249
|
+
this.image = null
|
|
250
|
+
this.imageUrl = ''
|
|
251
|
+
this.blurhash = ''
|
|
252
|
+
}
|
|
253
|
+
},
|
|
254
|
+
{ immediate: true }
|
|
255
|
+
)
|
|
256
|
+
|
|
257
|
+
watch(blurhash, async (newValue) => {
|
|
258
|
+
if (this.image) {
|
|
259
|
+
const blurhashDecoded = await this.decode(
|
|
260
|
+
newValue,
|
|
261
|
+
this.image.width,
|
|
262
|
+
this.image.height
|
|
263
|
+
)
|
|
264
|
+
|
|
265
|
+
if (this.canvas) {
|
|
266
|
+
this.canvas.width = this.image.width
|
|
267
|
+
this.canvas.height = this.image.height
|
|
268
|
+
const ctx = this.canvas.getContext('2d')
|
|
269
|
+
const imageData = ctx.createImageData(
|
|
270
|
+
this.canvas.width,
|
|
271
|
+
this.canvas.height
|
|
272
|
+
)
|
|
273
|
+
imageData.data.set(blurhashDecoded)
|
|
274
|
+
ctx.putImageData(imageData, 0, 0)
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
})
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
```html
|
|
281
|
+
<div
|
|
282
|
+
class="w-full grid gap-md grid-cols-3 h-150"
|
|
283
|
+
:class="{ 'vv-skeleton': isLoading }"
|
|
284
|
+
>
|
|
285
|
+
<div class="w-150 h-150 col-span-1">
|
|
286
|
+
<div class="text-20 font-semibold mb-md">Upload image</div>
|
|
287
|
+
<vv-input-file
|
|
288
|
+
v-model="file"
|
|
289
|
+
name="input-file"
|
|
290
|
+
modifiers="drop-area square hidden"
|
|
291
|
+
accept=".gif,.jpg,.jpeg,.png,image/gif,image/jpeg,image/png"
|
|
292
|
+
/>
|
|
293
|
+
</div>
|
|
294
|
+
<div v-show="blurhash" class="h-150 col-span-2">
|
|
295
|
+
<picture class="flex gap-md justify-center">
|
|
296
|
+
<div>
|
|
297
|
+
<div class="text-20 font-semibold mb-md">Blurhash</div>
|
|
298
|
+
<canvas ref="canvas" class="w-150 h-150 block object-cover" />
|
|
299
|
+
</div>
|
|
300
|
+
<div>
|
|
301
|
+
<div class="text-20 font-semibold mb-md">Image</div>
|
|
302
|
+
<img
|
|
303
|
+
v-if="image"
|
|
304
|
+
class="w-150 h-150 block object-cover"
|
|
305
|
+
:class="{ 'vv-skeleton__item': isLoading }"
|
|
306
|
+
:src="imageUrl"
|
|
307
|
+
alt="image"
|
|
308
|
+
:width="image.width"
|
|
309
|
+
:height="image.height"
|
|
310
|
+
/>
|
|
311
|
+
</div>
|
|
312
|
+
</picture>
|
|
313
|
+
</div>
|
|
314
|
+
</div>
|
|
315
|
+
```
|
|
223
316
|
|
|
224
317
|
## Roadmap
|
|
225
318
|
|
|
@@ -232,7 +325,8 @@ The following features are planned for the next releases:
|
|
|
232
325
|
- [x] (v0.0.6) `VvAvatar` and `VvAvatarGroup` component;
|
|
233
326
|
- [x] (v0.0.6) Menus, navigation and tabs with `VvNav` and `VvTab`;
|
|
234
327
|
- [x] (v0.0.6) Alerts, notifications and toasts with `VvAlert` and `VvAlertGroup` component;
|
|
235
|
-
- [x] Multiple uploads with `VvInputFile`;
|
|
328
|
+
- [x] (v0.0.10) Multiple uploads with `VvInputFile`;
|
|
329
|
+
- [x] (v0.0.10) `useBlurhash` composable;
|
|
236
330
|
- [ ] Image crop and file previews;
|
|
237
331
|
- [ ] Loaders with `VvLoader` and `VvSkeleton`;
|
|
238
332
|
- [ ] `VvTable` component with sort, filters, pagination and cell editing;
|
package/auto-imports.d.ts
CHANGED
|
@@ -42,6 +42,7 @@ declare global {
|
|
|
42
42
|
const h: typeof import('vue')['h']
|
|
43
43
|
const ignorableWatch: typeof import('@vueuse/core')['ignorableWatch']
|
|
44
44
|
const inject: typeof import('vue')['inject']
|
|
45
|
+
const injectLocal: typeof import('@vueuse/core')['injectLocal']
|
|
45
46
|
const isDefined: typeof import('@vueuse/core')['isDefined']
|
|
46
47
|
const isEmpty: typeof import('./src/utils/ObjectUtilities')['isEmpty']
|
|
47
48
|
const isFunction: typeof import('./src/utils/ObjectUtilities')['isFunction']
|
|
@@ -75,6 +76,7 @@ declare global {
|
|
|
75
76
|
const pickBy: typeof import('./src/utils/ObjectUtilities')['pickBy']
|
|
76
77
|
const propsToObject: typeof import('./src/utils/ObjectUtilities')['propsToObject']
|
|
77
78
|
const provide: typeof import('vue')['provide']
|
|
79
|
+
const provideLocal: typeof import('@vueuse/core')['provideLocal']
|
|
78
80
|
const reactify: typeof import('@vueuse/core')['reactify']
|
|
79
81
|
const reactifyObject: typeof import('@vueuse/core')['reactifyObject']
|
|
80
82
|
const reactive: typeof import('vue')['reactive']
|
|
@@ -67,6 +67,7 @@ const LinkProps = {
|
|
|
67
67
|
*/
|
|
68
68
|
target: {
|
|
69
69
|
type: String,
|
|
70
|
+
default: void 0,
|
|
70
71
|
validator: (value) => Object.values(AnchorTarget).includes(value)
|
|
71
72
|
},
|
|
72
73
|
/**
|
|
@@ -81,44 +82,65 @@ const DisabledProps = {
|
|
|
81
82
|
/**
|
|
82
83
|
* Whether the form control is disabled
|
|
83
84
|
*/
|
|
84
|
-
disabled:
|
|
85
|
+
disabled: {
|
|
86
|
+
type: Boolean,
|
|
87
|
+
default: false
|
|
88
|
+
}
|
|
85
89
|
};
|
|
86
90
|
const ActiveProps = {
|
|
87
91
|
/**
|
|
88
92
|
* Whether the item is active
|
|
89
93
|
*/
|
|
90
|
-
active:
|
|
94
|
+
active: {
|
|
95
|
+
type: Boolean,
|
|
96
|
+
default: false
|
|
97
|
+
}
|
|
91
98
|
};
|
|
92
99
|
const CurrentProps = {
|
|
93
100
|
/**
|
|
94
101
|
* Whether the item is current
|
|
95
102
|
*/
|
|
96
|
-
current:
|
|
103
|
+
current: {
|
|
104
|
+
type: Boolean,
|
|
105
|
+
default: false
|
|
106
|
+
}
|
|
97
107
|
};
|
|
98
108
|
const PressedProps = {
|
|
99
109
|
/**
|
|
100
110
|
* Whether the item is pressed
|
|
101
111
|
*/
|
|
102
|
-
pressed:
|
|
112
|
+
pressed: {
|
|
113
|
+
type: Boolean,
|
|
114
|
+
default: false
|
|
115
|
+
}
|
|
103
116
|
};
|
|
104
117
|
const LabelProps = {
|
|
105
118
|
/**
|
|
106
119
|
* The item label
|
|
107
120
|
*/
|
|
108
|
-
label:
|
|
121
|
+
label: {
|
|
122
|
+
type: [String, Number],
|
|
123
|
+
default: void 0
|
|
124
|
+
}
|
|
109
125
|
};
|
|
110
126
|
const ModifiersProps = {
|
|
111
127
|
/**
|
|
112
128
|
* Component BEM modifiers
|
|
113
129
|
*/
|
|
114
|
-
modifiers:
|
|
130
|
+
modifiers: {
|
|
131
|
+
type: [String, Array],
|
|
132
|
+
default: void 0
|
|
133
|
+
}
|
|
115
134
|
};
|
|
116
135
|
({
|
|
117
136
|
/**
|
|
118
137
|
* VvIcon name or props
|
|
119
138
|
* @see VVIcon
|
|
120
139
|
*/
|
|
121
|
-
icon: {
|
|
140
|
+
icon: {
|
|
141
|
+
type: [String, Object],
|
|
142
|
+
default: void 0
|
|
143
|
+
},
|
|
122
144
|
/**
|
|
123
145
|
* VvIcon position
|
|
124
146
|
*/
|
|
@@ -149,7 +171,8 @@ const ModifiersProps = {
|
|
|
149
171
|
* Dropdown show / hide transition name
|
|
150
172
|
*/
|
|
151
173
|
transitionName: {
|
|
152
|
-
type: String
|
|
174
|
+
type: String,
|
|
175
|
+
default: void 0
|
|
153
176
|
},
|
|
154
177
|
/**
|
|
155
178
|
* Offset of the dropdown from the trigger
|
|
@@ -217,7 +240,8 @@ const ModifiersProps = {
|
|
|
217
240
|
* Set dropdown width to the same as the trigger
|
|
218
241
|
*/
|
|
219
242
|
triggerWidth: {
|
|
220
|
-
type: Boolean
|
|
243
|
+
type: Boolean,
|
|
244
|
+
default: false
|
|
221
245
|
}
|
|
222
246
|
});
|
|
223
247
|
({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?module.exports=o(require("vue"),require("uid"),require("@vueuse/core")):"function"==typeof define&&define.amd?define(["vue","uid","@vueuse/core"],o):(e="undefined"!=typeof globalThis?globalThis:e||self).VvAccordion=o(e.vue,e.uid,e.core)}(this,(function(e,o,t){"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||{}),u=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(u||{}),a=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(a||{});const l=Symbol.for("accordionGroup"),i=(Boolean,Boolean,Boolean,Boolean,{modifiers:[String,Array]});function d(o){const t=e.inject(o,void 0),r=e.computed((()=>{return o=t,!(null==(r=e.unref(o))||""===r||Array.isArray(r)&&0===r.length||!(r instanceof Date)&&"object"==typeof r&&0===Object.keys(r).length);var o,r}));return{group:t,isInGroup:r,getGroupOrLocalRef:function(o,r,n){if(null==t?void 0:t.value){const r=e.unref(t.value)[o];return e.computed({get:()=>null==r?void 0:r.value,set(e){r.value=e}})}const u=e.toRef(r,o);return e.computed({get:()=>u.value,set(e){n&&n(`update:${o}`,e)}})}}}n.before,r.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,u.button,a.button;const s={...i,name:String,title:String,content:String,modelValue:{type:Boolean,default:void 0},disabled:Boolean,not:Boolean};const c=["id","open"],v=["aria-controls","aria-expanded"],f=["aria-hidden"];return e.defineComponent({name:"VvAccordion",props:s,emits:["update:modelValue"],setup(r,{emit:n}){const u=r,a=e.useAttrs(),i=e.computed((()=>u.name||(null==a?void 0:a.id)||o.uid())),{modifiers:s,title:p,content:m,disabled:y,collapse:b,modelValue:g,isInGroup:B,not:A}=function(o,t){const{group:r,isInGroup:n,getGroupOrLocalRef:u}=d(l),{title:a,content:i}=e.toRefs(o),s=u("modelValue",o,t),c=u("not",o),v=u("collapse",o),f=e.computed((()=>{var e;return Boolean(o.disabled||(null==(e=null==r?void 0:r.value)?void 0:e.disabled.value))})),p=e.computed((()=>{let e=o.modifiers,t=null==r?void 0:r.value.modifiers.value;const n=new Set;return e&&(Array.isArray(e)||(e=e.split(" ")),e.forEach((e=>n.add(e)))),t&&(Array.isArray(t)||(t=t.split(" ")),t.forEach((e=>n.add(e)))),Array.from(n)}));return{modelValue:s,not:c,isInGroup:n,group:r,collapse:v,modifiers:p,disabled:f,title:a,content:i}}(u,n),h=e.ref(!1),V=e.computed({get:()=>{let e=g.value;return B.value?e=b.value&&Array.isArray(g.value)?g.value.includes(i.value):g.value===i.value:void 0===g.value&&(e=h.value),A.value?!e:e},set:e=>{if(A.value&&(e=!e),B.value)return b.value&&Array.isArray(g.value)?e?void g.value.push(i.value):void(g.value=g.value.filter((e=>e!==i.value))):void(g.value=e?i.value:null);void 0!==g.value||"boolean"!=typeof e?g.value=e:h.value=e}}),S=function(o,t,r){return e.computed((()=>{const n={[o]:!0},u="string"==typeof(null==t?void 0:t.value)?t.value.split(" "):null==t?void 0:t.value;return u&&Array.isArray(u)&&u.forEach((e=>{e&&(n[`${o}--${e}`]=!0)})),r&&Object.keys(r.value).forEach((t=>{n[`${o}--${t}`]=e.unref(r.value[t])})),n}))}("vv-accordion",s,e.computed((()=>({disabled:y.value})))),k=t.useToggle(V);return(o,t)=>(e.openBlock(),e.createElementBlock("details",{id:e.unref(i),class:e.normalizeClass(e.unref(S)),open:e.unref(V)},[e.createElementVNode("summary",{"aria-controls":e.unref(i),"aria-expanded":e.unref(V),class:"vv-accordion__summary",onClick:t[0]||(t[0]=e.withModifiers((o=>e.unref(k)()),["prevent"]))},[e.renderSlot(o.$slots,"summary",e.normalizeProps(e.guardReactiveProps({open:e.unref(V)})),(()=>[e.createTextVNode(e.toDisplayString(e.unref(p)),1)]))],8,v),e.createElementVNode("div",{"aria-hidden":!e.unref(V),class:"vv-accordion__content"},[e.renderSlot(o.$slots,"default",e.normalizeProps(e.guardReactiveProps({open:e.unref(V)})),(()=>[e.createTextVNode(e.toDisplayString(e.unref(m)),1)]))],8,f)],10,c))}})}));
|
|
1
|
+
!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?module.exports=o(require("vue"),require("uid"),require("@vueuse/core")):"function"==typeof define&&define.amd?define(["vue","uid","@vueuse/core"],o):(e="undefined"!=typeof globalThis?globalThis:e||self).VvAccordion=o(e.vue,e.uid,e.core)}(this,(function(e,o,t){"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||{}),u=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(u||{}),a=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(a||{});const l=Symbol.for("accordionGroup"),i=(Boolean,Boolean,Boolean,Boolean,{modifiers:{type:[String,Array],default:void 0}});function d(o){const t=e.inject(o,void 0),r=e.computed((()=>{return o=t,!(null==(r=e.unref(o))||""===r||Array.isArray(r)&&0===r.length||!(r instanceof Date)&&"object"==typeof r&&0===Object.keys(r).length);var o,r}));return{group:t,isInGroup:r,getGroupOrLocalRef:function(o,r,n){if(null==t?void 0:t.value){const r=e.unref(t.value)[o];return e.computed({get:()=>null==r?void 0:r.value,set(e){r.value=e}})}const u=e.toRef(r,o);return e.computed({get:()=>u.value,set(e){n&&n(`update:${o}`,e)}})}}}n.before,r.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,u.button,a.button;const s={...i,name:String,title:String,content:String,modelValue:{type:Boolean,default:void 0},disabled:Boolean,not:Boolean};const c=["id","open"],v=["aria-controls","aria-expanded"],f=["aria-hidden"];return e.defineComponent({name:"VvAccordion",props:s,emits:["update:modelValue"],setup(r,{emit:n}){const u=r,a=e.useAttrs(),i=e.computed((()=>u.name||(null==a?void 0:a.id)||o.uid())),{modifiers:s,title:p,content:m,disabled:y,collapse:b,modelValue:g,isInGroup:B,not:A}=function(o,t){const{group:r,isInGroup:n,getGroupOrLocalRef:u}=d(l),{title:a,content:i}=e.toRefs(o),s=u("modelValue",o,t),c=u("not",o),v=u("collapse",o),f=e.computed((()=>{var e;return Boolean(o.disabled||(null==(e=null==r?void 0:r.value)?void 0:e.disabled.value))})),p=e.computed((()=>{let e=o.modifiers,t=null==r?void 0:r.value.modifiers.value;const n=new Set;return e&&(Array.isArray(e)||(e=e.split(" ")),e.forEach((e=>n.add(e)))),t&&(Array.isArray(t)||(t=t.split(" ")),t.forEach((e=>n.add(e)))),Array.from(n)}));return{modelValue:s,not:c,isInGroup:n,group:r,collapse:v,modifiers:p,disabled:f,title:a,content:i}}(u,n),h=e.ref(!1),V=e.computed({get:()=>{let e=g.value;return B.value?e=b.value&&Array.isArray(g.value)?g.value.includes(i.value):g.value===i.value:void 0===g.value&&(e=h.value),A.value?!e:e},set:e=>{if(A.value&&(e=!e),B.value)return b.value&&Array.isArray(g.value)?e?void g.value.push(i.value):void(g.value=g.value.filter((e=>e!==i.value))):void(g.value=e?i.value:null);void 0!==g.value||"boolean"!=typeof e?g.value=e:h.value=e}}),S=function(o,t,r){return e.computed((()=>{const n={[o]:!0},u="string"==typeof(null==t?void 0:t.value)?t.value.split(" "):null==t?void 0:t.value;return u&&Array.isArray(u)&&u.forEach((e=>{e&&(n[`${o}--${e}`]=!0)})),r&&Object.keys(r.value).forEach((t=>{n[`${o}--${t}`]=e.unref(r.value[t])})),n}))}("vv-accordion",s,e.computed((()=>({disabled:y.value})))),k=t.useToggle(V);return(o,t)=>(e.openBlock(),e.createElementBlock("details",{id:e.unref(i),class:e.normalizeClass(e.unref(S)),open:e.unref(V)},[e.createElementVNode("summary",{"aria-controls":e.unref(i),"aria-expanded":e.unref(V),class:"vv-accordion__summary",onClick:t[0]||(t[0]=e.withModifiers((o=>e.unref(k)()),["prevent"]))},[e.renderSlot(o.$slots,"summary",e.normalizeProps(e.guardReactiveProps({open:e.unref(V)})),(()=>[e.createTextVNode(e.toDisplayString(e.unref(p)),1)]))],8,v),e.createElementVNode("div",{"aria-hidden":!e.unref(V),class:"vv-accordion__content"},[e.renderSlot(o.$slots,"default",e.normalizeProps(e.guardReactiveProps({open:e.unref(V)})),(()=>[e.createTextVNode(e.toDisplayString(e.unref(m)),1)]))],8,f)],10,c))}})}));
|
|
@@ -8,7 +8,10 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
8
8
|
};
|
|
9
9
|
disabled: BooleanConstructor;
|
|
10
10
|
not: BooleanConstructor;
|
|
11
|
-
modifiers:
|
|
11
|
+
modifiers: {
|
|
12
|
+
type: globalThis.PropType<string | string[]>;
|
|
13
|
+
default: undefined;
|
|
14
|
+
};
|
|
12
15
|
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
13
16
|
[x: string]: (...args: any[]) => void;
|
|
14
17
|
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
@@ -21,10 +24,14 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
21
24
|
};
|
|
22
25
|
disabled: BooleanConstructor;
|
|
23
26
|
not: BooleanConstructor;
|
|
24
|
-
modifiers:
|
|
27
|
+
modifiers: {
|
|
28
|
+
type: globalThis.PropType<string | string[]>;
|
|
29
|
+
default: undefined;
|
|
30
|
+
};
|
|
25
31
|
}>>, {
|
|
26
32
|
disabled: boolean;
|
|
27
33
|
modelValue: boolean;
|
|
34
|
+
modifiers: string | string[];
|
|
28
35
|
not: boolean;
|
|
29
36
|
}, {}>, {
|
|
30
37
|
summary?(_: {
|
|
@@ -28,7 +28,10 @@ export declare const VvAccordionProps: {
|
|
|
28
28
|
* If true, the accordion will be opened by default
|
|
29
29
|
*/
|
|
30
30
|
not: BooleanConstructor;
|
|
31
|
-
modifiers:
|
|
31
|
+
modifiers: {
|
|
32
|
+
type: globalThis.PropType<string | string[]>;
|
|
33
|
+
default: undefined;
|
|
34
|
+
};
|
|
32
35
|
};
|
|
33
36
|
export declare const VvAccordionEvents: string[];
|
|
34
37
|
export type VvAccordionPropsTypes = ExtractPropTypes<typeof VvAccordionProps>;
|
|
@@ -67,6 +67,7 @@ const LinkProps = {
|
|
|
67
67
|
*/
|
|
68
68
|
target: {
|
|
69
69
|
type: String,
|
|
70
|
+
default: void 0,
|
|
70
71
|
validator: (value) => Object.values(AnchorTarget).includes(value)
|
|
71
72
|
},
|
|
72
73
|
/**
|
|
@@ -81,44 +82,65 @@ const DisabledProps = {
|
|
|
81
82
|
/**
|
|
82
83
|
* Whether the form control is disabled
|
|
83
84
|
*/
|
|
84
|
-
disabled:
|
|
85
|
+
disabled: {
|
|
86
|
+
type: Boolean,
|
|
87
|
+
default: false
|
|
88
|
+
}
|
|
85
89
|
};
|
|
86
90
|
const ActiveProps = {
|
|
87
91
|
/**
|
|
88
92
|
* Whether the item is active
|
|
89
93
|
*/
|
|
90
|
-
active:
|
|
94
|
+
active: {
|
|
95
|
+
type: Boolean,
|
|
96
|
+
default: false
|
|
97
|
+
}
|
|
91
98
|
};
|
|
92
99
|
const CurrentProps = {
|
|
93
100
|
/**
|
|
94
101
|
* Whether the item is current
|
|
95
102
|
*/
|
|
96
|
-
current:
|
|
103
|
+
current: {
|
|
104
|
+
type: Boolean,
|
|
105
|
+
default: false
|
|
106
|
+
}
|
|
97
107
|
};
|
|
98
108
|
const PressedProps = {
|
|
99
109
|
/**
|
|
100
110
|
* Whether the item is pressed
|
|
101
111
|
*/
|
|
102
|
-
pressed:
|
|
112
|
+
pressed: {
|
|
113
|
+
type: Boolean,
|
|
114
|
+
default: false
|
|
115
|
+
}
|
|
103
116
|
};
|
|
104
117
|
const LabelProps = {
|
|
105
118
|
/**
|
|
106
119
|
* The item label
|
|
107
120
|
*/
|
|
108
|
-
label:
|
|
121
|
+
label: {
|
|
122
|
+
type: [String, Number],
|
|
123
|
+
default: void 0
|
|
124
|
+
}
|
|
109
125
|
};
|
|
110
126
|
const ModifiersProps = {
|
|
111
127
|
/**
|
|
112
128
|
* Component BEM modifiers
|
|
113
129
|
*/
|
|
114
|
-
modifiers:
|
|
130
|
+
modifiers: {
|
|
131
|
+
type: [String, Array],
|
|
132
|
+
default: void 0
|
|
133
|
+
}
|
|
115
134
|
};
|
|
116
135
|
({
|
|
117
136
|
/**
|
|
118
137
|
* VvIcon name or props
|
|
119
138
|
* @see VVIcon
|
|
120
139
|
*/
|
|
121
|
-
icon: {
|
|
140
|
+
icon: {
|
|
141
|
+
type: [String, Object],
|
|
142
|
+
default: void 0
|
|
143
|
+
},
|
|
122
144
|
/**
|
|
123
145
|
* VvIcon position
|
|
124
146
|
*/
|
|
@@ -149,7 +171,8 @@ const ModifiersProps = {
|
|
|
149
171
|
* Dropdown show / hide transition name
|
|
150
172
|
*/
|
|
151
173
|
transitionName: {
|
|
152
|
-
type: String
|
|
174
|
+
type: String,
|
|
175
|
+
default: void 0
|
|
153
176
|
},
|
|
154
177
|
/**
|
|
155
178
|
* Offset of the dropdown from the trigger
|
|
@@ -217,7 +240,8 @@ const ModifiersProps = {
|
|
|
217
240
|
* Set dropdown width to the same as the trigger
|
|
218
241
|
*/
|
|
219
242
|
triggerWidth: {
|
|
220
|
-
type: Boolean
|
|
243
|
+
type: Boolean,
|
|
244
|
+
default: false
|
|
221
245
|
}
|
|
222
246
|
});
|
|
223
247
|
({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?module.exports=o(require("vue"),require("uid"),require("@vueuse/core")):"function"==typeof define&&define.amd?define(["vue","uid","@vueuse/core"],o):(e="undefined"!=typeof globalThis?globalThis:e||self).VvAccordionGroup=o(e.vue,e.uid,e.core)}(this,(function(e,o,
|
|
1
|
+
!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?module.exports=o(require("vue"),require("uid"),require("@vueuse/core")):"function"==typeof define&&define.amd?define(["vue","uid","@vueuse/core"],o):(e="undefined"!=typeof globalThis?globalThis:e||self).VvAccordionGroup=o(e.vue,e.uid,e.core)}(this,(function(e,o,t){"use strict";var r=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(r||{}),l=(e=>(e.before="before",e.after="after",e))(l||{}),a=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(a||{}),n=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(n||{});const u=Symbol.for("accordionGroup"),i=(Boolean,Boolean,Boolean,Boolean,{modifiers:{type:[String,Array],default:void 0}});function d(o){const t=e.inject(o,void 0),r=e.computed((()=>{return o=t,!(null==(r=e.unref(o))||""===r||Array.isArray(r)&&0===r.length||!(r instanceof Date)&&"object"==typeof r&&0===Object.keys(r).length);var o,r}));return{group:t,isInGroup:r,getGroupOrLocalRef:function(o,r,l){if(null==t?void 0:t.value){const r=e.unref(t.value)[o];return e.computed({get:()=>null==r?void 0:r.value,set(e){r.value=e}})}const a=e.toRef(r,o);return e.computed({get:()=>a.value,set(e){l&&l(`update:${o}`,e)}})}}}l.before,r.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,a.button,n.button;const s={...i,name:String,title:String,content:String,modelValue:{type:Boolean,default:void 0},disabled:Boolean,not:Boolean};function c(o,t,r){return e.computed((()=>{const l={[o]:!0},a="string"==typeof(null==t?void 0:t.value)?t.value.split(" "):null==t?void 0:t.value;return a&&Array.isArray(a)&&a.forEach((e=>{e&&(l[`${o}--${e}`]=!0)})),r&&Object.keys(r.value).forEach((t=>{l[`${o}--${t}`]=e.unref(r.value[t])})),l}))}const v=["id","open"],p=["aria-controls","aria-expanded"],m=["aria-hidden"],f=e.defineComponent({name:"VvAccordion",props:s,emits:["update:modelValue"],setup(r,{emit:l}){const a=r,n=e.useAttrs(),i=e.computed((()=>a.name||(null==n?void 0:n.id)||o.uid())),{modifiers:s,title:f,content:y,disabled:g,collapse:b,modelValue:A,isInGroup:B,not:V}=function(o,t){const{group:r,isInGroup:l,getGroupOrLocalRef:a}=d(u),{title:n,content:i}=e.toRefs(o),s=a("modelValue",o,t),c=a("not",o),v=a("collapse",o),p=e.computed((()=>{var e;return Boolean(o.disabled||(null==(e=null==r?void 0:r.value)?void 0:e.disabled.value))})),m=e.computed((()=>{let e=o.modifiers,t=null==r?void 0:r.value.modifiers.value;const l=new Set;return e&&(Array.isArray(e)||(e=e.split(" ")),e.forEach((e=>l.add(e)))),t&&(Array.isArray(t)||(t=t.split(" ")),t.forEach((e=>l.add(e)))),Array.from(l)}));return{modelValue:s,not:c,isInGroup:l,group:r,collapse:v,modifiers:m,disabled:p,title:n,content:i}}(a,l),h=e.ref(!1),k=e.computed({get:()=>{let e=A.value;return B.value?e=b.value&&Array.isArray(A.value)?A.value.includes(i.value):A.value===i.value:void 0===A.value&&(e=h.value),V.value?!e:e},set:e=>{if(V.value&&(e=!e),B.value)return b.value&&Array.isArray(A.value)?e?void A.value.push(i.value):void(A.value=A.value.filter((e=>e!==i.value))):void(A.value=e?i.value:null);void 0!==A.value||"boolean"!=typeof e?A.value=e:h.value=e}}),S=c("vv-accordion",s,e.computed((()=>({disabled:g.value})))),$=t.useToggle(k);return(o,t)=>(e.openBlock(),e.createElementBlock("details",{id:e.unref(i),class:e.normalizeClass(e.unref(S)),open:e.unref(k)},[e.createElementVNode("summary",{"aria-controls":e.unref(i),"aria-expanded":e.unref(k),class:"vv-accordion__summary",onClick:t[0]||(t[0]=e.withModifiers((o=>e.unref($)()),["prevent"]))},[e.renderSlot(o.$slots,"summary",e.normalizeProps(e.guardReactiveProps({open:e.unref(k)})),(()=>[e.createTextVNode(e.toDisplayString(e.unref(f)),1)]))],8,p),e.createElementVNode("div",{"aria-hidden":!e.unref(k),class:"vv-accordion__content"},[e.renderSlot(o.$slots,"default",e.normalizeProps(e.guardReactiveProps({open:e.unref(k)})),(()=>[e.createTextVNode(e.toDisplayString(e.unref(y)),1)]))],8,m)],10,v))}}),y={...i,modelValue:[String,Array],items:{type:Array,default:()=>[]},collapse:Boolean,itemModifiers:{type:[String,Array],default:""},disabled:Boolean,not:Boolean,storeKey:String};return e.defineComponent({name:"VvAccordionGroup",props:y,emits:["update:modelValue"],setup(o,{emit:r}){const l=o,{disabled:a,collapse:n,modifiers:i,itemModifiers:d,items:s,not:v}=e.toRefs(l);e.watchEffect((()=>{"string"==typeof l.modelValue&&n.value&&console.warn("[VvAccordionGroup]: modelValue is a string but collapse is true.")}));let p=e.ref([]);e.watch((()=>l.storeKey),(o=>{p=o?t.useStorage(o,p.value):e.ref([])}),{immediate:!0});const m=e.computed({get:()=>{var e;return void 0!==l.modelValue?n.value?l.modelValue:Array.isArray(l.modelValue)?l.modelValue[0]:l.modelValue:n.value?p.value:null==(e=p.value)?void 0:e[0]},set:e=>{if(void 0!==l.modelValue)return!Array.isArray(l.modelValue)&&!n.value||Array.isArray(e)||(e=[e]),r("update:modelValue",e);p.value=Array.isArray(e)?e:[e]}});!function(o){if(Object.keys(o).some((t=>"key"!==t&&!e.isRef(o[t]))))throw Error("One or more groupState props aren't ref.");e.provide(o.key,e.computed((()=>o)))}({key:u,modelValue:m,disabled:a,collapse:n,modifiers:d,not:v});const y=c("vv-accordion-group",i,e.computed((()=>({disabled:a.value}))));return(o,t)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(y))},[e.renderSlot(o.$slots,"default",{},(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(s),(t=>(e.openBlock(),e.createBlock(f,e.mergeProps({key:t.title},{name:t.name,title:t.title,content:t.content}),{header:e.withCtx((r=>[e.renderSlot(o.$slots,`header::${t.name}`,e.normalizeProps(e.guardReactiveProps(r)))])),details:e.withCtx((r=>[e.renderSlot(o.$slots,`details::${t.name}`,e.normalizeProps(e.guardReactiveProps(r)))])),_:2},1040)))),128))]))],2))}})}));
|
|
@@ -12,7 +12,10 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
12
12
|
disabled: BooleanConstructor;
|
|
13
13
|
not: BooleanConstructor;
|
|
14
14
|
storeKey: StringConstructor;
|
|
15
|
-
modifiers:
|
|
15
|
+
modifiers: {
|
|
16
|
+
type: globalThis.PropType<string | string[]>;
|
|
17
|
+
default: undefined;
|
|
18
|
+
};
|
|
16
19
|
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
17
20
|
[x: string]: (...args: any[]) => void;
|
|
18
21
|
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
@@ -29,9 +32,13 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
29
32
|
disabled: BooleanConstructor;
|
|
30
33
|
not: BooleanConstructor;
|
|
31
34
|
storeKey: StringConstructor;
|
|
32
|
-
modifiers:
|
|
35
|
+
modifiers: {
|
|
36
|
+
type: globalThis.PropType<string | string[]>;
|
|
37
|
+
default: undefined;
|
|
38
|
+
};
|
|
33
39
|
}>>, {
|
|
34
40
|
disabled: boolean;
|
|
41
|
+
modifiers: string | string[];
|
|
35
42
|
collapse: boolean;
|
|
36
43
|
not: boolean;
|
|
37
44
|
items: import(".").VvAccordionGroupItem[];
|
|
@@ -41,6 +41,9 @@ export declare const VvAccordionGroupProps: {
|
|
|
41
41
|
* Enable local storage persistence
|
|
42
42
|
*/
|
|
43
43
|
storeKey: StringConstructor;
|
|
44
|
-
modifiers:
|
|
44
|
+
modifiers: {
|
|
45
|
+
type: globalThis.PropType<string | string[]>;
|
|
46
|
+
default: undefined;
|
|
47
|
+
};
|
|
45
48
|
};
|
|
46
49
|
export declare const VvAccordionGroupEvents: string[];
|
|
@@ -71,6 +71,7 @@ const LinkProps = {
|
|
|
71
71
|
*/
|
|
72
72
|
target: {
|
|
73
73
|
type: String,
|
|
74
|
+
default: void 0,
|
|
74
75
|
validator: (value) => Object.values(AnchorTarget).includes(value)
|
|
75
76
|
},
|
|
76
77
|
/**
|
|
@@ -85,38 +86,56 @@ const DisabledProps = {
|
|
|
85
86
|
/**
|
|
86
87
|
* Whether the form control is disabled
|
|
87
88
|
*/
|
|
88
|
-
disabled:
|
|
89
|
+
disabled: {
|
|
90
|
+
type: Boolean,
|
|
91
|
+
default: false
|
|
92
|
+
}
|
|
89
93
|
};
|
|
90
94
|
const ActiveProps = {
|
|
91
95
|
/**
|
|
92
96
|
* Whether the item is active
|
|
93
97
|
*/
|
|
94
|
-
active:
|
|
98
|
+
active: {
|
|
99
|
+
type: Boolean,
|
|
100
|
+
default: false
|
|
101
|
+
}
|
|
95
102
|
};
|
|
96
103
|
const CurrentProps = {
|
|
97
104
|
/**
|
|
98
105
|
* Whether the item is current
|
|
99
106
|
*/
|
|
100
|
-
current:
|
|
107
|
+
current: {
|
|
108
|
+
type: Boolean,
|
|
109
|
+
default: false
|
|
110
|
+
}
|
|
101
111
|
};
|
|
102
112
|
const PressedProps = {
|
|
103
113
|
/**
|
|
104
114
|
* Whether the item is pressed
|
|
105
115
|
*/
|
|
106
|
-
pressed:
|
|
116
|
+
pressed: {
|
|
117
|
+
type: Boolean,
|
|
118
|
+
default: false
|
|
119
|
+
}
|
|
107
120
|
};
|
|
108
121
|
const LabelProps = {
|
|
109
122
|
/**
|
|
110
123
|
* The item label
|
|
111
124
|
*/
|
|
112
|
-
label:
|
|
125
|
+
label: {
|
|
126
|
+
type: [String, Number],
|
|
127
|
+
default: void 0
|
|
128
|
+
}
|
|
113
129
|
};
|
|
114
130
|
({
|
|
115
131
|
/**
|
|
116
132
|
* VvIcon name or props
|
|
117
133
|
* @see VVIcon
|
|
118
134
|
*/
|
|
119
|
-
icon: {
|
|
135
|
+
icon: {
|
|
136
|
+
type: [String, Object],
|
|
137
|
+
default: void 0
|
|
138
|
+
},
|
|
120
139
|
/**
|
|
121
140
|
* VvIcon position
|
|
122
141
|
*/
|
|
@@ -147,7 +166,8 @@ const LabelProps = {
|
|
|
147
166
|
* Dropdown show / hide transition name
|
|
148
167
|
*/
|
|
149
168
|
transitionName: {
|
|
150
|
-
type: String
|
|
169
|
+
type: String,
|
|
170
|
+
default: void 0
|
|
151
171
|
},
|
|
152
172
|
/**
|
|
153
173
|
* Offset of the dropdown from the trigger
|
|
@@ -215,7 +235,8 @@ const LabelProps = {
|
|
|
215
235
|
* Set dropdown width to the same as the trigger
|
|
216
236
|
*/
|
|
217
237
|
triggerWidth: {
|
|
218
|
-
type: Boolean
|
|
238
|
+
type: Boolean,
|
|
239
|
+
default: false
|
|
219
240
|
}
|
|
220
241
|
});
|
|
221
242
|
const ActionProps = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue")):"function"==typeof define&&define.amd?define(["vue"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VvAction=t(e.vue)}(this,(function(e){"use strict";var t=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(t||{}),o=(e=>(e.before="before",e.after="after",e))(o||{}),r=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(r||{}),n=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(n||{}),l=(e=>(e._blank="_blank",e._self="_self",e._parent="_parent",e._top="_top",e))(l||{});const a=Symbol.for("volver"),u=Symbol.for("dropdownTrigger"),i=Symbol.for("dropdownAction"),s={to:{type:[String,Object]},href:String,target:{type:String,validator:e=>Object.values(l).includes(e)},rel:{type:String,default:"noopener noreferrer"}},d={disabled:Boolean},c={active:Boolean},f={current:Boolean},
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue")):"function"==typeof define&&define.amd?define(["vue"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VvAction=t(e.vue)}(this,(function(e){"use strict";var t=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(t||{}),o=(e=>(e.before="before",e.after="after",e))(o||{}),r=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(r||{}),n=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(n||{}),l=(e=>(e._blank="_blank",e._self="_self",e._parent="_parent",e._top="_top",e))(l||{});const a=Symbol.for("volver"),u=Symbol.for("dropdownTrigger"),i=Symbol.for("dropdownAction"),s={to:{type:[String,Object]},href:String,target:{type:String,default:void 0,validator:e=>Object.values(l).includes(e)},rel:{type:String,default:"noopener noreferrer"}},d={disabled:{type:Boolean,default:!1}},c={active:{type:Boolean,default:!1}},f={current:{type:Boolean,default:!1}},p={pressed:{type:Boolean,default:!1}},v={label:{type:[String,Number],default:void 0}};o.before,t.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const b={...d,...v,...p,...c,...f,...s,type:{type:String,default:r.button,validator:e=>Object.values(r).includes(e)},ariaLabel:{type:String,default:void 0},defaultTag:{type:String,default:n.button}};return e.defineComponent({name:"VvAction",props:b,emits:["click","mouseover","mouseleave"],setup(t,{expose:o,emit:r}){const l=t,s=e.inject(a),d=e.ref(null);o({$el:d});const{reference:c,bus:f,aria:p,expanded:v}=e.inject(u,{});e.watch((()=>d.value),(e=>{c&&(c.value=e)}));const b=e.computed((()=>l.pressed||(null==v?void 0:v.value))),{role:m}=e.inject(i,{}),y=e.computed((()=>{switch(!0){case l.disabled:return n.button;case void 0!==l.to:return(null==s?void 0:s.nuxt)?n.nuxtLink:n.routerLink;case void 0!==l.href:return n.a;default:return l.defaultTag}})),g=e.computed((()=>{const e={...null==p?void 0:p.value,ariaPressed:!!b.value||void 0,ariaLabel:l.ariaLabel,role:null==m?void 0:m.value};switch(y.value){case n.a:return{...e,href:l.href,target:l.target,rel:l.rel};case n.routerLink:case n.nuxtLink:return{...e,to:l.to,target:l.target};case n.button:return{...e,type:l.type,disabled:l.disabled};default:return e}})),k=e=>{l.disabled?e.preventDefault():(null==f||f.emit("click",e),r("click",e))},B=e=>{null==f||f.emit("mouseover",e),r("mouseover",e)},h=e=>{null==f||f.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:d,class:{active:t.active,pressed:e.unref(b),disabled:t.disabled,current:t.current},onClickPassive:k,onMouseoverPassive:B,onMouseleavePassive:h}),{default:e.withCtx((()=>[e.renderSlot(t.$slots,"default",{},(()=>[e.createTextVNode(e.toDisplayString(t.label),1)]))])),_:3},16,["class"]))}})}));
|
|
@@ -19,17 +19,33 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
19
19
|
href: StringConstructor;
|
|
20
20
|
target: {
|
|
21
21
|
type: globalThis.PropType<"_blank" | "_self" | "_parent" | "_top">;
|
|
22
|
+
default: undefined;
|
|
22
23
|
validator: (value: import("../../constants").AnchorTarget) => boolean;
|
|
23
24
|
};
|
|
24
25
|
rel: {
|
|
25
26
|
type: StringConstructor;
|
|
26
27
|
default: string;
|
|
27
28
|
};
|
|
28
|
-
current:
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
current: {
|
|
30
|
+
type: BooleanConstructor;
|
|
31
|
+
default: boolean;
|
|
32
|
+
};
|
|
33
|
+
active: {
|
|
34
|
+
type: BooleanConstructor;
|
|
35
|
+
default: boolean;
|
|
36
|
+
};
|
|
37
|
+
pressed: {
|
|
38
|
+
type: BooleanConstructor;
|
|
39
|
+
default: boolean;
|
|
40
|
+
};
|
|
41
|
+
label: {
|
|
42
|
+
type: (StringConstructor | NumberConstructor)[];
|
|
43
|
+
default: undefined;
|
|
44
|
+
};
|
|
45
|
+
disabled: {
|
|
46
|
+
type: BooleanConstructor;
|
|
47
|
+
default: boolean;
|
|
48
|
+
};
|
|
33
49
|
}, {
|
|
34
50
|
$el: globalThis.Ref<HTMLElement | null>;
|
|
35
51
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
@@ -54,20 +70,38 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
54
70
|
href: StringConstructor;
|
|
55
71
|
target: {
|
|
56
72
|
type: globalThis.PropType<"_blank" | "_self" | "_parent" | "_top">;
|
|
73
|
+
default: undefined;
|
|
57
74
|
validator: (value: import("../../constants").AnchorTarget) => boolean;
|
|
58
75
|
};
|
|
59
76
|
rel: {
|
|
60
77
|
type: StringConstructor;
|
|
61
78
|
default: string;
|
|
62
79
|
};
|
|
63
|
-
current:
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
80
|
+
current: {
|
|
81
|
+
type: BooleanConstructor;
|
|
82
|
+
default: boolean;
|
|
83
|
+
};
|
|
84
|
+
active: {
|
|
85
|
+
type: BooleanConstructor;
|
|
86
|
+
default: boolean;
|
|
87
|
+
};
|
|
88
|
+
pressed: {
|
|
89
|
+
type: BooleanConstructor;
|
|
90
|
+
default: boolean;
|
|
91
|
+
};
|
|
92
|
+
label: {
|
|
93
|
+
type: (StringConstructor | NumberConstructor)[];
|
|
94
|
+
default: undefined;
|
|
95
|
+
};
|
|
96
|
+
disabled: {
|
|
97
|
+
type: BooleanConstructor;
|
|
98
|
+
default: boolean;
|
|
99
|
+
};
|
|
68
100
|
}>>, {
|
|
69
101
|
disabled: boolean;
|
|
102
|
+
label: string | number;
|
|
70
103
|
type: "button" | "submit" | "reset";
|
|
104
|
+
target: "_blank" | "_self" | "_parent" | "_top";
|
|
71
105
|
ariaLabel: string;
|
|
72
106
|
defaultTag: string;
|
|
73
107
|
rel: string;
|