@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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { provide, computed, unref, inject, defineComponent, ref, toRefs, openBlock, createBlock, mergeProps, createCommentVNode, watch, withModifiers, createElementBlock, normalizeProps, guardReactiveProps, renderSlot, createTextVNode, toDisplayString, createElementVNode, createVNode, TransitionGroup, toHandlers, withCtx, Fragment, renderList } from "vue";
|
|
1
|
+
import { provide, computed, unref, inject, defineComponent, mergeDefaults, ref, toRefs, openBlock, createBlock, mergeProps, createCommentVNode, watch, withModifiers, createElementBlock, normalizeProps, guardReactiveProps, renderSlot, createTextVNode, toDisplayString, createElementVNode, createVNode, TransitionGroup, toHandlers, withCtx, Fragment, renderList } from "vue";
|
|
2
2
|
import mitt from "mitt";
|
|
3
3
|
import { iconExists, Icon, addIcon } from "@iconify/vue";
|
|
4
4
|
import { uid } from "uid";
|
|
@@ -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,44 +86,65 @@ 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
|
const ModifiersProps = {
|
|
115
131
|
/**
|
|
116
132
|
* Component BEM modifiers
|
|
117
133
|
*/
|
|
118
|
-
modifiers:
|
|
134
|
+
modifiers: {
|
|
135
|
+
type: [String, Array],
|
|
136
|
+
default: void 0
|
|
137
|
+
}
|
|
119
138
|
};
|
|
120
139
|
const IconProps = {
|
|
121
140
|
/**
|
|
122
141
|
* VvIcon name or props
|
|
123
142
|
* @see VVIcon
|
|
124
143
|
*/
|
|
125
|
-
icon: {
|
|
144
|
+
icon: {
|
|
145
|
+
type: [String, Object],
|
|
146
|
+
default: void 0
|
|
147
|
+
},
|
|
126
148
|
/**
|
|
127
149
|
* VvIcon position
|
|
128
150
|
*/
|
|
@@ -160,7 +182,8 @@ const IdProps = {
|
|
|
160
182
|
* Dropdown show / hide transition name
|
|
161
183
|
*/
|
|
162
184
|
transitionName: {
|
|
163
|
-
type: String
|
|
185
|
+
type: String,
|
|
186
|
+
default: void 0
|
|
164
187
|
},
|
|
165
188
|
/**
|
|
166
189
|
* Offset of the dropdown from the trigger
|
|
@@ -228,7 +251,8 @@ const IdProps = {
|
|
|
228
251
|
* Set dropdown width to the same as the trigger
|
|
229
252
|
*/
|
|
230
253
|
triggerWidth: {
|
|
231
|
-
type: Boolean
|
|
254
|
+
type: Boolean,
|
|
255
|
+
default: false
|
|
232
256
|
}
|
|
233
257
|
});
|
|
234
258
|
({
|
|
@@ -396,99 +420,9 @@ const useVvAlertGroup = (props, emit) => {
|
|
|
396
420
|
}))
|
|
397
421
|
};
|
|
398
422
|
};
|
|
399
|
-
const
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
*/
|
|
403
|
-
color: String,
|
|
404
|
-
/**
|
|
405
|
-
* Width
|
|
406
|
-
*/
|
|
407
|
-
width: {
|
|
408
|
-
type: [String, Number]
|
|
409
|
-
},
|
|
410
|
-
/**
|
|
411
|
-
* Height
|
|
412
|
-
*/
|
|
413
|
-
height: {
|
|
414
|
-
type: [String, Number]
|
|
415
|
-
},
|
|
416
|
-
/**
|
|
417
|
-
* Icon name
|
|
418
|
-
* Can be the full composition of iconify name "@{provider}:{prefix}:{name}" or "{prefix}:{name}" or "{name}"
|
|
419
|
-
* https://docs.iconify.design/api/providers.html#provider-in-icon-name
|
|
420
|
-
*/
|
|
421
|
-
name: {
|
|
422
|
-
type: String,
|
|
423
|
-
required: true
|
|
424
|
-
},
|
|
425
|
-
/**
|
|
426
|
-
* By default 'vv'
|
|
427
|
-
* If custom collection is not added with "addCollection" DS class method, this prop could not be used
|
|
428
|
-
* Icon provider: https://docs.iconify.design/api/providers.html#provider-in-icon-name
|
|
429
|
-
*/
|
|
430
|
-
provider: {
|
|
431
|
-
type: String
|
|
432
|
-
},
|
|
433
|
-
/**
|
|
434
|
-
* The name of icon set.
|
|
435
|
-
* Icon default options prefix: simple | normal | detailed
|
|
436
|
-
*/
|
|
437
|
-
prefix: {
|
|
438
|
-
type: String,
|
|
439
|
-
default: "normal"
|
|
440
|
-
},
|
|
441
|
-
/**
|
|
442
|
-
* Url remote SVG icon
|
|
443
|
-
*/
|
|
444
|
-
src: String,
|
|
445
|
-
/**
|
|
446
|
-
* Horizontal flip
|
|
447
|
-
*/
|
|
448
|
-
horizontalFlip: Boolean,
|
|
449
|
-
/**
|
|
450
|
-
* Vertical flip
|
|
451
|
-
*/
|
|
452
|
-
verticalFlip: Boolean,
|
|
453
|
-
/**
|
|
454
|
-
* String alternative to "horizontalFlip" and "verticalFlip".
|
|
455
|
-
* Example: https://docs.iconify.design/icon-components/vue/transform.html
|
|
456
|
-
*/
|
|
457
|
-
flip: String,
|
|
458
|
-
/**
|
|
459
|
-
* Icon render mode
|
|
460
|
-
* 'style' = 'bg' or 'mask', depending on icon content
|
|
461
|
-
* 'bg' = span with style using `background`
|
|
462
|
-
* 'mask' = span with style using `mask`
|
|
463
|
-
* 'svg' = svg
|
|
464
|
-
* Iconify doc: https://docs.iconify.design/iconify-icon/modes.html
|
|
465
|
-
*/
|
|
466
|
-
mode: String,
|
|
467
|
-
/**
|
|
468
|
-
* Toggles inline or block mode
|
|
469
|
-
* Example https://docs.iconify.design/icon-components/vue/inline.html
|
|
470
|
-
*/
|
|
471
|
-
inline: Boolean,
|
|
472
|
-
/**
|
|
473
|
-
* rotates icon
|
|
474
|
-
* Example https://docs.iconify.design/icon-components/vue/transform.html
|
|
475
|
-
*/
|
|
476
|
-
rotate: [Number, String],
|
|
477
|
-
/**
|
|
478
|
-
* A callback that is called when icon data has been loaded
|
|
479
|
-
*/
|
|
480
|
-
onLoad: Function,
|
|
481
|
-
/**
|
|
482
|
-
* SVG icon string
|
|
483
|
-
*/
|
|
484
|
-
svg: String,
|
|
485
|
-
/**
|
|
486
|
-
* Icon modifiers: vv-icon css helper classes, value/s are concatened with prefix 'vv-icon--'
|
|
487
|
-
* @values string | string[]
|
|
488
|
-
*/
|
|
489
|
-
modifiers: {
|
|
490
|
-
type: [String, Array]
|
|
491
|
-
}
|
|
423
|
+
const VvIconPropsDefaults = {
|
|
424
|
+
prefix: "normal"
|
|
425
|
+
/* normal */
|
|
492
426
|
};
|
|
493
427
|
function useVolver() {
|
|
494
428
|
return inject(INJECTION_KEY_VOLVER);
|
|
@@ -498,7 +432,24 @@ const __default__$2 = {
|
|
|
498
432
|
};
|
|
499
433
|
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
500
434
|
...__default__$2,
|
|
501
|
-
props:
|
|
435
|
+
props: mergeDefaults({
|
|
436
|
+
name: {},
|
|
437
|
+
color: {},
|
|
438
|
+
width: {},
|
|
439
|
+
height: {},
|
|
440
|
+
provider: {},
|
|
441
|
+
prefix: {},
|
|
442
|
+
src: {},
|
|
443
|
+
horizontalFlip: { type: Boolean },
|
|
444
|
+
verticalFlip: { type: Boolean },
|
|
445
|
+
flip: {},
|
|
446
|
+
mode: {},
|
|
447
|
+
inline: { type: Boolean },
|
|
448
|
+
rotate: {},
|
|
449
|
+
onLoad: { type: Function },
|
|
450
|
+
svg: {},
|
|
451
|
+
modifiers: {}
|
|
452
|
+
}, VvIconPropsDefaults),
|
|
502
453
|
setup(__props) {
|
|
503
454
|
const props = __props;
|
|
504
455
|
const hasRotate = computed(() => {
|
|
@@ -593,6 +544,41 @@ function useInjectedAlertGroup() {
|
|
|
593
544
|
return inject(INJECTION_KEY_ALERT_GROUP, {});
|
|
594
545
|
}
|
|
595
546
|
const useUniqueId = (id) => computed(() => String((id == null ? void 0 : id.value) || uid()));
|
|
547
|
+
function useComponentIcon(icon, iconPosition) {
|
|
548
|
+
const hasIcon = computed(() => {
|
|
549
|
+
if (typeof (icon == null ? void 0 : icon.value) === "string") {
|
|
550
|
+
return { name: icon == null ? void 0 : icon.value };
|
|
551
|
+
}
|
|
552
|
+
return icon == null ? void 0 : icon.value;
|
|
553
|
+
});
|
|
554
|
+
const hasIconBefore = computed(
|
|
555
|
+
() => (iconPosition == null ? void 0 : iconPosition.value) === Position.before ? hasIcon.value : void 0
|
|
556
|
+
);
|
|
557
|
+
const hasIconAfter = computed(
|
|
558
|
+
() => (iconPosition == null ? void 0 : iconPosition.value) === Position.after ? hasIcon.value : void 0
|
|
559
|
+
);
|
|
560
|
+
const hasIconLeft = computed(
|
|
561
|
+
() => (iconPosition == null ? void 0 : iconPosition.value) === Side.left ? hasIcon.value : void 0
|
|
562
|
+
);
|
|
563
|
+
const hasIconRight = computed(
|
|
564
|
+
() => (iconPosition == null ? void 0 : iconPosition.value) === Side.right ? hasIcon.value : void 0
|
|
565
|
+
);
|
|
566
|
+
const hasIconTop = computed(
|
|
567
|
+
() => (iconPosition == null ? void 0 : iconPosition.value) === Side.top ? hasIcon.value : void 0
|
|
568
|
+
);
|
|
569
|
+
const hasIconBottom = computed(
|
|
570
|
+
() => (iconPosition == null ? void 0 : iconPosition.value) === Side.bottom ? hasIcon.value : void 0
|
|
571
|
+
);
|
|
572
|
+
return {
|
|
573
|
+
hasIcon,
|
|
574
|
+
hasIconLeft,
|
|
575
|
+
hasIconRight,
|
|
576
|
+
hasIconTop,
|
|
577
|
+
hasIconBottom,
|
|
578
|
+
hasIconBefore,
|
|
579
|
+
hasIconAfter
|
|
580
|
+
};
|
|
581
|
+
}
|
|
596
582
|
const VvAlertProps = {
|
|
597
583
|
...IdProps,
|
|
598
584
|
...ModifiersProps,
|
|
@@ -669,9 +655,7 @@ const useVvAlert = (props, emit) => {
|
|
|
669
655
|
const { bus } = useInjectedAlertGroup();
|
|
670
656
|
const hasId = useUniqueId(computed(() => props.id));
|
|
671
657
|
const hasTitleId = computed(() => `${hasId.value}-title`);
|
|
672
|
-
const hasIcon = computed(
|
|
673
|
-
() => typeof props.icon === "string" ? { name: props.icon } : props.icon
|
|
674
|
-
);
|
|
658
|
+
const { hasIcon } = useComponentIcon(computed(() => props.icon));
|
|
675
659
|
const hasClass = useModifiers(
|
|
676
660
|
"vv-alert",
|
|
677
661
|
computed(() => props.modifiers),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue"),require("mitt"),require("@iconify/vue"),require("uid")):"function"==typeof define&&define.amd?define(["vue","mitt","@iconify/vue","uid"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VvAlertGroup=t(e.vue,e.mitt,e.vue$1,e.uid)}(this,(function(e,t,o,
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue"),require("mitt"),require("@iconify/vue"),require("uid")):"function"==typeof define&&define.amd?define(["vue","mitt","@iconify/vue","uid"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VvAlertGroup=t(e.vue,e.mitt,e.vue$1,e.uid)}(this,(function(e,t,o,l){"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||{}),i=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(i||{}),a=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(a||{});const s=Symbol.for("volver"),u=Symbol.for("alertGroup"),c=(Boolean,Boolean,Boolean,Boolean,{modifiers:{type:[String,Array],default:void 0}}),d={icon:{type:[String,Object],default:void 0},iconPosition:{type:String,default:n.before,validation:e=>Object.values(n).includes(e)}},v={id:[String,Number]};function f(t,o,l){return e.computed((()=>{const r={[t]:!0},n="string"==typeof(null==o?void 0:o.value)?o.value.split(" "):null==o?void 0:o.value;return n&&Array.isArray(n)&&n.forEach((e=>{e&&(r[`${t}--${e}`]=!0)})),l&&Object.keys(l.value).forEach((o=>{r[`${t}--${o}`]=e.unref(l.value[o])})),r}))}r.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,i.button,a.button;const p={...c,name:{type:String,required:!0},items:{type:Array,default:()=>[]},stack:{type:Boolean,default:!1},reverse:{type:Boolean,default:!1},inline:{type:String,default:void 0},block:{type:String,default:void 0},position:{type:String,default:void 0},transition:{type:String,default:void 0}},m=(o,l)=>{const r=function({name:o}){const l=t();return e.provide(u,{name:o,bus:l}),l}({name:e.computed((()=>o.name))});(o.block&&!o.inline||!o.block&&o.inline)&&console.warn("[VvAlertGroup]: block and inline props must coexist at the same time.");const n=e.computed((()=>{const t=[f("vv-alert-group",e.computed((()=>o.modifiers)),e.computed((()=>({stack:o.stack,reverse:o.reverse,absolute:"absolute"===o.position,fixed:"fixed"===o.position})))).value];return o.inline&&o.block&&t.push(`vv-alert-group--${o.block}-${o.inline}`),t})),i=e.computed((()=>o.transition?o.transition:o.position?"start"===o.inline?"vv-alert--fade-inline-start":"end"===o.inline?"vv-alert--fade-inline-end":"top"===o.block?"vv-alert--fade-block-top":"bottom"===o.block?"vv-alert--fade-block-bottom":"vv-alert--fade":"vv-alert--fade"));return r.on("close",(e=>{l("close",e)})),{hasTransition:i,hasProps:e.computed((()=>({class:n.value})))}};const b=e.defineComponent({name:"VvIcon",props:e.mergeDefaults({name:{},color:{},width:{},height:{},provider:{},prefix:{},src:{},horizontalFlip:{type:Boolean},verticalFlip:{type:Boolean},flip:{},mode:{},inline:{type:Boolean},rotate:{},onLoad:{type:Function},svg:{},modifiers:{}},{prefix:"normal"}),setup(t){const l=t,r=e.computed((()=>"string"==typeof l.rotate?parseFloat(l.rotate):l.rotate)),n=e.ref(!0),i=e.inject(s),{modifiers:a}=e.toRefs(l),u=f("vv-icon",a),c=e.computed((()=>l.provider||(null==i?void 0:i.iconsProvider))),d=e.computed((()=>{const e=l.name??"",t=`@${c.value}:${l.prefix}:${e}`;if(o.iconExists(t))return t;const r=null==i?void 0:i.iconsCollections.find((t=>{const l=`@${c.value}:${t.prefix}:${e}`;return o.iconExists(l)}));return r?`@${c.value}:${r.prefix}:${e}`:e}));function v(e){const t=function(e){let t;if("undefined"==typeof window){const{JSDOM:e}=require("jsdom");t=(new e).window}return(t?new t.DOMParser:new window.DOMParser).parseFromString(e,"text/html").querySelector("svg")}(e),r=(null==t?void 0:t.innerHTML.trim())||"";t&&r&&o.addIcon(`@${c.value}:${l.prefix}:${l.name}`,{body:r,height:t.viewBox.baseVal.height,width:t.viewBox.baseVal.width})}return i&&l.src&&!o.iconExists(`@${c.value}:${l.prefix}:${l.name}`)&&(n.value=!1,i.fetchIcon(l.src).then((e=>{e&&(v(e),n.value=!0)})).catch((e=>{throw new Error(`Error during fetch icon: ${null==e?void 0:e.message}`)}))),l.svg&&v(l.svg),(t,l)=>e.unref(n)?(e.openBlock(),e.createBlock(e.unref(o.Icon),e.mergeProps({key:0,class:e.unref(u)},{inline:t.inline,width:t.width,height:t.height,horizontalFlip:t.horizontalFlip,verticalFlip:t.verticalFlip,flip:t.flip,rotate:e.unref(r),color:t.color,onLoad:t.onLoad,icon:e.unref(d)}),null,16,["class"])):e.createCommentVNode("v-if",!0)}});const h={...v,...c,...d,dismissable:{type:Boolean,default:!1},autoClose:{type:Number,default:0},closeLabel:{type:String,default:"Close"},title:{type:String,default:void 0},content:{type:String,default:void 0},footer:{type:String,default:void 0},role:{type:String,default:"alert"}},y=(t,o)=>{const{bus:i}=e.inject(u,{}),a=(s=e.computed((()=>t.id)),e.computed((()=>String((null==s?void 0:s.value)||l.uid()))));var s;const c=e.computed((()=>`${a.value}-title`)),{hasIcon:d}=function(t,o){const l=e.computed((()=>"string"==typeof(null==t?void 0:t.value)?{name:null==t?void 0:t.value}:null==t?void 0:t.value)),i=e.computed((()=>(null==o?void 0:o.value)===n.before?l.value:void 0)),a=e.computed((()=>(null==o?void 0:o.value)===n.after?l.value:void 0)),s=e.computed((()=>(null==o?void 0:o.value)===r.left?l.value:void 0)),u=e.computed((()=>(null==o?void 0:o.value)===r.right?l.value:void 0)),c=e.computed((()=>(null==o?void 0:o.value)===r.top?l.value:void 0)),d=e.computed((()=>(null==o?void 0:o.value)===r.bottom?l.value:void 0));return{hasIcon:l,hasIconLeft:s,hasIconRight:u,hasIconTop:c,hasIconBottom:d,hasIconBefore:i,hasIconAfter:a}}(e.computed((()=>t.icon))),v=f("vv-alert",e.computed((()=>t.modifiers)),e.computed((()=>({dismissable:t.autoClose>0||t.dismissable,"auto-close":t.autoClose>0,hover:h.value})))),p=e.computed((()=>({"--alert-duration":`${t.autoClose}ms`}))),m=()=>{b&&clearTimeout(b),o("close",a.value),null==i||i.emit("close",a.value)};let b;e.watch((()=>t.autoClose),(e=>{e>0?b=setTimeout(m,e):b&&clearTimeout(b)}),{immediate:!0});const h=e.ref(!1),y=e.withModifiers((()=>{h.value=!0,b&&clearTimeout(b)}),["passive"]),g=e.withModifiers((()=>{h.value=!1,t.autoClose>0&&(b=setTimeout(m,t.autoClose))}),["passive"]);return{close:m,hasIcon:d,hasTitleId:c,hasProps:e.computed((()=>({onMouseover:y,onMouseleave:g,class:v.value,style:p.value,role:t.role,"aria-labelledby":c.value})))}},g={key:0,class:"vv-alert__header"},k=["id"],B=["aria-label"],$=[e.createElementVNode("div",{class:"vv-alert__close-mask"},null,-1)],S={key:1,class:"vv-alert__content"},x={key:2,class:"vv-alert__footer"},w=e.defineComponent({name:"VvAlert",props:h,emits:["close"],setup(t,{expose:o,emit:l}){const r=t,{hasProps:n,hasTitleId:i,hasIcon:a,close:s}=y(r,l);return o({close:s}),(t,o)=>(e.openBlock(),e.createElementBlock("div",e.normalizeProps(e.guardReactiveProps(e.unref(n))),[t.$slots.header||t.$slots.title||t.$slots.close||t.$slots["title::before"]||t.$slots["title::after"]||t.title||t.dismissable||t.autoClose?(e.openBlock(),e.createElementBlock("div",g,[e.unref(a)?(e.openBlock(),e.createBlock(b,e.mergeProps({key:0},e.unref(a),{class:"vv-alert__icon"}),null,16)):e.createCommentVNode("v-if",!0),e.renderSlot(t.$slots,"header",{},(()=>[e.renderSlot(t.$slots,"title::before"),t.$slots.title||t.title?(e.openBlock(),e.createElementBlock("strong",{key:0,id:e.unref(i),class:"vv-alert__title"},[e.renderSlot(t.$slots,"title",{},(()=>[e.createTextVNode(e.toDisplayString(t.title),1)]))],8,k)):e.createCommentVNode("v-if",!0),e.renderSlot(t.$slots,"title::after")])),e.renderSlot(t.$slots,"close",e.normalizeProps(e.guardReactiveProps({close:e.unref(s)})),(()=>[t.dismissable||t.autoClose?(e.openBlock(),e.createElementBlock("button",{key:0,class:"vv-alert__close",type:"button","aria-label":t.closeLabel,onClick:o[0]||(o[0]=e.withModifiers(((...t)=>e.unref(s)&&e.unref(s)(...t)),["stop"]))},$,8,B)):e.createCommentVNode("v-if",!0)]))])):e.createCommentVNode("v-if",!0),t.$slots.default||t.content?(e.openBlock(),e.createElementBlock("div",S,[e.renderSlot(t.$slots,"default",{},(()=>[e.createTextVNode(e.toDisplayString(t.content),1)]))])):e.createCommentVNode("v-if",!0),t.$slots.footer||t.footer?(e.openBlock(),e.createElementBlock("div",x,[e.renderSlot(t.$slots,"footer",{},(()=>[e.createTextVNode(e.toDisplayString(t.footer),1)]))])):e.createCommentVNode("v-if",!0)],16))}});return e.defineComponent({name:"VvAlertGroup",props:p,emits:["close","before-enter","after-leave","enter","after-enter","enter-cancelled","before-leave","leave","leave-cancelled"],setup(t,{emit:o}){const l=t,{hasProps:r,hasTransition:n}=m(l,o),i={"before-enter":()=>{o("before-enter")},"after-leave":()=>{o("after-leave")},enter:()=>{o("enter")},"after-enter":()=>{o("after-enter")},"enter-cancelled":()=>{o("enter-cancelled")},"before-leave":()=>{o("before-leave")},leave:()=>{o("leave")},"leave-cancelled":()=>{o("leave-cancelled")}};return(t,o)=>(e.openBlock(),e.createElementBlock("div",e.normalizeProps(e.guardReactiveProps(e.unref(r))),[e.renderSlot(t.$slots,"before"),e.createVNode(e.TransitionGroup,e.mergeProps({tag:"div",role:"group",name:e.unref(n),class:"vv-alert-group__list"},e.toHandlers(i)),{default:e.withCtx((()=>[e.renderSlot(t.$slots,"default",{},(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,(t=>(e.openBlock(),e.createBlock(w,e.mergeProps(t,{key:t.id}),null,16)))),128))]))])),_:3},16,["name"]),e.renderSlot(t.$slots,"after")],16))}})}));
|
|
@@ -31,7 +31,10 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
31
31
|
type: StringConstructor;
|
|
32
32
|
default: undefined;
|
|
33
33
|
};
|
|
34
|
-
modifiers:
|
|
34
|
+
modifiers: {
|
|
35
|
+
type: globalThis.PropType<string | string[]>;
|
|
36
|
+
default: undefined;
|
|
37
|
+
};
|
|
35
38
|
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
36
39
|
[x: string]: (...args: any[]) => void;
|
|
37
40
|
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
@@ -67,8 +70,12 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
67
70
|
type: StringConstructor;
|
|
68
71
|
default: undefined;
|
|
69
72
|
};
|
|
70
|
-
modifiers:
|
|
73
|
+
modifiers: {
|
|
74
|
+
type: globalThis.PropType<string | string[]>;
|
|
75
|
+
default: undefined;
|
|
76
|
+
};
|
|
71
77
|
}>>, {
|
|
78
|
+
modifiers: string | string[];
|
|
72
79
|
reverse: boolean;
|
|
73
80
|
items: import(".").AlertItem[];
|
|
74
81
|
transition: string;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { ExtractPropTypes } from 'vue';
|
|
2
|
+
import type { VvIconProps } from '../VvIcon';
|
|
2
3
|
export type AlertItem = {
|
|
3
4
|
id: string | number;
|
|
4
5
|
title?: string;
|
|
5
|
-
icon?: string |
|
|
6
|
+
icon?: string | VvIconProps;
|
|
6
7
|
content?: string;
|
|
7
8
|
footer?: string;
|
|
8
9
|
modifiers?: string | string[];
|
|
@@ -44,7 +45,10 @@ export declare const VvAlertGroupProps: {
|
|
|
44
45
|
type: StringConstructor;
|
|
45
46
|
default: undefined;
|
|
46
47
|
};
|
|
47
|
-
modifiers:
|
|
48
|
+
modifiers: {
|
|
49
|
+
type: globalThis.PropType<string | string[]>;
|
|
50
|
+
default: undefined;
|
|
51
|
+
};
|
|
48
52
|
};
|
|
49
53
|
export declare const VvAlertGroupEvents: string[];
|
|
50
54
|
export declare const useVvAlertGroup: (props: Readonly<ExtractPropTypes<typeof VvAlertGroupProps>>, emit: (event: string, ...args: unknown[]) => void) => {
|
|
@@ -64,6 +64,7 @@ const LinkProps = {
|
|
|
64
64
|
*/
|
|
65
65
|
target: {
|
|
66
66
|
type: String,
|
|
67
|
+
default: void 0,
|
|
67
68
|
validator: (value) => Object.values(AnchorTarget).includes(value)
|
|
68
69
|
},
|
|
69
70
|
/**
|
|
@@ -78,44 +79,65 @@ const DisabledProps = {
|
|
|
78
79
|
/**
|
|
79
80
|
* Whether the form control is disabled
|
|
80
81
|
*/
|
|
81
|
-
disabled:
|
|
82
|
+
disabled: {
|
|
83
|
+
type: Boolean,
|
|
84
|
+
default: false
|
|
85
|
+
}
|
|
82
86
|
};
|
|
83
87
|
const ActiveProps = {
|
|
84
88
|
/**
|
|
85
89
|
* Whether the item is active
|
|
86
90
|
*/
|
|
87
|
-
active:
|
|
91
|
+
active: {
|
|
92
|
+
type: Boolean,
|
|
93
|
+
default: false
|
|
94
|
+
}
|
|
88
95
|
};
|
|
89
96
|
const CurrentProps = {
|
|
90
97
|
/**
|
|
91
98
|
* Whether the item is current
|
|
92
99
|
*/
|
|
93
|
-
current:
|
|
100
|
+
current: {
|
|
101
|
+
type: Boolean,
|
|
102
|
+
default: false
|
|
103
|
+
}
|
|
94
104
|
};
|
|
95
105
|
const PressedProps = {
|
|
96
106
|
/**
|
|
97
107
|
* Whether the item is pressed
|
|
98
108
|
*/
|
|
99
|
-
pressed:
|
|
109
|
+
pressed: {
|
|
110
|
+
type: Boolean,
|
|
111
|
+
default: false
|
|
112
|
+
}
|
|
100
113
|
};
|
|
101
114
|
const LabelProps = {
|
|
102
115
|
/**
|
|
103
116
|
* The item label
|
|
104
117
|
*/
|
|
105
|
-
label:
|
|
118
|
+
label: {
|
|
119
|
+
type: [String, Number],
|
|
120
|
+
default: void 0
|
|
121
|
+
}
|
|
106
122
|
};
|
|
107
123
|
const ModifiersProps = {
|
|
108
124
|
/**
|
|
109
125
|
* Component BEM modifiers
|
|
110
126
|
*/
|
|
111
|
-
modifiers:
|
|
127
|
+
modifiers: {
|
|
128
|
+
type: [String, Array],
|
|
129
|
+
default: void 0
|
|
130
|
+
}
|
|
112
131
|
};
|
|
113
132
|
({
|
|
114
133
|
/**
|
|
115
134
|
* VvIcon name or props
|
|
116
135
|
* @see VVIcon
|
|
117
136
|
*/
|
|
118
|
-
icon: {
|
|
137
|
+
icon: {
|
|
138
|
+
type: [String, Object],
|
|
139
|
+
default: void 0
|
|
140
|
+
},
|
|
119
141
|
/**
|
|
120
142
|
* VvIcon position
|
|
121
143
|
*/
|
|
@@ -146,7 +168,8 @@ const ModifiersProps = {
|
|
|
146
168
|
* Dropdown show / hide transition name
|
|
147
169
|
*/
|
|
148
170
|
transitionName: {
|
|
149
|
-
type: String
|
|
171
|
+
type: String,
|
|
172
|
+
default: void 0
|
|
150
173
|
},
|
|
151
174
|
/**
|
|
152
175
|
* Offset of the dropdown from the trigger
|
|
@@ -214,7 +237,8 @@ const ModifiersProps = {
|
|
|
214
237
|
* Set dropdown width to the same as the trigger
|
|
215
238
|
*/
|
|
216
239
|
triggerWidth: {
|
|
217
|
-
type: Boolean
|
|
240
|
+
type: Boolean,
|
|
241
|
+
default: false
|
|
218
242
|
}
|
|
219
243
|
});
|
|
220
244
|
({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?module.exports=o(require("vue")):"function"==typeof define&&define.amd?define(["vue"],o):(e="undefined"!=typeof globalThis?globalThis:e||self).VvAvatar=o(e.vue)}(this,(function(e){"use strict";var o=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(o||{}),t=(e=>(e.before="before",e.after="after",e))(t||{}),n=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(n||{}),r=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(r||{});Boolean,Boolean,Boolean,Boolean;const a={modifiers:[String,Array]};t.before,o.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,n.button,r.button;const l={...a,imgSrc:String};const i=["role","aria-label"],u=["src"];return e.defineComponent({__name:"VvAvatar",props:l,setup(o){const t=o,{modifiers:n}=e.toRefs(t),r=function(o,t,n){return e.computed((()=>{const r={[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&&(r[`${o}--${e}`]=!0)})),n&&Object.keys(n.value).forEach((t=>{r[`${o}--${t}`]=e.unref(n.value[t])})),r}))}("vv-avatar",n);return(o,t)=>(e.openBlock(),e.createElementBlock("span",{class:e.normalizeClass(e.unref(r)),role:o.imgSrc?void 0:"img","aria-label":o.imgSrc?void 0:"avatar"},[e.renderSlot(o.$slots,"default",{},(()=>[o.imgSrc?(e.openBlock(),e.createElementBlock("img",{key:0,src:o.imgSrc,alt:"avatar"},null,8,u)):e.createCommentVNode("v-if",!0)]))],10,i))}})}));
|
|
1
|
+
!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?module.exports=o(require("vue")):"function"==typeof define&&define.amd?define(["vue"],o):(e="undefined"!=typeof globalThis?globalThis:e||self).VvAvatar=o(e.vue)}(this,(function(e){"use strict";var o=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(o||{}),t=(e=>(e.before="before",e.after="after",e))(t||{}),n=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(n||{}),r=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(r||{});Boolean,Boolean,Boolean,Boolean;const a={modifiers:{type:[String,Array],default:void 0}};t.before,o.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,n.button,r.button;const l={...a,imgSrc:String};const i=["role","aria-label"],u=["src"];return e.defineComponent({__name:"VvAvatar",props:l,setup(o){const t=o,{modifiers:n}=e.toRefs(t),r=function(o,t,n){return e.computed((()=>{const r={[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&&(r[`${o}--${e}`]=!0)})),n&&Object.keys(n.value).forEach((t=>{r[`${o}--${t}`]=e.unref(n.value[t])})),r}))}("vv-avatar",n);return(o,t)=>(e.openBlock(),e.createElementBlock("span",{class:e.normalizeClass(e.unref(r)),role:o.imgSrc?void 0:"img","aria-label":o.imgSrc?void 0:"avatar"},[e.renderSlot(o.$slots,"default",{},(()=>[o.imgSrc?(e.openBlock(),e.createElementBlock("img",{key:0,src:o.imgSrc,alt:"avatar"},null,8,u)):e.createCommentVNode("v-if",!0)]))],10,i))}})}));
|
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
2
2
|
imgSrc: StringConstructor;
|
|
3
|
-
modifiers:
|
|
3
|
+
modifiers: {
|
|
4
|
+
type: globalThis.PropType<string | string[]>;
|
|
5
|
+
default: undefined;
|
|
6
|
+
};
|
|
4
7
|
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
5
8
|
imgSrc: StringConstructor;
|
|
6
|
-
modifiers:
|
|
7
|
-
|
|
9
|
+
modifiers: {
|
|
10
|
+
type: globalThis.PropType<string | string[]>;
|
|
11
|
+
default: undefined;
|
|
12
|
+
};
|
|
13
|
+
}>>, {
|
|
14
|
+
modifiers: string | string[];
|
|
15
|
+
}, {}>, {
|
|
8
16
|
default?(_: {}): any;
|
|
9
17
|
}>;
|
|
10
18
|
export default _default;
|
|
@@ -65,6 +65,7 @@ const LinkProps = {
|
|
|
65
65
|
*/
|
|
66
66
|
target: {
|
|
67
67
|
type: String,
|
|
68
|
+
default: void 0,
|
|
68
69
|
validator: (value) => Object.values(AnchorTarget).includes(value)
|
|
69
70
|
},
|
|
70
71
|
/**
|
|
@@ -79,44 +80,65 @@ const DisabledProps = {
|
|
|
79
80
|
/**
|
|
80
81
|
* Whether the form control is disabled
|
|
81
82
|
*/
|
|
82
|
-
disabled:
|
|
83
|
+
disabled: {
|
|
84
|
+
type: Boolean,
|
|
85
|
+
default: false
|
|
86
|
+
}
|
|
83
87
|
};
|
|
84
88
|
const ActiveProps = {
|
|
85
89
|
/**
|
|
86
90
|
* Whether the item is active
|
|
87
91
|
*/
|
|
88
|
-
active:
|
|
92
|
+
active: {
|
|
93
|
+
type: Boolean,
|
|
94
|
+
default: false
|
|
95
|
+
}
|
|
89
96
|
};
|
|
90
97
|
const CurrentProps = {
|
|
91
98
|
/**
|
|
92
99
|
* Whether the item is current
|
|
93
100
|
*/
|
|
94
|
-
current:
|
|
101
|
+
current: {
|
|
102
|
+
type: Boolean,
|
|
103
|
+
default: false
|
|
104
|
+
}
|
|
95
105
|
};
|
|
96
106
|
const PressedProps = {
|
|
97
107
|
/**
|
|
98
108
|
* Whether the item is pressed
|
|
99
109
|
*/
|
|
100
|
-
pressed:
|
|
110
|
+
pressed: {
|
|
111
|
+
type: Boolean,
|
|
112
|
+
default: false
|
|
113
|
+
}
|
|
101
114
|
};
|
|
102
115
|
const LabelProps = {
|
|
103
116
|
/**
|
|
104
117
|
* The item label
|
|
105
118
|
*/
|
|
106
|
-
label:
|
|
119
|
+
label: {
|
|
120
|
+
type: [String, Number],
|
|
121
|
+
default: void 0
|
|
122
|
+
}
|
|
107
123
|
};
|
|
108
124
|
const ModifiersProps = {
|
|
109
125
|
/**
|
|
110
126
|
* Component BEM modifiers
|
|
111
127
|
*/
|
|
112
|
-
modifiers:
|
|
128
|
+
modifiers: {
|
|
129
|
+
type: [String, Array],
|
|
130
|
+
default: void 0
|
|
131
|
+
}
|
|
113
132
|
};
|
|
114
133
|
({
|
|
115
134
|
/**
|
|
116
135
|
* VvIcon name or props
|
|
117
136
|
* @see VVIcon
|
|
118
137
|
*/
|
|
119
|
-
icon: {
|
|
138
|
+
icon: {
|
|
139
|
+
type: [String, Object],
|
|
140
|
+
default: void 0
|
|
141
|
+
},
|
|
120
142
|
/**
|
|
121
143
|
* VvIcon position
|
|
122
144
|
*/
|
|
@@ -147,7 +169,8 @@ const ModifiersProps = {
|
|
|
147
169
|
* Dropdown show / hide transition name
|
|
148
170
|
*/
|
|
149
171
|
transitionName: {
|
|
150
|
-
type: String
|
|
172
|
+
type: String,
|
|
173
|
+
default: void 0
|
|
151
174
|
},
|
|
152
175
|
/**
|
|
153
176
|
* Offset of the dropdown from the trigger
|
|
@@ -215,7 +238,8 @@ const ModifiersProps = {
|
|
|
215
238
|
* Set dropdown width to the same as the trigger
|
|
216
239
|
*/
|
|
217
240
|
triggerWidth: {
|
|
218
|
-
type: Boolean
|
|
241
|
+
type: Boolean,
|
|
242
|
+
default: false
|
|
219
243
|
}
|
|
220
244
|
});
|
|
221
245
|
({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?module.exports=o(require("vue"),require("uid")):"function"==typeof define&&define.amd?define(["vue","uid"],o):(e="undefined"!=typeof globalThis?globalThis:e||self).VvAvatarGroup=o(e.vue,e.uid)}(this,(function(e,o){"use strict";var t=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(t||{}),r=(e=>(e.before="before",e.after="after",e))(r||{}),a=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(a||{}),
|
|
1
|
+
!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?module.exports=o(require("vue"),require("uid")):"function"==typeof define&&define.amd?define(["vue","uid"],o):(e="undefined"!=typeof globalThis?globalThis:e||self).VvAvatarGroup=o(e.vue,e.uid)}(this,(function(e,o){"use strict";var t=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(t||{}),r=(e=>(e.before="before",e.after="after",e))(r||{}),a=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(a||{}),l=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(l||{});Boolean,Boolean,Boolean,Boolean;const n={modifiers:{type:[String,Array],default:void 0}};r.before,t.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,a.button,l.button;const i={...n,items:{type:Array,default:()=>[],required:!0},toShow:{type:Number,default:3},totalItems:{type:Number},avatarModifiers:[String,Array]},u={...n,imgSrc:String};function s(o,t,r){return e.computed((()=>{const a={[o]:!0},l="string"==typeof(null==t?void 0:t.value)?t.value.split(" "):null==t?void 0:t.value;return l&&Array.isArray(l)&&l.forEach((e=>{e&&(a[`${o}--${e}`]=!0)})),r&&Object.keys(r.value).forEach((t=>{a[`${o}--${t}`]=e.unref(r.value[t])})),a}))}const d=["role","aria-label"],f=["src"],m=e.defineComponent({__name:"VvAvatar",props:u,setup(o){const t=o,{modifiers:r}=e.toRefs(t),a=s("vv-avatar",r);return(o,t)=>(e.openBlock(),e.createElementBlock("span",{class:e.normalizeClass(e.unref(a)),role:o.imgSrc?void 0:"img","aria-label":o.imgSrc?void 0:"avatar"},[e.renderSlot(o.$slots,"default",{},(()=>[o.imgSrc?(e.openBlock(),e.createElementBlock("img",{key:0,src:o.imgSrc,alt:"avatar"},null,8,f)):e.createCommentVNode("v-if",!0)]))],10,d))}}),c={key:0};return e.defineComponent({__name:"VvAvatarGroup",props:i,setup(t){const r=t,{modifiers:a,items:l,toShow:n,totalItems:i,avatarModifiers:u}=e.toRefs(r),d=s("vv-avatar-group",a),f=e.computed((()=>(null==u?void 0:u.value)&&Array.isArray(null==u?void 0:u.value)?u.value.join(" "):(null==u?void 0:u.value)||"")),v=e.computed((()=>l.value.slice(0,n.value).map((t=>{let r=[],a=[];return(null==u?void 0:u.value)&&(r=Array.isArray(null==u?void 0:u.value)?null==u?void 0:u.value:[null==u?void 0:u.value]),t.modifiers&&(a=Array.isArray(t.modifiers)?t.modifiers:[t.modifiers]),{...t,key:t.key||e.computed((()=>String((null==l?void 0:l.value)||o.uid()))).value,modifiers:[...r,...a]};var l}))));return(o,t)=>(e.openBlock(),e.createElementBlock("span",{class:e.normalizeClass(e.unref(d))},[e.renderSlot(o.$slots,"default",{},(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(v),(o=>(e.openBlock(),e.createBlock(m,e.mergeProps({key:o.key},{modifiers:o.modifiers,imgSrc:o.imgSrc}),{default:e.withCtx((()=>[o.text?(e.openBlock(),e.createElementBlock("span",c,e.toDisplayString(o.text),1)):e.createCommentVNode("v-if",!0)])),_:2},1040)))),128)),(e.unref(i)||e.unref(l).length)>e.unref(n)?(e.openBlock(),e.createBlock(m,{key:0,modifiers:`${e.unref(f)} surface bordered`},{default:e.withCtx((()=>[e.createTextVNode(e.toDisplayString("+"+((e.unref(i)||e.unref(l).length)-e.unref(n))),1)])),_:1},8,["modifiers"])):e.createCommentVNode("v-if",!0)]))],2))}})}));
|