@volverjs/ui-vue 0.0.10-beta.2 → 0.0.10-beta.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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 +70 -14
- 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 +117 -38
- 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 +58 -13
- 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 +195 -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 +240 -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 +73 -17
- 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 +259 -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 +187 -141
- 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 +69 -16
- 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 +84 -25
- 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 +91 -22
- 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 +180 -67
- 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 +758 -531
- package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
- package/dist/components/VvCombobox/VvCombobox.vue.d.ts +181 -108
- package/dist/components/VvCombobox/index.d.ts +53 -22
- package/dist/components/VvDialog/VvDialog.es.js +136 -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 +101 -75
- 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 +82 -22
- 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 +33 -48
- package/dist/components/VvInputFile/VvInputFile.es.js +1734 -0
- package/dist/components/VvInputFile/VvInputFile.umd.js +1 -0
- package/dist/components/VvInputFile/VvInputFile.vue.d.ts +313 -0
- package/dist/components/VvInputFile/index.d.ts +179 -0
- package/dist/components/VvInputText/VvInputClearAction.d.ts +7 -5
- package/dist/components/VvInputText/VvInputPasswordAction.d.ts +10 -8
- package/dist/components/VvInputText/VvInputStepAction.d.ts +1 -1
- package/dist/components/VvInputText/VvInputText.es.js +331 -293
- package/dist/components/VvInputText/VvInputText.umd.js +1 -1
- package/dist/components/VvInputText/VvInputText.vue.d.ts +162 -55
- package/dist/components/VvInputText/index.d.ts +71 -29
- package/dist/components/VvNav/VvNav.es.js +151 -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.vue.d.ts +2 -0
- package/dist/components/VvNav/index.d.ts +5 -13
- package/dist/components/VvNavItem/VvNavItem.es.js +436 -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 +180 -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 +248 -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 +256 -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 +229 -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/common/HintSlot.d.ts +1 -1
- package/dist/components/index.d.ts +10 -0
- package/dist/components/index.es.js +2902 -1329
- 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 +210 -210
- 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 +12 -0
- package/dist/stories/InputFile/InputFileDropArea.stories.d.ts +9 -0
- package/dist/stories/InputFile/InputFileIconPosition.stories.d.ts +8 -0
- package/dist/stories/InputFile/InputFileSlots.stories.d.ts +7 -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 +16 -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 +97 -80
- 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 +35 -48
- package/src/components/VvInputFile/VvInputFile.vue +365 -0
- package/src/components/VvInputFile/index.ts +116 -0
- package/src/components/VvInputText/VvInputClearAction.ts +10 -6
- package/src/components/VvInputText/VvInputPasswordAction.ts +13 -9
- package/src/components/VvInputText/VvInputText.vue +17 -18
- package/src/components/VvInputText/index.ts +7 -15
- 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 +89 -0
- package/src/stories/InputFile/InputFileDropArea.stories.ts +56 -0
- package/src/stories/InputFile/InputFileIconPosition.stories.ts +43 -0
- package/src/stories/InputFile/InputFileSlots.stories.ts +33 -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 +18 -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/VvNav/VvNavSeparator.d.ts +0 -2
- 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
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue"),require("mitt"),require("@iconify/vue"),require("
|
|
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||{}),a=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(a||{}),i=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(i||{});const s=Symbol.for("volver"),c=Symbol.for("alertGroup"),u=(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,a.button,i.button;const m={...u,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}},p=(o,l)=>{const r=function({name:o}){const l=t();return e.provide(c,{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})),a=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:a,hasProps:e.computed((()=>({class:n.value})))}},b={prefix:"normal"};const h=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:{}},b),setup(t){const l=t,r=e.computed((()=>"string"==typeof l.rotate?parseFloat(l.rotate):l.rotate)),n=e.ref(!0),a=e.inject(s),{modifiers:i}=e.toRefs(l),c=f("vv-icon",i),u=e.computed((()=>l.provider||(null==a?void 0:a.iconsProvider))),d=e.computed((()=>{const e=l.name??"",t=`@${u.value}:${l.prefix}:${e}`;if(o.iconExists(t))return t;const r=null==a?void 0:a.iconsCollections.find((t=>{const l=`@${u.value}:${t.prefix}:${e}`;return o.iconExists(l)}));return r?`@${u.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(`@${u.value}:${l.prefix}:${l.name}`,{body:r,height:t.viewBox.baseVal.height,width:t.viewBox.baseVal.width})}return a&&l.src&&!o.iconExists(`@${u.value}:${l.prefix}:${l.name}`)&&(n.value=!1,a.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(c)},{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 y={...v,...u,...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"}},g=(t,o)=>{const{bus:a}=e.inject(c,{}),i=(s=e.computed((()=>t.id)),e.computed((()=>String((null==s?void 0:s.value)||l.uid()))));var s;const u=e.computed((()=>`${i.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)),a=e.computed((()=>(null==o?void 0:o.value)===n.before?l.value:void 0)),i=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)),c=e.computed((()=>(null==o?void 0:o.value)===r.right?l.value:void 0)),u=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:c,hasIconTop:u,hasIconBottom:d,hasIconBefore:a,hasIconAfter:i}}(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})))),m=e.computed((()=>({"--alert-duration":`${t.autoClose}ms`}))),p=()=>{b&&clearTimeout(b),o("close",i.value),null==a||a.emit("close",i.value)};let b;e.watch((()=>t.autoClose),(e=>{e>0?b=setTimeout(p,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(p,t.autoClose))}),["passive"]);return{close:p,hasIcon:d,hasTitleId:u,hasProps:e.computed((()=>({onMouseover:y,onMouseleave:g,class:v.value,style:m.value,role:t.role,"aria-labelledby":u.value})))}},k={key:0,class:"vv-alert__header"},B=["id"],$=["aria-label"],C=[e.createElementVNode("div",{class:"vv-alert__close-mask"},null,-1)],S={key:1,class:"vv-alert__content"},V={key:2,class:"vv-alert__footer"},x=e.defineComponent({name:"VvAlert",props:y,emits:["close"],setup(t,{expose:o,emit:l}){const r=t,n=l,{hasProps:a,hasTitleId:i,hasIcon:s,close:c}=g(r,n);return o({close:c}),(t,o)=>(e.openBlock(),e.createElementBlock("div",e.normalizeProps(e.guardReactiveProps(e.unref(a))),[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",k,[e.unref(s)?(e.openBlock(),e.createBlock(h,e.mergeProps({key:0},e.unref(s),{class:"vv-alert__icon"}),null,16)):e.createCommentVNode("v-if",!0),e.createCommentVNode(" @slot Header slot "),e.renderSlot(t.$slots,"header",{},(()=>[e.createCommentVNode(" @slot Before title slot "),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.createCommentVNode(" @slot Title slot "),e.renderSlot(t.$slots,"title",{},(()=>[e.createTextVNode(e.toDisplayString(t.title),1)]))],8,B)):e.createCommentVNode("v-if",!0),e.createCommentVNode(" @slot After title slot "),e.renderSlot(t.$slots,"title::after")])),e.createCommentVNode(" @slot Close button slot "),e.renderSlot(t.$slots,"close",e.normalizeProps(e.guardReactiveProps({close:e.unref(c)})),(()=>[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(c)&&e.unref(c)(...t)),["stop"]))},C,8,$)):e.createCommentVNode("v-if",!0)]))])):e.createCommentVNode("v-if",!0),t.$slots.default||t.content?(e.openBlock(),e.createElementBlock("div",S,[e.createCommentVNode(" @slot Content slot "),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",V,[e.createCommentVNode(" @slot Footer slot "),e.renderSlot(t.$slots,"footer",{},(()=>[e.createTextVNode(e.toDisplayString(t.footer),1)]))])):e.createCommentVNode("v-if",!0)],16))}});return e.defineComponent({name:"VvAlertGroup",props:m,emits:["close","before-enter","after-leave","enter","after-enter","enter-cancelled","before-leave","leave","leave-cancelled"],setup(t,{emit:o}){const l=t,r=o,{hasProps:n,hasTransition:a}=p(l,r),i={"before-enter":()=>{r("before-enter")},"after-leave":()=>{r("after-leave")},enter:()=>{r("enter")},"after-enter":()=>{r("after-enter")},"enter-cancelled":()=>{r("enter-cancelled")},"before-leave":()=>{r("before-leave")},leave:()=>{r("leave")},"leave-cancelled":()=>{r("leave-cancelled")}};return(t,o)=>(e.openBlock(),e.createElementBlock("div",e.normalizeProps(e.guardReactiveProps(e.unref(n))),[e.createCommentVNode(" @slot The slot before alert list "),e.renderSlot(t.$slots,"before"),e.createVNode(e.TransitionGroup,e.mergeProps({tag:"div",role:"group",name:e.unref(a),class:"vv-alert-group__list"},e.toHandlers(i)),{default:e.withCtx((()=>[e.createCommentVNode(" @slot The slot for alert list "),e.renderSlot(t.$slots,"default",{},(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,(t=>(e.openBlock(),e.createBlock(x,e.mergeProps(t,{key:t.id}),null,16)))),128))]))])),_:3},16,["name"]),e.createCommentVNode(" @slot The slot after alert list "),e.renderSlot(t.$slots,"after")],16))}})}));
|
|
@@ -31,8 +31,13 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
31
31
|
type: StringConstructor;
|
|
32
32
|
default: undefined;
|
|
33
33
|
};
|
|
34
|
-
modifiers:
|
|
35
|
-
|
|
34
|
+
modifiers: {
|
|
35
|
+
type: globalThis.PropType<string | string[]>;
|
|
36
|
+
default: undefined;
|
|
37
|
+
};
|
|
38
|
+
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
39
|
+
[x: string]: (...args: any[]) => void;
|
|
40
|
+
}, string, import("vue").PublicProps, Readonly<globalThis.ExtractPropTypes<{
|
|
36
41
|
name: {
|
|
37
42
|
type: StringConstructor;
|
|
38
43
|
required: boolean;
|
|
@@ -65,10 +70,12 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
65
70
|
type: StringConstructor;
|
|
66
71
|
default: undefined;
|
|
67
72
|
};
|
|
68
|
-
modifiers:
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}
|
|
73
|
+
modifiers: {
|
|
74
|
+
type: globalThis.PropType<string | string[]>;
|
|
75
|
+
default: undefined;
|
|
76
|
+
};
|
|
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) => {
|
|
@@ -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,38 +79,65 @@ 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
|
const ModifiersProps = {
|
|
95
124
|
/**
|
|
96
125
|
* Component BEM modifiers
|
|
97
126
|
*/
|
|
98
|
-
modifiers:
|
|
127
|
+
modifiers: {
|
|
128
|
+
type: [String, Array],
|
|
129
|
+
default: void 0
|
|
130
|
+
}
|
|
99
131
|
};
|
|
100
132
|
({
|
|
101
133
|
/**
|
|
102
134
|
* VvIcon name or props
|
|
103
135
|
* @see VVIcon
|
|
104
136
|
*/
|
|
105
|
-
icon: {
|
|
137
|
+
icon: {
|
|
138
|
+
type: [String, Object],
|
|
139
|
+
default: void 0
|
|
140
|
+
},
|
|
106
141
|
/**
|
|
107
142
|
* VvIcon position
|
|
108
143
|
*/
|
|
@@ -133,7 +168,8 @@ const ModifiersProps = {
|
|
|
133
168
|
* Dropdown show / hide transition name
|
|
134
169
|
*/
|
|
135
170
|
transitionName: {
|
|
136
|
-
type: String
|
|
171
|
+
type: String,
|
|
172
|
+
default: void 0
|
|
137
173
|
},
|
|
138
174
|
/**
|
|
139
175
|
* Offset of the dropdown from the trigger
|
|
@@ -201,7 +237,8 @@ const ModifiersProps = {
|
|
|
201
237
|
* Set dropdown width to the same as the trigger
|
|
202
238
|
*/
|
|
203
239
|
triggerWidth: {
|
|
204
|
-
type: Boolean
|
|
240
|
+
type: Boolean,
|
|
241
|
+
default: false
|
|
205
242
|
}
|
|
206
243
|
});
|
|
207
244
|
({
|
|
@@ -209,6 +246,7 @@ const ModifiersProps = {
|
|
|
209
246
|
...LabelProps,
|
|
210
247
|
...PressedProps,
|
|
211
248
|
...ActiveProps,
|
|
249
|
+
...CurrentProps,
|
|
212
250
|
...LinkProps,
|
|
213
251
|
/**
|
|
214
252
|
* Button type
|
|
@@ -224,6 +262,13 @@ const ModifiersProps = {
|
|
|
224
262
|
ariaLabel: {
|
|
225
263
|
type: String,
|
|
226
264
|
default: void 0
|
|
265
|
+
},
|
|
266
|
+
/**
|
|
267
|
+
* Default tag for the action
|
|
268
|
+
*/
|
|
269
|
+
defaultTag: {
|
|
270
|
+
type: String,
|
|
271
|
+
default: ActionTag.button
|
|
227
272
|
}
|
|
228
273
|
});
|
|
229
274
|
const VvAvatarProps = {
|
|
@@ -276,7 +321,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
276
321
|
key: 0,
|
|
277
322
|
src: _ctx.imgSrc,
|
|
278
323
|
alt: "avatar"
|
|
279
|
-
}, null, 8, _hoisted_2)) : createCommentVNode("", true)
|
|
324
|
+
}, null, 8, _hoisted_2)) : createCommentVNode("v-if", true)
|
|
280
325
|
])
|
|
281
326
|
], 10, _hoisted_1);
|
|
282
327
|
};
|
|
@@ -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||{}),
|
|
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:
|
|
4
|
-
|
|
3
|
+
modifiers: {
|
|
4
|
+
type: globalThis.PropType<string | string[]>;
|
|
5
|
+
default: undefined;
|
|
6
|
+
};
|
|
7
|
+
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<globalThis.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;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { computed, unref, defineComponent, toRefs, openBlock, createElementBlock, normalizeClass, renderSlot, createCommentVNode, Fragment, renderList, createBlock, mergeProps, withCtx, toDisplayString, createTextVNode } from "vue";
|
|
2
|
-
import {
|
|
2
|
+
import { uid } from "uid";
|
|
3
3
|
var Strategy = /* @__PURE__ */ ((Strategy2) => {
|
|
4
4
|
Strategy2["absolute"] = "absolute";
|
|
5
5
|
Strategy2["fixed"] = "fixed";
|
|
@@ -34,6 +34,13 @@ var ButtonType = /* @__PURE__ */ ((ButtonType2) => {
|
|
|
34
34
|
ButtonType2["reset"] = "reset";
|
|
35
35
|
return ButtonType2;
|
|
36
36
|
})(ButtonType || {});
|
|
37
|
+
var ActionTag = /* @__PURE__ */ ((ActionTag2) => {
|
|
38
|
+
ActionTag2["nuxtLink"] = "nuxt-link";
|
|
39
|
+
ActionTag2["routerLink"] = "router-link";
|
|
40
|
+
ActionTag2["a"] = "a";
|
|
41
|
+
ActionTag2["button"] = "button";
|
|
42
|
+
return ActionTag2;
|
|
43
|
+
})(ActionTag || {});
|
|
37
44
|
var AnchorTarget = /* @__PURE__ */ ((AnchorTarget2) => {
|
|
38
45
|
AnchorTarget2["_blank"] = "_blank";
|
|
39
46
|
AnchorTarget2["_self"] = "_self";
|
|
@@ -58,6 +65,7 @@ const LinkProps = {
|
|
|
58
65
|
*/
|
|
59
66
|
target: {
|
|
60
67
|
type: String,
|
|
68
|
+
default: void 0,
|
|
61
69
|
validator: (value) => Object.values(AnchorTarget).includes(value)
|
|
62
70
|
},
|
|
63
71
|
/**
|
|
@@ -72,38 +80,65 @@ const DisabledProps = {
|
|
|
72
80
|
/**
|
|
73
81
|
* Whether the form control is disabled
|
|
74
82
|
*/
|
|
75
|
-
disabled:
|
|
83
|
+
disabled: {
|
|
84
|
+
type: Boolean,
|
|
85
|
+
default: false
|
|
86
|
+
}
|
|
76
87
|
};
|
|
77
88
|
const ActiveProps = {
|
|
78
89
|
/**
|
|
79
90
|
* Whether the item is active
|
|
80
91
|
*/
|
|
81
|
-
active:
|
|
92
|
+
active: {
|
|
93
|
+
type: Boolean,
|
|
94
|
+
default: false
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
const CurrentProps = {
|
|
98
|
+
/**
|
|
99
|
+
* Whether the item is current
|
|
100
|
+
*/
|
|
101
|
+
current: {
|
|
102
|
+
type: Boolean,
|
|
103
|
+
default: false
|
|
104
|
+
}
|
|
82
105
|
};
|
|
83
106
|
const PressedProps = {
|
|
84
107
|
/**
|
|
85
108
|
* Whether the item is pressed
|
|
86
109
|
*/
|
|
87
|
-
pressed:
|
|
110
|
+
pressed: {
|
|
111
|
+
type: Boolean,
|
|
112
|
+
default: false
|
|
113
|
+
}
|
|
88
114
|
};
|
|
89
115
|
const LabelProps = {
|
|
90
116
|
/**
|
|
91
117
|
* The item label
|
|
92
118
|
*/
|
|
93
|
-
label:
|
|
119
|
+
label: {
|
|
120
|
+
type: [String, Number],
|
|
121
|
+
default: void 0
|
|
122
|
+
}
|
|
94
123
|
};
|
|
95
124
|
const ModifiersProps = {
|
|
96
125
|
/**
|
|
97
126
|
* Component BEM modifiers
|
|
98
127
|
*/
|
|
99
|
-
modifiers:
|
|
128
|
+
modifiers: {
|
|
129
|
+
type: [String, Array],
|
|
130
|
+
default: void 0
|
|
131
|
+
}
|
|
100
132
|
};
|
|
101
133
|
({
|
|
102
134
|
/**
|
|
103
135
|
* VvIcon name or props
|
|
104
136
|
* @see VVIcon
|
|
105
137
|
*/
|
|
106
|
-
icon: {
|
|
138
|
+
icon: {
|
|
139
|
+
type: [String, Object],
|
|
140
|
+
default: void 0
|
|
141
|
+
},
|
|
107
142
|
/**
|
|
108
143
|
* VvIcon position
|
|
109
144
|
*/
|
|
@@ -134,7 +169,8 @@ const ModifiersProps = {
|
|
|
134
169
|
* Dropdown show / hide transition name
|
|
135
170
|
*/
|
|
136
171
|
transitionName: {
|
|
137
|
-
type: String
|
|
172
|
+
type: String,
|
|
173
|
+
default: void 0
|
|
138
174
|
},
|
|
139
175
|
/**
|
|
140
176
|
* Offset of the dropdown from the trigger
|
|
@@ -202,7 +238,8 @@ const ModifiersProps = {
|
|
|
202
238
|
* Set dropdown width to the same as the trigger
|
|
203
239
|
*/
|
|
204
240
|
triggerWidth: {
|
|
205
|
-
type: Boolean
|
|
241
|
+
type: Boolean,
|
|
242
|
+
default: false
|
|
206
243
|
}
|
|
207
244
|
});
|
|
208
245
|
({
|
|
@@ -210,6 +247,7 @@ const ModifiersProps = {
|
|
|
210
247
|
...LabelProps,
|
|
211
248
|
...PressedProps,
|
|
212
249
|
...ActiveProps,
|
|
250
|
+
...CurrentProps,
|
|
213
251
|
...LinkProps,
|
|
214
252
|
/**
|
|
215
253
|
* Button type
|
|
@@ -225,6 +263,13 @@ const ModifiersProps = {
|
|
|
225
263
|
ariaLabel: {
|
|
226
264
|
type: String,
|
|
227
265
|
default: void 0
|
|
266
|
+
},
|
|
267
|
+
/**
|
|
268
|
+
* Default tag for the action
|
|
269
|
+
*/
|
|
270
|
+
defaultTag: {
|
|
271
|
+
type: String,
|
|
272
|
+
default: ActionTag.button
|
|
228
273
|
}
|
|
229
274
|
});
|
|
230
275
|
const VvAvatarGroupProps = {
|
|
@@ -296,13 +341,13 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
296
341
|
key: 0,
|
|
297
342
|
src: _ctx.imgSrc,
|
|
298
343
|
alt: "avatar"
|
|
299
|
-
}, null, 8, _hoisted_2)) : createCommentVNode("", true)
|
|
344
|
+
}, null, 8, _hoisted_2)) : createCommentVNode("v-if", true)
|
|
300
345
|
])
|
|
301
346
|
], 10, _hoisted_1$1);
|
|
302
347
|
};
|
|
303
348
|
}
|
|
304
349
|
});
|
|
305
|
-
const useUniqueId = (id) => computed(() => String((id == null ? void 0 : id.value) ||
|
|
350
|
+
const useUniqueId = (id) => computed(() => String((id == null ? void 0 : id.value) || uid()));
|
|
306
351
|
const _hoisted_1 = { key: 0 };
|
|
307
352
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
308
353
|
__name: "VvAvatarGroup",
|
|
@@ -335,34 +380,64 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
335
380
|
});
|
|
336
381
|
});
|
|
337
382
|
return (_ctx, _cache) => {
|
|
338
|
-
return openBlock(), createElementBlock(
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
383
|
+
return openBlock(), createElementBlock(
|
|
384
|
+
"span",
|
|
385
|
+
{
|
|
386
|
+
class: normalizeClass(unref(bemCssClasses))
|
|
387
|
+
},
|
|
388
|
+
[
|
|
389
|
+
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
390
|
+
(openBlock(true), createElementBlock(
|
|
391
|
+
Fragment,
|
|
392
|
+
null,
|
|
393
|
+
renderList(unref(avatarItems), (avatarItem) => {
|
|
394
|
+
return openBlock(), createBlock(
|
|
395
|
+
_sfc_main$1,
|
|
396
|
+
mergeProps({
|
|
397
|
+
key: avatarItem.key
|
|
398
|
+
}, {
|
|
399
|
+
modifiers: avatarItem.modifiers,
|
|
400
|
+
imgSrc: avatarItem.imgSrc
|
|
401
|
+
}),
|
|
402
|
+
{
|
|
403
|
+
default: withCtx(() => [
|
|
404
|
+
avatarItem.text ? (openBlock(), createElementBlock(
|
|
405
|
+
"span",
|
|
406
|
+
_hoisted_1,
|
|
407
|
+
toDisplayString(avatarItem.text),
|
|
408
|
+
1
|
|
409
|
+
/* TEXT */
|
|
410
|
+
)) : createCommentVNode("v-if", true)
|
|
411
|
+
]),
|
|
412
|
+
_: 2
|
|
413
|
+
/* DYNAMIC */
|
|
414
|
+
},
|
|
415
|
+
1040
|
|
416
|
+
/* FULL_PROPS, DYNAMIC_SLOTS */
|
|
417
|
+
);
|
|
418
|
+
}),
|
|
419
|
+
128
|
|
420
|
+
/* KEYED_FRAGMENT */
|
|
421
|
+
)),
|
|
422
|
+
(unref(totalItems) || unref(items).length) > unref(toShow) ? (openBlock(), createBlock(_sfc_main$1, {
|
|
423
|
+
key: 0,
|
|
424
|
+
modifiers: `${unref(stringModifiers)} surface bordered`
|
|
345
425
|
}, {
|
|
346
|
-
modifiers: avatarItem.modifiers,
|
|
347
|
-
imgSrc: avatarItem.imgSrc
|
|
348
|
-
}), {
|
|
349
426
|
default: withCtx(() => [
|
|
350
|
-
|
|
427
|
+
createTextVNode(
|
|
428
|
+
toDisplayString(`+${(unref(totalItems) || unref(items).length) - unref(toShow)}`),
|
|
429
|
+
1
|
|
430
|
+
/* TEXT */
|
|
431
|
+
)
|
|
351
432
|
]),
|
|
352
|
-
_:
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
createTextVNode(toDisplayString(`+${(unref(totalItems) || unref(items).length) - unref(toShow)}`), 1)
|
|
361
|
-
]),
|
|
362
|
-
_: 1
|
|
363
|
-
}, 8, ["modifiers"])) : createCommentVNode("", true)
|
|
364
|
-
])
|
|
365
|
-
], 2);
|
|
433
|
+
_: 1
|
|
434
|
+
/* STABLE */
|
|
435
|
+
}, 8, ["modifiers"])) : createCommentVNode("v-if", true)
|
|
436
|
+
])
|
|
437
|
+
],
|
|
438
|
+
2
|
|
439
|
+
/* CLASS */
|
|
440
|
+
);
|
|
366
441
|
};
|
|
367
442
|
}
|
|
368
443
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?module.exports=o(require("vue"),require("
|
|
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))}})}));
|
|
@@ -12,8 +12,11 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
12
12
|
type: NumberConstructor;
|
|
13
13
|
};
|
|
14
14
|
avatarModifiers: globalThis.PropType<string | string[]>;
|
|
15
|
-
modifiers:
|
|
16
|
-
|
|
15
|
+
modifiers: {
|
|
16
|
+
type: globalThis.PropType<string | string[]>;
|
|
17
|
+
default: undefined;
|
|
18
|
+
};
|
|
19
|
+
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<globalThis.ExtractPropTypes<{
|
|
17
20
|
items: {
|
|
18
21
|
type: globalThis.PropType<import("@/components/VvAvatarGroup").AvatarItem[]>;
|
|
19
22
|
default: () => never[];
|
|
@@ -27,8 +30,12 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
27
30
|
type: NumberConstructor;
|
|
28
31
|
};
|
|
29
32
|
avatarModifiers: globalThis.PropType<string | string[]>;
|
|
30
|
-
modifiers:
|
|
33
|
+
modifiers: {
|
|
34
|
+
type: globalThis.PropType<string | string[]>;
|
|
35
|
+
default: undefined;
|
|
36
|
+
};
|
|
31
37
|
}>>, {
|
|
38
|
+
modifiers: string | string[];
|
|
32
39
|
items: import("@/components/VvAvatarGroup").AvatarItem[];
|
|
33
40
|
toShow: number;
|
|
34
41
|
}, {}>, {
|
|
@@ -21,5 +21,8 @@ export declare const VvAvatarGroupProps: {
|
|
|
21
21
|
type: NumberConstructor;
|
|
22
22
|
};
|
|
23
23
|
avatarModifiers: globalThis.PropType<string | string[]>;
|
|
24
|
-
modifiers:
|
|
24
|
+
modifiers: {
|
|
25
|
+
type: globalThis.PropType<string | string[]>;
|
|
26
|
+
default: undefined;
|
|
27
|
+
};
|
|
25
28
|
};
|