@volverjs/ui-vue 0.0.10-beta.2 → 0.0.10-beta.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +98 -3
- package/auto-imports.d.ts +6 -2
- package/bin/icons.cjs +1 -1
- package/bin/icons.js +23 -16
- package/dist/Volver.d.ts +1 -1
- package/dist/components/VvAccordion/VvAccordion.es.js +67 -13
- package/dist/components/VvAccordion/VvAccordion.umd.js +1 -1
- package/dist/components/VvAccordion/VvAccordion.vue.d.ts +13 -6
- package/dist/components/VvAccordion/index.d.ts +4 -1
- package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +111 -37
- package/dist/components/VvAccordionGroup/VvAccordionGroup.umd.js +1 -1
- package/dist/components/VvAccordionGroup/VvAccordionGroup.vue.d.ts +15 -8
- package/dist/components/VvAccordionGroup/index.d.ts +4 -1
- package/dist/components/VvAction/VvAction.es.js +56 -12
- package/dist/components/VvAction/VvAction.umd.js +1 -1
- package/dist/components/VvAction/VvAction.vue.d.ts +59 -12
- package/dist/components/VvAction/index.d.ts +25 -4
- package/dist/components/VvAlert/VvAlert.es.js +188 -152
- package/dist/components/VvAlert/VvAlert.umd.js +1 -1
- package/dist/components/VvAlert/VvAlert.vue.d.ts +18 -8
- package/dist/components/VvAlert/index.d.ts +9 -5
- package/dist/components/VvAlertGroup/VvAlertGroup.es.js +230 -174
- package/dist/components/VvAlertGroup/VvAlertGroup.umd.js +1 -1
- package/dist/components/VvAlertGroup/VvAlertGroup.vue.d.ts +13 -6
- package/dist/components/VvAlertGroup/index.d.ts +6 -2
- package/dist/components/VvAvatar/VvAvatar.es.js +54 -9
- package/dist/components/VvAvatar/VvAvatar.umd.js +1 -1
- package/dist/components/VvAvatar/VvAvatar.vue.d.ts +12 -4
- package/dist/components/VvAvatar/index.d.ts +4 -1
- package/dist/components/VvAvatarGroup/VvAvatarGroup.es.js +111 -36
- package/dist/components/VvAvatarGroup/VvAvatarGroup.umd.js +1 -1
- package/dist/components/VvAvatarGroup/VvAvatarGroup.vue.d.ts +10 -3
- package/dist/components/VvAvatarGroup/index.d.ts +4 -1
- package/dist/components/VvBadge/VvBadge.es.js +71 -16
- package/dist/components/VvBadge/VvBadge.umd.js +1 -1
- package/dist/components/VvBadge/VvBadge.vue.d.ts +12 -4
- package/dist/components/VvBadge/index.d.ts +4 -1
- package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +257 -49
- package/dist/components/VvBreadcrumb/VvBreadcrumb.umd.js +1 -1
- package/dist/components/VvBreadcrumb/VvBreadcrumb.vue.d.ts +27 -7
- package/dist/components/VvBreadcrumb/index.d.ts +6 -10
- package/dist/components/VvButton/VvButton.es.js +165 -137
- package/dist/components/VvButton/VvButton.umd.js +1 -1
- package/dist/components/VvButton/VvButton.vue.d.ts +101 -27
- package/dist/components/VvButton/index.d.ts +41 -14
- package/dist/components/VvButtonGroup/VvButtonGroup.es.js +67 -15
- package/dist/components/VvButtonGroup/VvButtonGroup.umd.js +1 -1
- package/dist/components/VvButtonGroup/VvButtonGroup.vue.d.ts +23 -10
- package/dist/components/VvButtonGroup/index.d.ts +8 -2
- package/dist/components/VvCard/VvCard.es.js +79 -24
- package/dist/components/VvCard/VvCard.umd.js +1 -1
- package/dist/components/VvCard/VvCard.vue.d.ts +12 -4
- package/dist/components/VvCard/index.d.ts +4 -1
- package/dist/components/VvCheckbox/VvCheckbox.es.js +89 -21
- package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -1
- package/dist/components/VvCheckbox/VvCheckbox.vue.d.ts +104 -32
- package/dist/components/VvCheckbox/index.d.ts +45 -12
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +168 -66
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.vue.d.ts +100 -29
- package/dist/components/VvCheckboxGroup/index.d.ts +45 -12
- package/dist/components/VvCombobox/VvCombobox.es.js +721 -527
- package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
- package/dist/components/VvCombobox/VvCombobox.vue.d.ts +145 -72
- package/dist/components/VvCombobox/index.d.ts +53 -22
- package/dist/components/VvDialog/VvDialog.es.js +133 -141
- package/dist/components/VvDialog/VvDialog.umd.js +1 -1
- package/dist/components/VvDialog/VvDialog.vue.d.ts +4 -4
- package/dist/components/VvDropdown/VvDropdown.es.js +121 -55
- package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
- package/dist/components/VvDropdown/VvDropdown.vue.d.ts +61 -35
- package/dist/components/VvDropdown/VvDropdownAction.vue.d.ts +72 -11
- package/dist/components/VvDropdown/VvDropdownItem.vue.d.ts +1 -1
- package/dist/components/VvDropdown/VvDropdownOptgroup.vue.d.ts +12 -4
- package/dist/components/VvDropdown/VvDropdownOption.vue.d.ts +26 -7
- package/dist/components/VvDropdown/index.d.ts +16 -11
- package/dist/components/VvDropdownAction/VvDropdownAction.es.js +80 -21
- package/dist/components/VvDropdownAction/VvDropdownAction.umd.js +1 -1
- package/dist/components/VvDropdownItem/VvDropdownItem.es.js +13 -7
- package/dist/components/VvDropdownOptgroup/VvDropdownOptgroup.es.js +56 -8
- package/dist/components/VvDropdownOptgroup/VvDropdownOptgroup.umd.js +1 -1
- package/dist/components/VvDropdownOption/VvDropdownOption.es.js +76 -17
- package/dist/components/VvDropdownOption/VvDropdownOption.umd.js +1 -1
- package/dist/components/VvIcon/VvIcon.es.js +23 -96
- package/dist/components/VvIcon/VvIcon.umd.js +1 -1
- package/dist/components/VvIcon/VvIcon.vue.d.ts +23 -66
- package/dist/components/VvIcon/index.d.ts +21 -48
- package/dist/components/VvInputFile/VvInputFile.es.js +1558 -0
- package/dist/components/VvInputFile/VvInputFile.umd.js +1 -0
- package/dist/components/VvInputFile/VvInputFile.vue.d.ts +190 -0
- package/dist/components/VvInputFile/index.d.ts +74 -0
- package/dist/components/VvInputText/VvInputClearAction.d.ts +2 -2
- package/dist/components/VvInputText/VvInputPasswordAction.d.ts +1 -1
- package/dist/components/VvInputText/VvInputStepAction.d.ts +1 -1
- package/dist/components/VvInputText/VvInputText.es.js +266 -242
- package/dist/components/VvInputText/VvInputText.umd.js +1 -1
- package/dist/components/VvInputText/VvInputText.vue.d.ts +153 -46
- package/dist/components/VvInputText/index.d.ts +69 -18
- package/dist/components/VvNav/VvNav.es.js +150 -73
- package/dist/components/VvNav/VvNav.umd.js +1 -1
- package/dist/components/VvNav/VvNav.vue.d.ts +41 -14
- package/dist/components/VvNav/VvNavItem.vue.d.ts +9 -0
- package/dist/components/VvNav/{VvNavSeparator.d.ts → VvNavSeparator.vue.d.ts} +1 -1
- package/dist/components/VvNav/index.d.ts +5 -13
- package/dist/components/VvNavItem/VvNavItem.es.js +435 -0
- package/dist/components/VvNavItem/VvNavItem.umd.js +1 -0
- package/dist/components/VvNavSeparator/VvNavSeparator.es.js +24 -0
- package/dist/components/VvNavSeparator/VvNavSeparator.umd.js +1 -0
- package/dist/components/VvProgress/VvProgress.es.js +65 -14
- package/dist/components/VvProgress/VvProgress.umd.js +1 -1
- package/dist/components/VvProgress/VvProgress.vue.d.ts +10 -3
- package/dist/components/VvProgress/index.d.ts +4 -1
- package/dist/components/VvRadio/VvRadio.es.js +89 -21
- package/dist/components/VvRadio/VvRadio.umd.js +1 -1
- package/dist/components/VvRadio/VvRadio.vue.d.ts +102 -30
- package/dist/components/VvRadio/index.d.ts +44 -11
- package/dist/components/VvRadioGroup/VvRadioGroup.es.js +168 -66
- package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
- package/dist/components/VvRadioGroup/VvRadioGroup.vue.d.ts +100 -29
- package/dist/components/VvRadioGroup/index.d.ts +45 -12
- package/dist/components/VvSelect/VvSelect.es.js +244 -226
- package/dist/components/VvSelect/VvSelect.umd.js +1 -1
- package/dist/components/VvSelect/VvSelect.vue.d.ts +112 -39
- package/dist/components/VvSelect/index.d.ts +48 -14
- package/dist/components/VvTab/VvTab.es.js +251 -110
- package/dist/components/VvTab/VvTab.umd.js +1 -1
- package/dist/components/VvTab/VvTab.vue.d.ts +50 -13
- package/dist/components/VvTab/index.d.ts +13 -4
- package/dist/components/VvTextarea/VvTextarea.es.js +225 -212
- package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
- package/dist/components/VvTextarea/VvTextarea.vue.d.ts +155 -48
- package/dist/components/VvTextarea/index.d.ts +68 -19
- package/dist/components/VvTooltip/VvTooltip.es.js +72 -17
- package/dist/components/VvTooltip/VvTooltip.umd.js +1 -1
- package/dist/components/VvTooltip/VvTooltip.vue.d.ts +10 -3
- package/dist/components/VvTooltip/index.d.ts +4 -1
- package/dist/components/index.d.ts +10 -0
- package/dist/components/index.es.js +2635 -1301
- package/dist/components/index.umd.js +1 -1
- package/dist/composables/alert/useAlert.d.ts +37 -4
- package/dist/composables/dropdown/useProvideDropdown.d.ts +1 -1
- package/dist/composables/index.d.ts +1 -0
- package/dist/composables/index.es.js +88 -1
- package/dist/composables/index.umd.js +1 -1
- package/dist/composables/useBlurhash.d.ts +7 -0
- package/dist/composables/useComponentIcon.d.ts +9 -8
- package/dist/composables/useVolver.d.ts +1 -1
- package/dist/directives/index.d.ts +3 -5
- package/dist/directives/index.es.js +92 -31
- package/dist/directives/index.umd.js +1 -1
- package/dist/directives/v-tooltip.es.js +90 -26
- package/dist/directives/v-tooltip.umd.js +1 -1
- package/dist/icons.es.js +6 -6
- package/dist/icons.umd.js +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.es.js +81 -16
- package/dist/index.umd.js +1 -1
- package/dist/props/index.d.ts +287 -73
- package/dist/resolvers/unplugin.d.ts +6 -1
- package/dist/resolvers/unplugin.es.js +78 -10
- package/dist/resolvers/unplugin.umd.js +1 -1
- package/dist/stories/AccordionGroup/AccordionGroup.stories.d.ts +72 -84
- package/dist/stories/AccordionGroup/AccordionGroupSlots.stories.d.ts +623 -461
- package/dist/stories/AlertGroup/AlertGroupWithComposable.stories.d.ts +1 -1
- package/dist/stories/Blurhash/BlurhashComposable.stories.d.ts +4 -0
- package/dist/stories/Combobox/Combobox.settings.d.ts +8 -0
- package/dist/stories/Icon/Icon.settings.d.ts +1 -0
- package/dist/stories/InputFile/InputFile.settings.d.ts +56 -0
- package/dist/stories/InputFile/InputFile.stories.d.ts +13 -0
- package/dist/stories/InputFile/InputFileModifiers.stories.d.ts +9 -0
- package/dist/stories/InputFile/InputFileSlots.stories.d.ts +6 -0
- package/dist/stories/Tab/Tab.settings.d.ts +4 -37
- package/dist/types/alert.d.ts +13 -0
- package/dist/types/blurhash.d.ts +12 -0
- package/dist/types/floating-ui.d.ts +6 -0
- package/dist/types/generic.d.ts +4 -0
- package/dist/types/group.d.ts +37 -0
- package/dist/types/index.d.ts +7 -0
- package/dist/types/input-file.d.ts +14 -0
- package/dist/types/nav.d.ts +18 -0
- package/dist/utils/ObjectUtilities.d.ts +0 -1
- package/dist/workers/blurhash.d.ts +1 -0
- package/package.json +91 -74
- package/src/Volver.ts +31 -20
- package/src/assets/icons/detailed.json +1 -1
- package/src/assets/icons/normal.json +1 -1
- package/src/assets/icons/simple.json +1 -1
- package/src/components/VvAccordion/VvAccordion.vue +2 -2
- package/src/components/VvAction/VvAction.vue +5 -2
- package/src/components/VvAlert/index.ts +1 -3
- package/src/components/VvAlertGroup/index.ts +2 -1
- package/src/components/VvBreadcrumb/VvBreadcrumb.vue +20 -19
- package/src/components/VvBreadcrumb/index.ts +2 -8
- package/src/components/VvButton/VvButton.vue +6 -6
- package/src/components/VvButton/index.ts +2 -4
- package/src/components/VvCombobox/VvCombobox.vue +24 -16
- package/src/components/VvCombobox/index.ts +4 -0
- package/src/components/VvIcon/VvIcon.vue +2 -2
- package/src/components/VvIcon/index.ts +22 -48
- package/src/components/VvInputFile/VvInputFile.vue +302 -0
- package/src/components/VvInputFile/index.ts +38 -0
- package/src/components/VvInputText/VvInputText.vue +13 -14
- package/src/components/VvNav/VvNav.vue +30 -50
- package/src/components/VvNav/VvNavItem.vue +18 -0
- package/src/components/VvNav/VvNavSeparator.vue +11 -0
- package/src/components/VvNav/index.ts +2 -15
- package/src/components/VvSelect/VvSelect.vue +5 -8
- package/src/components/VvTab/VvTab.vue +63 -35
- package/src/components/VvTab/index.ts +10 -4
- package/src/components/VvTextarea/VvTextarea.vue +6 -9
- package/src/components/index.ts +10 -0
- package/src/composables/index.ts +1 -0
- package/src/composables/useBlurhash.ts +76 -0
- package/src/composables/useComponentIcon.ts +15 -14
- package/src/composables/useUniqueId.ts +2 -2
- package/src/directives/index.ts +3 -6
- package/src/directives/v-tooltip.ts +19 -10
- package/src/index.ts +3 -1
- package/src/props/index.ts +115 -27
- package/src/resolvers/unplugin.ts +24 -14
- package/src/stories/AlertGroup/AlertGroupWithComposable.stories.ts +2 -2
- package/src/stories/Blurhash/BlurhashComposable.stories.ts +195 -0
- package/src/stories/Combobox/Combobox.settings.ts +8 -0
- package/src/stories/Icon/Icon.settings.ts +3 -3
- package/src/stories/InputFile/InputFile.settings.ts +36 -0
- package/src/stories/InputFile/InputFile.stories.ts +98 -0
- package/src/stories/InputFile/InputFileModifiers.stories.ts +51 -0
- package/src/stories/InputFile/InputFileSlots.stories.ts +25 -0
- package/src/stories/Nav/Nav.settings.ts +3 -4
- package/src/stories/Nav/Nav.test.ts +4 -15
- package/src/stories/Tab/Tab.settings.ts +9 -9
- package/src/stories/Tab/Tab.stories.ts +2 -2
- package/src/stories/Tab/Tab.test.ts +6 -14
- package/src/stories/argTypes.ts +1 -1
- package/src/types/blurhash.ts +21 -0
- package/src/types/generic.ts +6 -0
- package/src/types/index.ts +7 -0
- package/src/types/input-file.ts +16 -0
- package/src/types/nav.ts +20 -0
- package/src/utils/ObjectUtilities.ts +0 -11
- package/src/workers/blurhash.ts +9 -0
- package/dist/components/VvNav/VvNavItemTitle.vue.d.ts +0 -6
- package/dist/components/VvNavItemTitle/VvNavItemTitle.es.js +0 -19
- package/dist/components/VvNavItemTitle/VvNavItemTitle.umd.js +0 -1
- package/src/components/VvNav/VvNavItemTitle.vue +0 -11
- package/src/components/VvNav/VvNavSeparator.ts +0 -8
- package/src/types/generic.d.ts +0 -6
- /package/src/types/{alert.d.ts → alert.ts} +0 -0
- /package/src/types/{floating-ui.d.ts → floating-ui.ts} +0 -0
- /package/src/types/{group.d.ts → group.ts} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue"),require("vue-imask"),require("@iconify/vue"),require("nanoid"),require("@vueuse/core")):"function"==typeof define&&define.amd?define(["vue","vue-imask","@iconify/vue","nanoid","@vueuse/core"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VvInputText=t(e.vue,e.vueImask,e.vue$1,e.nanoid,e.core)}(this,(function(e,t,l,o,a){"use strict";function n(t){return null==(l=e.unref(t))||""===l||Array.isArray(l)&&0===l.length||!(l instanceof Date)&&"object"==typeof l&&0===Object.keys(l).length;var l}function i(e){return Array.isArray(e)?e.filter((e=>{return"string"==typeof(t=e)||t instanceof String;var t})).join(" "):e}const r={color:String,width:{type:[String,Number]},height:{type:[String,Number]},name:{type:String,required:!0},provider:{type:String},prefix:{type:String,default:"normal"},src:String,horizontalFlip:Boolean,verticalFlip:Boolean,flip:String,mode:String,inline:Boolean,rotate:[Number,String],onLoad:Function,svg:String,modifiers:{type:[String,Array]}};var u=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(u||{}),s=(e=>(e.before="before",e.after="after",e))(s||{}),d=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(d||{});const c=Symbol.for("volver");function v(){return e.inject(c)}function p(t,l,o){return e.computed((()=>{const a={[t]:!0},n="string"==typeof(null==l?void 0:l.value)?l.value.split(" "):null==l?void 0:l.value;return n&&Array.isArray(n)&&n.forEach((e=>{e&&(a[`${t}--${e}`]=!0)})),o&&Object.keys(o.value).forEach((l=>{a[`${t}--${l}`]=e.unref(o.value[l])})),a}))}const m=e.defineComponent({name:"VvIcon",props:r,setup(t){const o=t,a=e.computed((()=>"string"==typeof o.rotate?parseFloat(o.rotate):o.rotate)),n=e.ref(!0),i=v(),{modifiers:r}=e.toRefs(o),u=p("vv-icon",r),s=e.computed((()=>o.provider||(null==i?void 0:i.iconsProvider))),d=e.computed((()=>{const e=o.name??"",t=`@${s.value}:${o.prefix}:${e}`;if(l.iconExists(t))return t;const a=null==i?void 0:i.iconsCollections.find((t=>{const o=`@${s.value}:${t.prefix}:${e}`;return l.iconExists(o)}));return a?`@${s.value}:${a.prefix}:${e}`:e}));function c(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),a=(null==t?void 0:t.innerHTML.trim())||"";t&&a&&l.addIcon(`@${s.value}:${o.prefix}:${o.name}`,{body:a,height:t.viewBox.baseVal.height,width:t.viewBox.baseVal.width})}return i&&o.src&&!l.iconExists(`@${s.value}:${o.prefix}:${o.name}`)&&(n.value=!1,i.fetchIcon(o.src).then((e=>{e&&(c(e),n.value=!0)})).catch((e=>{throw new Error(`Error during fetch icon: ${null==e?void 0:e.message}`)}))),o.svg&&c(o.svg),(t,o)=>e.unref(n)?(e.openBlock(),e.createBlock(e.unref(l.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(a),color:t.color,onLoad:t.onLoad,icon:e.unref(d)}),null,16,["class"])):e.createCommentVNode("",!0)}}),f={valid:Boolean,validLabel:[String,Array]},h={invalid:Boolean,invalidLabel:[String,Array]},b={loading:Boolean,loadingLabel:{type:String,default:"Loading..."}},g={disabled:Boolean},S=(Boolean,Boolean,{label:[String,Number]}),y={readonly:Boolean},w={modifiers:[String,Array]},k={hintLabel:{type:String,default:""}},L={count:{type:[Boolean,String],default:!1,validator:e=>[!0,!1,"limit","countdown"].includes(e)}},B={debounce:[Number,String]},E={icon:{type:[String,Object]},iconPosition:{type:String,default:s.before,validation:e=>Object.values(s).includes(e)}},$={tabindex:{type:[String,Number],default:0}},x={floating:Boolean},A={id:[String,Number]};u.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const T={...{...A,name:{type:String,required:!0}},...{autofocus:Boolean},...{autocomplete:{type:String,default:"off"}},...$,...g,...y,...f,...h,...k,...b,...w,...L,...B,...E,...x,...S,minlength:[String,Number],maxlength:[String,Number],placeholder:String,required:Boolean};d.button;const P={TEXT:"text",PASSWORD:"password",NUMBER:"number",EMAIL:"email",TEL:"tel",URL:"url",COLOR:"color",SEARCH:"search",DATE:"date",TIME:"time",DATETIME_LOCAL:"datetime-local",MONTH:"month",WEEK:"week"},C="eye-on",D="eye-off",I="calendar",O="time",V="color",_={...T,modelValue:[String,Number],type:{type:String,default:P.TEXT,validator:e=>Object.values(P).includes(e)},min:[Number,Date,String],max:[Number,Date,String],step:{type:[String,Number],default:1},pattern:String,multiple:Boolean,iconShowPassword:{type:String,default:C},iconHidePassword:{type:String,default:D},iconClear:{type:String,default:"close"},labelStepUp:{type:String,default:"Increase value"},labelStepDown:{type:String,default:"Decrease value"},labelShowPassword:{type:String,default:"Show password"},labelHidePassword:{type:String,default:"Hide password"},labelClear:{type:String,default:"Clear"},iMask:{type:Object,default:void 0},masked:{type:String,default:void 0},autoWidth:{type:Boolean,default:!1},hideActions:{type:Boolean,default:!1},unit:{type:String},selectOnFocus:{type:Boolean,default:!1}},N=e.defineComponent({components:{VvIcon:m},props:{disabled:{type:Boolean,default:!1},labelShow:{type:String,default:"Show password"},labelHide:{type:String,default:"Hide password"},iconShow:{type:String,default:C},iconHide:{type:String,default:D}},emits:["toggle-password"],setup(t,{emit:l}){const o=e.ref(!1),a=e.computed((()=>o.value?t.iconHide:t.iconShow));return{active:o,activeIcon:a,onClick:function(e){null==e||e.stopPropagation(),t.disabled||(o.value=!o.value,l("toggle-password",o.value))}}},render(){const t=e.h(m,{name:this.activeIcon,class:"vv-input-text__icon"});return e.h("button",{disabled:this.disabled,class:"vv-input-text__action",ariaLabel:this.active?this.labelHide:this.labelShow,type:"button",onClick:this.onClick},t)}}),M=e.defineComponent({components:{VvIcon:m},props:{disabled:{type:Boolean,default:!1},label:{type:String},mode:{type:String,validator:e=>["up","down"].includes(e),default:"up"}},emits:["step-up","step-down"],setup(t,{emit:l}){const o=e.computed((()=>"up"===t.mode));return{isUp:o,onClick:e=>{null==e||e.stopPropagation(),t.disabled||l(o.value?"step-up":"step-down")}}},render(){return e.h("button",{class:["vv-input-text__action vv-input-text__action-chevron",this.isUp&&"vv-input-text__action-chevron-up"],disabled:this.disabled,ariaLabel:this.label,type:"button",onClick:this.onClick})}}),R=e.defineComponent({components:{VvIcon:m},props:{disabled:{type:Boolean,default:!1},label:{type:String,default:"Clear"},icon:{type:String,default:"close"}},emits:["clear"],setup:(e,{emit:t})=>({onClick:function(l){null==l||l.stopPropagation(),e.disabled||t("clear")}}),render(){const t=e.h(m,{name:this.icon,class:"vv-input-text__icon"});return e.h("button",{disabled:this.disabled,class:"vv-input-text__action",ariaLabel:this.label,type:"button",onClick:this.onClick},t)}});function H(t,l){return{name:"VvInputTextActions",components:{VvIcon:m,VvInputPasswordAction:N,VvInputStepAction:M,VvInputClearAction:R},setup:()=>({isDisabled:e.computed((()=>l.disabled||l.readonly)),labelStepUp:l.labelStepUp,labelStepDown:l.labelStepDown,labelShowPassword:l.labelShowPassword,labelHidePassword:l.labelHidePassword,labelClear:l.labelClear,iconShowPassword:l.iconShowPassword,iconHidePassword:l.iconHidePassword}),render(){let o=null;switch(t){case P.SEARCH:{const{onClear:t}=this.$attrs;o=[e.h(R,{disabled:this.isDisabled,label:this.labelShowPassword,onClear:t})];break}case P.PASSWORD:{const{onTogglePassword:t}=this.$attrs;o=[e.h(N,{disabled:this.isDisabled,onTogglePassword:t,labelShow:this.labelShowPassword,labelHide:this.labelHidePassword,iconShow:this.iconShowPassword,iconHide:this.iconHidePassword})];break}case P.NUMBER:{const{onStepUp:t,onStepDown:a}=this.$attrs;o=[e.h(M,{mode:"up",disabled:this.isDisabled||void 0!==l.max&&l.modelValue===l.max,label:this.labelStepUp,onStepUp:t,onStepDown:a}),e.h(M,{mode:"down",disabled:this.isDisabled||void 0!==l.min&&l.modelValue===l.min,label:this.labelStepDown,onStepUp:t,onStepDown:a})];break}}return Array.isArray(o)?e.h("div",{class:"vv-input-text__actions-group"},o):o}}}const U=["for"],j={class:"vv-input-text__wrapper"},F={key:0,class:"vv-input-text__input-before"},W=["onClick"],q=["id"],z={key:1,class:"vv-input-text__unit"},K={key:5,class:"vv-input-text__input-after"},X={key:6,class:"vv-input-text__limit"};return e.defineComponent({name:"VvInputText",props:_,emits:["update:modelValue","update:masked","accept","accept:typed","accept:masked","accept:unmasked","complete","complete:typed","complete:masked","complete:unmasked","focus","blur","keyup","keydown","keypress"],setup(l,{expose:r,emit:d}){const c=l,f=e.useSlots(),h=function(t,l,o){const a=v(),n=e.computed((()=>{var e;if(a&&(null==(e=a.defaults.value)?void 0:e[t]))return a.defaults.value[t]}));return e.computed((()=>{if(void 0===n.value)return o;const e=n.value,t=l,a=o;return Object.keys(t).reduce(((l,o)=>{const n=a[o];if(l[o]=n,o in e){if(Array.isArray(t[o])){const a=t[o];a.length&&a[0]===n&&(l[o]=e[o])}if("function"==typeof t[o]&&(0,t[o])()===n&&(l[o]=e[o]),"object"==typeof t[o]){let a=t[o].default;"function"==typeof a&&(a=a()),"object"==typeof a?JSON.stringify(a)===JSON.stringify(n)&&(l[o]=e[o]):a===n&&(l[o]=e[o])}}return l}),{})}))}("VvInputText",_,c),{id:b,icon:g,iconPosition:S,label:y,modelValue:w,count:k,valid:L,invalid:B,loading:E,debounce:$,maxlength:x,minlength:A,type:T,iMask:C,step:D}=e.toRefs(c),N=(t=>e.computed((()=>String((null==t?void 0:t.value)||o.nanoid()))))(b),M=e.computed((()=>`${N.value}-hint`)),R=e.computed((()=>c.floating&&n(c.placeholder)?" ":c.placeholder)),J=e.ref(!1),{el:Y,mask:G,typed:Q,masked:Z,unmasked:ee}=t.useIMask(e.computed((()=>(null==C?void 0:C.value)??{mask:/./})),{emit:d,onAccept:()=>{if(J.value){if(d("update:masked",Z.value),T.value===P.NUMBER){if(""===Z.value){if(null===oe.value||void 0===oe.value)return;return void(oe.value=void 0)}return"number"!=typeof Q.value?void(oe.value=Number(Q.value)):void(oe.value=Q.value)}if(T.value===P.DATE){if(Y.value instanceof HTMLInputElement&&"date"===Y.value.type)return void(oe.value=Y.value.value);let e=Q.value;if(null===e||""===e){if(!oe.value)return;return void(oe.value="")}return e instanceof Date||(e=new Date(e)),void(oe.value=`${e.getFullYear()}-${("0"+(e.getMonth()+1)).slice(-2)}-${("0"+e.getDate()).slice(-2)}`)}if(T.value===P.DATETIME_LOCAL){if(Y.value instanceof HTMLInputElement&&"datetime-local"===Y.value.type)return void(oe.value=Y.value.value);let e=Q.value;if(null===e||""===e){if(!oe.value)return;return void(oe.value="")}return Q.value instanceof Date||(e=new Date(e)),void(oe.value=`${e.getFullYear()}-${("0"+(e.getMonth()+1)).slice(-2)}-${("0"+e.getDate()).slice(-2)}T${("0"+e.getHours()).slice(-2)}:${("0"+e.getMinutes()).slice(-2)}`)}(oe.value||ee.value)&&(oe.value=ee.value)}}});e.onMounted((()=>{G.value&&(J.value=!0,Q.value=oe.value??"")})),e.watch((()=>c.modelValue),(e=>{var t;G.value&&(Q.value=e&&(null==(t=null==C?void 0:C.value)?void 0:t.mask)===Date?new Date(e):e??"")})),e.watch((()=>c.masked),(e=>{Z.value=e??""}));const te=Y,le=e.ref();r({$inner:le});const oe=function(t,l,o=0,{getter:a=(e=>e),setter:n=(e=>e)}={}){let i;return"string"==typeof o&&(o=parseInt(o)),e.computed({get:()=>a(null==t?void 0:t.value),set:e=>{i&&clearTimeout(i),i=setTimeout((()=>{l("update:modelValue",n(e))}),o)}})}(w,d,(null==$?void 0:$.value)??0),{focused:ae}=function(t,l){const{focused:o}=a.useFocus(t);return e.watch(o,(o=>{l(o?"focus":"blur",e.unref(t))})),{focused:o}}(te,d),ne=e.computed((()=>ae.value&&!c.disabled&&!c.readonly));e.watch(ne,(e=>{e&&h.value.selectOnFocus&&te.value&&te.value.select()}));const ie=a.useElementVisibility(te);e.watch(ie,(e=>{e&&c.autofocus&&!c.disabled&&!c.readonly&&(ae.value=!0)}));const re=e.ref(!1),ue=e.computed((()=>c.type===P.PASSWORD)),se=()=>{re.value=!re.value},de=e.computed((()=>c.type===P.TIME||c.type===P.DATETIME_LOCAL||c.type===P.DATE||c.type===P.WEEK||c.type===P.MONTH)),ce=e.computed((()=>c.type===P.NUMBER)),ve=()=>{if(we.value){if(null==C?void 0:C.value)return void(Q.value=Q.value+Number((null==D?void 0:D.value)??1));te.value.stepUp(),oe.value=e.unref(te).value}},pe=()=>{if(we.value){if(null==C?void 0:C.value)return void(Q.value=Q.value-Number((null==D?void 0:D.value)??1));te.value.stepDown(),oe.value=e.unref(te).value}},me=e.computed((()=>c.type===P.SEARCH)),fe=()=>{oe.value=""},{hasIcon:he,hasIconBefore:be,hasIconAfter:ge}=function(t,l){const o=e.computed((()=>Boolean((null==t?void 0:t.value)&&l.value===s.before))),a=e.computed((()=>Boolean((null==t?void 0:t.value)&&l.value===s.after))),n=e.computed((()=>Boolean((null==t?void 0:t.value)&&l.value===u.left))),i=e.computed((()=>Boolean((null==t?void 0:t.value)&&l.value===u.right))),r=e.computed((()=>Boolean((null==t?void 0:t.value)&&l.value===u.top))),d=e.computed((()=>Boolean((null==t?void 0:t.value)&&l.value===u.bottom)));return{hasIcon:e.computed((()=>"string"==typeof(null==t?void 0:t.value)?{name:null==t?void 0:t.value}:null==t?void 0:t.value)),hasIconLeft:n,hasIconRight:i,hasIconTop:r,hasIconBottom:d,hasIconBefore:o,hasIconAfter:a}}(g,S),Se=e.computed((()=>{switch(c.type){case P.COLOR:return{name:V};case P.DATE:case P.DATETIME_LOCAL:case P.WEEK:case P.MONTH:return{name:I};case P.TIME:return{name:O};default:return""}})),{formatted:ye}=function(t,l){const o=e.computed((()=>(e.unref(t)??"").length)),a=e.computed((()=>void 0!==(null==l?void 0:l.lowerLimit)&&o.value<(null==l?void 0:l.lowerLimit)?o.value-l.lowerLimit:void 0!==(null==l?void 0:l.upperLimit)&&o.value<(null==l?void 0:l.upperLimit)?l.upperLimit-o.value:0)),n=e.computed((()=>{if(!1===(null==l?void 0:l.mode))return"";if("limit"===(null==l?void 0:l.mode)&&(null==l?void 0:l.upperLimit))return`${o.value} / ${l.lowerLimit?`${l.lowerLimit}-`:""}${l.upperLimit}`;if("countdown"===(null==l?void 0:l.mode)){if(0===a.value)return;return a}return o.value}));return{length:o,gap:a,formatted:n}}(oe,{mode:k.value,upperLimit:Number(null==x?void 0:x.value),lowerLimit:Number(null==A?void 0:A.value)}),we=e.computed((()=>!c.disabled&&!c.readonly)),ke=e.computed((()=>we.value?c.tabindex:-1)),Le=e.computed((()=>!n(w))),Be=e.computed((()=>!0===B.value||!0!==L.value&&void 0)),{modifiers:Ee}=e.toRefs(c),$e=p("vv-input-text",Ee,e.computed((()=>({valid:L.value,invalid:B.value,loading:E.value,disabled:c.disabled,readonly:c.readonly,"icon-before":be.value,"icon-after":ge.value||!n(Se),floating:c.floating&&!n(c.label),dirty:Le.value,focus:ne.value,"auto-width":c.autoWidth})))),xe=e.computed((()=>{const e=ue.value&&re.value?P.TEXT:!de.value||Le.value||ae.value?(null==C?void 0:C.value)?P.TEXT:c.type:P.TEXT,t={type:e,name:c.name,tabindex:ke.value,disabled:c.disabled,readonly:c.readonly,required:c.required,autocomplete:c.autocomplete,"aria-invalid":Be.value,"aria-describedby":Pe.value?M.value:void 0,"aria-errormessage":Ce.value?M.value:void 0};return e!==P.DATE&&e!==P.MONTH&&e!==P.WEEK&&e!==P.TIME&&e!==P.DATETIME_LOCAL&&e!==P.NUMBER||(t.step=c.step,t.max=void 0!==c.max?String(c.max):void 0,t.min=void 0!==c.min?String(c.min):void 0),e!==P.TEXT&&e!==P.SEARCH&&e!==P.URL&&e!==P.TEL&&e!==P.EMAIL&&e!==P.PASSWORD&&e!==P.NUMBER||(t.placeholder=R.value),e!==P.TEXT&&e!==P.SEARCH&&e!==P.URL&&e!==P.TEL&&e!==P.EMAIL&&e!==P.PASSWORD||(t.minlength=c.minlength,t.maxlength=c.maxlength,t.pattern=c.pattern),e===P.EMAIL&&(t.multiple=c.multiple),t})),Ae=e.computed((()=>({valid:c.valid,invalid:c.invalid,modelValue:c.modelValue,togglePassword:se,stepUp:ve,stepDown:pe,clear:fe}))),{HintSlot:Te,hasHintLabelOrSlot:Pe,hasInvalidLabelOrSlot:Ce,hintSlotScope:De}=function(t,l){const o=e.computed((()=>e.isRef(t)?t.value:t)),a=e.computed((()=>i(o.value.invalidLabel))),n=e.computed((()=>i(o.value.validLabel))),r=e.computed((()=>o.value.loadingLabel)),u=e.computed((()=>o.value.hintLabel)),s=e.computed((()=>Boolean(o.value.loading&&(l.loading||r.value)))),d=e.computed((()=>!s.value&&Boolean(o.value.invalid&&(l.invalid||a.value)))),c=e.computed((()=>!s.value&&!d.value&&Boolean(o.value.valid&&(l.valid||n.value)))),v=e.computed((()=>!s.value&&!d.value&&!c.value&&Boolean(l.hint||u.value))),p=e.computed((()=>d.value||c.value||s.value||v.value)),m=e.computed((()=>({modelValue:o.value.modelValue,valid:o.value.valid,invalid:o.value.invalid,loading:o.value.loading}))),f=e.defineComponent({name:"HintSlot",props:{tag:{type:String,default:"small"}},setup:()=>({isVisible:p,invalidLabel:a,validLabel:n,loadingLabel:r,hintLabel:u,hasInvalidLabelOrSlot:d,hasValidLabelOrSlot:c,hasLoadingLabelOrSlot:s,hasHintLabelOrSlot:v}),render(){var t,l,o,a,n,i,r,u;if(this.isVisible){let s;return this.hasInvalidLabelOrSlot&&(s="alert"),this.hasValidLabelOrSlot&&(s="status"),this.hasLoadingLabelOrSlot?e.h(this.tag,{role:s},(null==(l=(t=this.$slots).loading)?void 0:l.call(t))??this.loadingLabel):this.hasInvalidLabelOrSlot?e.h(this.tag,{role:s},(null==(a=(o=this.$slots).invalid)?void 0:a.call(o))??this.$slots.invalid??this.invalidLabel):this.hasValidLabelOrSlot?e.h(this.tag,{role:s},(null==(i=(n=this.$slots).valid)?void 0:i.call(n))??this.validLabel):e.h(this.tag,{role:s},(null==(u=(r=this.$slots).hint)?void 0:u.call(r))??this.$slots.hint??this.hintLabel)}return null}});return{hasInvalidLabelOrSlot:d,hasHintLabelOrSlot:v,hasValidLabelOrSlot:c,hasLoadingLabelOrSlot:s,hintSlotScope:m,HintSlot:f}}(h,f),Ie=H(P.PASSWORD,c),Oe=H(P.NUMBER,c),Ve=H(P.SEARCH,c),_e=()=>{we.value&&(ae.value=!0)},Ne=e.computed((()=>{if(c.autoWidth)return{width:void 0!==oe.value?`${String(oe.value).length+1}ch`:void 0}})),Me=e=>{switch(e.code){case"ArrowUp":ce.value&&(ve(),e.preventDefault());break;case"ArrowDown":ce.value&&(pe(),e.preventDefault())}d("keydown",e)};return(t,l)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref($e))},[e.unref(y)?(e.openBlock(),e.createElementBlock("label",{key:0,for:e.unref(N),class:"vv-input-text__label"},e.toDisplayString(e.unref(y)),9,U)):e.createCommentVNode("",!0),e.createElementVNode("div",j,[t.$slots.before?(e.openBlock(),e.createElementBlock("div",F,[e.renderSlot(t.$slots,"before",e.normalizeProps(e.guardReactiveProps(e.unref(Ae))))])):e.createCommentVNode("",!0),e.createElementVNode("div",{ref_key:"innerEl",ref:le,class:"vv-input-text__inner",onClick:e.withModifiers(_e,["stop"])},[e.unref(be)?(e.openBlock(),e.createBlock(m,e.mergeProps({key:0,class:"vv-input-text__icon"},e.unref(he)),null,16)):e.createCommentVNode("",!0),e.createElementVNode("input",e.mergeProps({id:e.unref(N),ref_key:"inputEl",ref:te},e.unref(xe),{style:e.unref(Ne),onKeyup:l[0]||(l[0]=e=>d("keyup",e)),onKeydown:Me,onKeypress:l[1]||(l[1]=e=>d("keypress",e))}),null,16,q),(t.unit||t.$slots.unit)&&e.unref(Le)?(e.openBlock(),e.createElementBlock("div",z,[e.renderSlot(t.$slots,"default",e.normalizeProps(e.guardReactiveProps(e.unref(Ae))),(()=>[e.createTextVNode(e.toDisplayString(t.unit),1)]))])):e.createCommentVNode("",!0)],8,W),e.unref(ge)||e.unref(Se)?(e.openBlock(),e.createBlock(m,e.mergeProps({key:1,class:"vv-input-text__icon vv-input-text__icon-after"},e.unref(ge)?e.unref(he):e.unref(Se)),null,16)):e.unref(ue)&&!t.hideActions&&e.unref(we)?(e.openBlock(),e.createBlock(e.unref(Ie),{key:2,onTogglePassword:se})):e.unref(ce)&&!t.hideActions&&e.unref(we)?(e.openBlock(),e.createBlock(e.unref(Oe),{key:3,onStepUp:ve,onStepDown:pe})):e.unref(me)&&!t.hideActions&&e.unref(we)?(e.openBlock(),e.createBlock(e.unref(Ve),{key:4,onClear:fe})):e.createCommentVNode("",!0),t.$slots.after?(e.openBlock(),e.createElementBlock("div",K,[e.renderSlot(t.$slots,"after",e.normalizeProps(e.guardReactiveProps(e.unref(Ae))))])):e.createCommentVNode("",!0),e.unref(k)?(e.openBlock(),e.createElementBlock("span",X,[e.renderSlot(t.$slots,"count",e.normalizeProps(e.guardReactiveProps(e.unref(Ae))),(()=>[e.createTextVNode(e.toDisplayString(e.unref(ye)),1)]))])):e.createCommentVNode("",!0)]),e.createVNode(e.unref(Te),{id:e.unref(M),class:"vv-input-text__hint"},e.createSlots({_:2},[t.$slots.hint?{name:"hint",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"hint",e.normalizeProps(e.guardReactiveProps(e.unref(De))))])),key:"0"}:void 0,t.$slots.loading?{name:"loading",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"loading",e.normalizeProps(e.guardReactiveProps(e.unref(De))))])),key:"1"}:void 0,t.$slots.valid?{name:"valid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"valid",e.normalizeProps(e.guardReactiveProps(e.unref(De))))])),key:"2"}:void 0,t.$slots.invalid?{name:"invalid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"invalid",e.normalizeProps(e.guardReactiveProps(e.unref(De))))])),key:"3"}:void 0]),1032,["id"])],2))}})}));
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue"),require("vue-imask"),require("@iconify/vue"),require("uid"),require("@vueuse/core")):"function"==typeof define&&define.amd?define(["vue","vue-imask","@iconify/vue","uid","@vueuse/core"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VvInputText=t(e.vue,e.vueImask,e.vue$1,e.uid,e.core)}(this,(function(e,t,l,o,a){"use strict";function n(t){return null==(l=e.unref(t))||""===l||Array.isArray(l)&&0===l.length||!(l instanceof Date)&&"object"==typeof l&&0===Object.keys(l).length;var l}function i(e){return Array.isArray(e)?e.filter((e=>{return"string"==typeof(t=e)||t instanceof String;var t})).join(" "):e}const u={prefix:"normal"};var r=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(r||{}),d=(e=>(e.before="before",e.after="after",e))(d||{}),s=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(s||{}),v=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(v||{});const c=Symbol.for("volver");function p(){return e.inject(c)}function f(t,l,o){return e.computed((()=>{const a={[t]:!0},n="string"==typeof(null==l?void 0:l.value)?l.value.split(" "):null==l?void 0:l.value;return n&&Array.isArray(n)&&n.forEach((e=>{e&&(a[`${t}--${e}`]=!0)})),o&&Object.keys(o.value).forEach((l=>{a[`${t}--${l}`]=e.unref(o.value[l])})),a}))}const m=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:{}},u),setup(t){const o=t,a=e.computed((()=>"string"==typeof o.rotate?parseFloat(o.rotate):o.rotate)),n=e.ref(!0),i=p(),{modifiers:u}=e.toRefs(o),r=f("vv-icon",u),d=e.computed((()=>o.provider||(null==i?void 0:i.iconsProvider))),s=e.computed((()=>{const e=o.name??"",t=`@${d.value}:${o.prefix}:${e}`;if(l.iconExists(t))return t;const a=null==i?void 0:i.iconsCollections.find((t=>{const o=`@${d.value}:${t.prefix}:${e}`;return l.iconExists(o)}));return a?`@${d.value}:${a.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),a=(null==t?void 0:t.innerHTML.trim())||"";t&&a&&l.addIcon(`@${d.value}:${o.prefix}:${o.name}`,{body:a,height:t.viewBox.baseVal.height,width:t.viewBox.baseVal.width})}return i&&o.src&&!l.iconExists(`@${d.value}:${o.prefix}:${o.name}`)&&(n.value=!1,i.fetchIcon(o.src).then((e=>{e&&(v(e),n.value=!0)})).catch((e=>{throw new Error(`Error during fetch icon: ${null==e?void 0:e.message}`)}))),o.svg&&v(o.svg),(t,o)=>e.unref(n)?(e.openBlock(),e.createBlock(e.unref(l.Icon),e.mergeProps({key:0,class:e.unref(r)},{inline:t.inline,width:t.width,height:t.height,horizontalFlip:t.horizontalFlip,verticalFlip:t.verticalFlip,flip:t.flip,rotate:e.unref(a),color:t.color,onLoad:t.onLoad,icon:e.unref(s)}),null,16,["class"])):e.createCommentVNode("v-if",!0)}}),h={valid:{type:Boolean,default:!1},validLabel:{type:[String,Array],default:void 0}},b={invalid:{type:Boolean,default:!1},invalidLabel:{type:[String,Array],default:void 0}},y={loading:{type:Boolean,default:!1},loadingLabel:{type:String,default:"Loading..."}},g={disabled:{type:Boolean,default:!1}},S=(Boolean,Boolean,Boolean,{label:{type:[String,Number],default:void 0}}),w={readonly:{type:Boolean,default:!1}},k={modifiers:{type:[String,Array],default:void 0}},L={hintLabel:{type:String,default:""}},E={count:{type:[Boolean,String],default:!1,validator:e=>[!0,!1,"limit","countdown"].includes(e)}},B={debounce:{type:[Number,String],default:void 0}},x={icon:{type:[String,Object],default:void 0},iconPosition:{type:String,default:d.before,validation:e=>Object.values(d).includes(e)}},$={tabindex:{type:[String,Number],default:0}},T={floating:{type:Boolean,default:!1}},A={id:[String,Number]};r.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const P={...{...A,name:{type:String,required:!0}},...{autofocus:{type:Boolean,default:!1}},...{autocomplete:{type:String,default:"off"}},...$,...g,...w,...h,...b,...L,...y,...k,...E,...B,...x,...T,...S,minlength:{type:[String,Number],default:void 0},maxlength:{type:[String,Number],default:void 0},placeholder:{type:String,default:void 0},required:{type:Boolean,default:!1}};s.button,v.button;const C={TEXT:"text",PASSWORD:"password",NUMBER:"number",EMAIL:"email",TEL:"tel",URL:"url",COLOR:"color",SEARCH:"search",DATE:"date",TIME:"time",DATETIME_LOCAL:"datetime-local",MONTH:"month",WEEK:"week"},D="eye-on",I="eye-off",O="calendar",V="time",_="color",N={...P,modelValue:[String,Number],type:{type:String,default:C.TEXT,validator:e=>Object.values(C).includes(e)},min:[Number,Date,String],max:[Number,Date,String],step:{type:[String,Number],default:1},pattern:String,multiple:Boolean,iconShowPassword:{type:String,default:D},iconHidePassword:{type:String,default:I},iconClear:{type:String,default:"close"},labelStepUp:{type:String,default:"Increase value"},labelStepDown:{type:String,default:"Decrease value"},labelShowPassword:{type:String,default:"Show password"},labelHidePassword:{type:String,default:"Hide password"},labelClear:{type:String,default:"Clear"},iMask:{type:Object,default:void 0},masked:{type:String,default:void 0},autoWidth:{type:Boolean,default:!1},hideActions:{type:Boolean,default:!1},unit:{type:String},selectOnFocus:{type:Boolean,default:!1}},M=e.defineComponent({components:{VvIcon:m},props:{disabled:{type:Boolean,default:!1},labelShow:{type:String,default:"Show password"},labelHide:{type:String,default:"Hide password"},iconShow:{type:String,default:D},iconHide:{type:String,default:I}},emits:["toggle-password"],setup(t,{emit:l}){const o=e.ref(!1),a=e.computed((()=>o.value?t.iconHide:t.iconShow));return{active:o,activeIcon:a,onClick:function(e){null==e||e.stopPropagation(),t.disabled||(o.value=!o.value,l("toggle-password",o.value))}}},render(){const t=e.h(m,{name:this.activeIcon,class:"vv-input-text__icon"});return e.h("button",{disabled:this.disabled,class:"vv-input-text__action",ariaLabel:this.active?this.labelHide:this.labelShow,type:"button",onClick:this.onClick},t)}}),R=e.defineComponent({components:{VvIcon:m},props:{disabled:{type:Boolean,default:!1},label:{type:String},mode:{type:String,validator:e=>["up","down"].includes(e),default:"up"}},emits:["step-up","step-down"],setup(t,{emit:l}){const o=e.computed((()=>"up"===t.mode));return{isUp:o,onClick:e=>{null==e||e.stopPropagation(),t.disabled||l(o.value?"step-up":"step-down")}}},render(){return e.h("button",{class:["vv-input-text__action vv-input-text__action-chevron",this.isUp&&"vv-input-text__action-chevron-up"],disabled:this.disabled,ariaLabel:this.label,type:"button",onClick:this.onClick})}}),H=e.defineComponent({components:{VvIcon:m},props:{disabled:{type:Boolean,default:!1},label:{type:String,default:"Clear"},icon:{type:String,default:"close"}},emits:["clear"],setup:(e,{emit:t})=>({onClick:function(l){null==l||l.stopPropagation(),e.disabled||t("clear")}}),render(){const t=e.h(m,{name:this.icon,class:"vv-input-text__icon"});return e.h("button",{disabled:this.disabled,class:"vv-input-text__action",ariaLabel:this.label,type:"button",onClick:this.onClick},t)}});function U(t,l){return{name:"VvInputTextActions",components:{VvIcon:m,VvInputPasswordAction:M,VvInputStepAction:R,VvInputClearAction:H},setup:()=>({isDisabled:e.computed((()=>l.disabled||l.readonly)),labelStepUp:l.labelStepUp,labelStepDown:l.labelStepDown,labelShowPassword:l.labelShowPassword,labelHidePassword:l.labelHidePassword,labelClear:l.labelClear,iconShowPassword:l.iconShowPassword,iconHidePassword:l.iconHidePassword}),render(){let o=null;switch(t){case C.SEARCH:{const{onClear:t}=this.$attrs;o=[e.h(H,{disabled:this.isDisabled,label:this.labelShowPassword,onClear:t})];break}case C.PASSWORD:{const{onTogglePassword:t}=this.$attrs;o=[e.h(M,{disabled:this.isDisabled,onTogglePassword:t,labelShow:this.labelShowPassword,labelHide:this.labelHidePassword,iconShow:this.iconShowPassword,iconHide:this.iconHidePassword})];break}case C.NUMBER:{const{onStepUp:t,onStepDown:a}=this.$attrs;o=[e.h(R,{mode:"up",disabled:this.isDisabled||void 0!==l.max&&l.modelValue===l.max,label:this.labelStepUp,onStepUp:t,onStepDown:a}),e.h(R,{mode:"down",disabled:this.isDisabled||void 0!==l.min&&l.modelValue===l.min,label:this.labelStepDown,onStepUp:t,onStepDown:a})];break}}return Array.isArray(o)?e.h("div",{class:"vv-input-text__actions-group"},o):o}}}const j=["for"],F={class:"vv-input-text__wrapper"},W={key:0,class:"vv-input-text__input-before"},z=["id"],q={key:1,class:"vv-input-text__unit"},K={key:5,class:"vv-input-text__input-after"},X={key:6,class:"vv-input-text__limit"};return e.defineComponent({name:"VvInputText",props:N,emits:["update:modelValue","update:masked","accept","accept:typed","accept:masked","accept:unmasked","complete","complete:typed","complete:masked","complete:unmasked","focus","blur","keyup","keydown","keypress"],setup(l,{expose:u,emit:s}){const v=l,c=s,h=e.useSlots(),b=function(t,l,o){const a=p(),n=e.computed((()=>{var e;if(a&&(null==(e=a.defaults.value)?void 0:e[t]))return a.defaults.value[t]}));return e.computed((()=>{if(void 0===n.value)return o;const e=n.value,t=l,a=o;return Object.keys(t).reduce(((l,o)=>{const n=a[o];if(l[o]=n,o in e){if(Array.isArray(t[o])){const a=t[o];a.length&&a[0]===n&&(l[o]=e[o])}if("function"==typeof t[o]&&(0,t[o])()===n&&(l[o]=e[o]),"object"==typeof t[o]){let a=t[o].default;"function"==typeof a&&(a=a()),"object"==typeof a?JSON.stringify(a)===JSON.stringify(n)&&(l[o]=e[o]):a===n&&(l[o]=e[o])}}return l}),{})}))}("VvInputText",N,v),{id:y,icon:g,iconPosition:S,label:w,modelValue:k,count:L,valid:E,invalid:B,loading:x,debounce:$,maxlength:T,minlength:A,type:P,iMask:D,step:I}=e.toRefs(v),M=(t=>e.computed((()=>String((null==t?void 0:t.value)||o.uid()))))(y),R=e.computed((()=>`${M.value}-hint`)),H=e.computed((()=>v.floating&&n(v.placeholder)?" ":v.placeholder)),J=e.ref(!1),{el:Y,mask:G,typed:Q,masked:Z,unmasked:ee}=t.useIMask(e.computed((()=>(null==D?void 0:D.value)??{mask:/./})),{emit:c,onAccept:()=>{if(J.value){if(c("update:masked",Z.value),P.value===C.NUMBER){if(""===Z.value){if(null===oe.value||void 0===oe.value)return;return void(oe.value=void 0)}return"number"!=typeof Q.value?void(oe.value=Number(Q.value)):void(oe.value=Q.value)}if(P.value===C.DATE){if(Y.value instanceof HTMLInputElement&&"date"===Y.value.type)return void(oe.value=Y.value.value);let e=Q.value;if(null===e||""===e){if(!oe.value)return;return void(oe.value="")}return e instanceof Date||(e=new Date(e)),void(oe.value=`${e.getFullYear()}-${("0"+(e.getMonth()+1)).slice(-2)}-${("0"+e.getDate()).slice(-2)}`)}if(P.value===C.DATETIME_LOCAL){if(Y.value instanceof HTMLInputElement&&"datetime-local"===Y.value.type)return void(oe.value=Y.value.value);let e=Q.value;if(null===e||""===e){if(!oe.value)return;return void(oe.value="")}return Q.value instanceof Date||(e=new Date(e)),void(oe.value=`${e.getFullYear()}-${("0"+(e.getMonth()+1)).slice(-2)}-${("0"+e.getDate()).slice(-2)}T${("0"+e.getHours()).slice(-2)}:${("0"+e.getMinutes()).slice(-2)}`)}(oe.value||ee.value)&&(oe.value=ee.value)}}});e.onMounted((()=>{G.value&&(J.value=!0,Q.value=oe.value??"")})),e.watch((()=>v.modelValue),(e=>{var t;G.value&&(Q.value=e&&(null==(t=null==D?void 0:D.value)?void 0:t.mask)===Date?new Date(e):e??"")})),e.watch((()=>v.masked),(e=>{Z.value=e??""}));const te=Y,le=e.ref();u({$inner:le});const oe=function(t,l,o=0,{getter:a=(e=>e),setter:n=(e=>e)}={}){let i;return"string"==typeof o&&(o=parseInt(o)),e.computed({get:()=>a(null==t?void 0:t.value),set:e=>{i&&clearTimeout(i),i=setTimeout((()=>{l("update:modelValue",n(e))}),o)}})}(k,c,(null==$?void 0:$.value)??0),{focused:ae}=function(t,l){const{focused:o}=a.useFocus(t);return e.watch(o,(o=>{l(o?"focus":"blur",e.unref(t))})),{focused:o}}(te,c),ne=e.computed((()=>ae.value&&!v.disabled&&!v.readonly));e.watch(ne,(e=>{e&&b.value.selectOnFocus&&te.value&&te.value.select()}));const ie=a.useElementVisibility(te);e.watch(ie,(e=>{e&&v.autofocus&&!v.disabled&&!v.readonly&&(ae.value=!0)}));const ue=e.ref(!1),re=e.computed((()=>v.type===C.PASSWORD)),de=()=>{ue.value=!ue.value},se=e.computed((()=>v.type===C.TIME||v.type===C.DATETIME_LOCAL||v.type===C.DATE||v.type===C.WEEK||v.type===C.MONTH)),ve=e.computed((()=>v.type===C.NUMBER)),ce=()=>{if(Se.value){if(null==D?void 0:D.value)return void(Q.value=Q.value+Number((null==I?void 0:I.value)??1));te.value.stepUp(),oe.value=Number(e.unref(te).value)}},pe=()=>{if(Se.value){if(null==D?void 0:D.value)return void(Q.value=Q.value-Number((null==I?void 0:I.value)??1));te.value.stepDown(),oe.value=Number(e.unref(te).value)}},fe=e.computed((()=>v.type===C.SEARCH)),me=()=>{oe.value=""},{hasIconBefore:he,hasIconAfter:be}=function(t,l){const o=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==l?void 0:l.value)===d.before?o.value:void 0)),n=e.computed((()=>(null==l?void 0:l.value)===d.after?o.value:void 0)),i=e.computed((()=>(null==l?void 0:l.value)===r.left?o.value:void 0)),u=e.computed((()=>(null==l?void 0:l.value)===r.right?o.value:void 0)),s=e.computed((()=>(null==l?void 0:l.value)===r.top?o.value:void 0)),v=e.computed((()=>(null==l?void 0:l.value)===r.bottom?o.value:void 0));return{hasIcon:o,hasIconLeft:i,hasIconRight:u,hasIconTop:s,hasIconBottom:v,hasIconBefore:a,hasIconAfter:n}}(g,S),ye=e.computed((()=>{if(void 0!==be.value)return be.value;switch(v.type){case C.COLOR:return{name:_};case C.DATE:case C.DATETIME_LOCAL:case C.WEEK:case C.MONTH:return{name:O};case C.TIME:return{name:V}}})),{formatted:ge}=function(t,l){const o=e.computed((()=>(e.unref(t)??"").length)),a=e.computed((()=>void 0!==(null==l?void 0:l.lowerLimit)&&o.value<(null==l?void 0:l.lowerLimit)?o.value-l.lowerLimit:void 0!==(null==l?void 0:l.upperLimit)&&o.value<(null==l?void 0:l.upperLimit)?l.upperLimit-o.value:0)),n=e.computed((()=>{if(!1===(null==l?void 0:l.mode))return"";if("limit"===(null==l?void 0:l.mode)&&(null==l?void 0:l.upperLimit))return`${o.value} / ${l.lowerLimit?`${l.lowerLimit}-`:""}${l.upperLimit}`;if("countdown"===(null==l?void 0:l.mode)){if(0===a.value)return;return a}return o.value}));return{length:o,gap:a,formatted:n}}(oe,{mode:L.value,upperLimit:Number(null==T?void 0:T.value),lowerLimit:Number(null==A?void 0:A.value)}),Se=e.computed((()=>!v.disabled&&!v.readonly)),we=e.computed((()=>Se.value?v.tabindex:-1)),ke=e.computed((()=>!n(k))),Le=e.computed((()=>!0===B.value||!0!==E.value&&void 0)),{modifiers:Ee}=e.toRefs(v),Be=f("vv-input-text",Ee,e.computed((()=>({valid:E.value,invalid:B.value,loading:x.value,disabled:v.disabled,readonly:v.readonly,"icon-before":void 0!==he.value,"icon-after":void 0!==ye.value,floating:v.floating&&!n(v.label),dirty:ke.value,focus:ne.value,"auto-width":v.autoWidth})))),xe=e.computed((()=>{const e=re.value&&ue.value?C.TEXT:!se.value||ke.value||ae.value?(null==D?void 0:D.value)?C.TEXT:v.type:C.TEXT,t={type:e,name:v.name,tabindex:we.value,disabled:v.disabled,readonly:v.readonly,required:v.required,autocomplete:v.autocomplete,"aria-invalid":Le.value,"aria-describedby":Ae.value?R.value:void 0,"aria-errormessage":Pe.value?R.value:void 0};return e!==C.DATE&&e!==C.MONTH&&e!==C.WEEK&&e!==C.TIME&&e!==C.DATETIME_LOCAL&&e!==C.NUMBER||(t.step=v.step,t.max=void 0!==v.max?String(v.max):void 0,t.min=void 0!==v.min?String(v.min):void 0),e!==C.TEXT&&e!==C.SEARCH&&e!==C.URL&&e!==C.TEL&&e!==C.EMAIL&&e!==C.PASSWORD&&e!==C.NUMBER||(t.placeholder=H.value),e!==C.TEXT&&e!==C.SEARCH&&e!==C.URL&&e!==C.TEL&&e!==C.EMAIL&&e!==C.PASSWORD||(t.minlength=v.minlength,t.maxlength=v.maxlength,t.pattern=v.pattern),e===C.EMAIL&&(t.multiple=v.multiple),t})),$e=e.computed((()=>({valid:v.valid,invalid:v.invalid,modelValue:v.modelValue,togglePassword:de,stepUp:ce,stepDown:pe,clear:me}))),{HintSlot:Te,hasHintLabelOrSlot:Ae,hasInvalidLabelOrSlot:Pe,hintSlotScope:Ce}=function(t,l){const o=e.computed((()=>e.isRef(t)?t.value:t)),a=e.computed((()=>i(o.value.invalidLabel))),n=e.computed((()=>i(o.value.validLabel))),u=e.computed((()=>o.value.loadingLabel)),r=e.computed((()=>o.value.hintLabel)),d=e.computed((()=>Boolean(o.value.loading&&(l.loading||u.value)))),s=e.computed((()=>!d.value&&Boolean(o.value.invalid&&(l.invalid||a.value)))),v=e.computed((()=>!d.value&&!s.value&&Boolean(o.value.valid&&(l.valid||n.value)))),c=e.computed((()=>!d.value&&!s.value&&!v.value&&Boolean(l.hint||r.value))),p=e.computed((()=>s.value||v.value||d.value||c.value)),f=e.computed((()=>({modelValue:o.value.modelValue,valid:o.value.valid,invalid:o.value.invalid,loading:o.value.loading}))),m=e.defineComponent({name:"HintSlot",props:{tag:{type:String,default:"small"}},setup:()=>({isVisible:p,invalidLabel:a,validLabel:n,loadingLabel:u,hintLabel:r,hasInvalidLabelOrSlot:s,hasValidLabelOrSlot:v,hasLoadingLabelOrSlot:d,hasHintLabelOrSlot:c}),render(){var t,l,o,a,n,i,u,r;if(this.isVisible){let d;return this.hasInvalidLabelOrSlot&&(d="alert"),this.hasValidLabelOrSlot&&(d="status"),this.hasLoadingLabelOrSlot?e.h(this.tag,{role:d},(null==(l=(t=this.$slots).loading)?void 0:l.call(t))??this.loadingLabel):this.hasInvalidLabelOrSlot?e.h(this.tag,{role:d},(null==(a=(o=this.$slots).invalid)?void 0:a.call(o))??this.$slots.invalid??this.invalidLabel):this.hasValidLabelOrSlot?e.h(this.tag,{role:d},(null==(i=(n=this.$slots).valid)?void 0:i.call(n))??this.validLabel):e.h(this.tag,{role:d},(null==(r=(u=this.$slots).hint)?void 0:r.call(u))??this.$slots.hint??this.hintLabel)}return null}});return{hasInvalidLabelOrSlot:s,hasHintLabelOrSlot:c,hasValidLabelOrSlot:v,hasLoadingLabelOrSlot:d,hintSlotScope:f,HintSlot:m}}(b,h),De=U(C.PASSWORD,v),Ie=U(C.NUMBER,v),Oe=U(C.SEARCH,v),Ve=()=>{Se.value&&(ae.value=!0)},_e=e.computed((()=>{if(v.autoWidth)return{width:void 0!==oe.value?`${String(oe.value).length+1}ch`:void 0}})),Ne=e=>{switch(e.code){case"ArrowUp":ve.value&&(ce(),e.preventDefault());break;case"ArrowDown":ve.value&&(pe(),e.preventDefault())}c("keydown",e)};return(t,l)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(Be))},[e.unref(w)?(e.openBlock(),e.createElementBlock("label",{key:0,for:e.unref(M),class:"vv-input-text__label"},e.toDisplayString(e.unref(w)),9,j)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",F,[t.$slots.before?(e.openBlock(),e.createElementBlock("div",W,[e.renderSlot(t.$slots,"before",e.normalizeProps(e.guardReactiveProps(e.unref($e))))])):e.createCommentVNode("v-if",!0),e.createElementVNode("div",{ref_key:"innerEl",ref:le,class:"vv-input-text__inner",onClick:e.withModifiers(Ve,["stop"])},[e.unref(he)?(e.openBlock(),e.createBlock(m,e.mergeProps({key:0},e.unref(he),{class:"vv-input-text__icon"}),null,16)):e.createCommentVNode("v-if",!0),e.createElementVNode("input",e.mergeProps({id:e.unref(M),ref_key:"inputEl",ref:te},e.unref(xe),{style:e.unref(_e),onKeyup:l[0]||(l[0]=e=>c("keyup",e)),onKeydown:Ne,onKeypress:l[1]||(l[1]=e=>c("keypress",e))}),null,16,z),(t.unit||t.$slots.unit)&&e.unref(ke)?(e.openBlock(),e.createElementBlock("div",q,[e.renderSlot(t.$slots,"default",e.normalizeProps(e.guardReactiveProps(e.unref($e))),(()=>[e.createTextVNode(e.toDisplayString(t.unit),1)]))])):e.createCommentVNode("v-if",!0)],512),e.unref(ye)?(e.openBlock(),e.createBlock(m,e.mergeProps({key:1},e.unref(ye),{class:"vv-input-text__icon vv-input-text__icon-after"}),null,16)):e.unref(re)&&!t.hideActions&&e.unref(Se)?(e.openBlock(),e.createBlock(e.unref(De),{key:2,onTogglePassword:de})):e.unref(ve)&&!t.hideActions&&e.unref(Se)?(e.openBlock(),e.createBlock(e.unref(Ie),{key:3,onStepUp:ce,onStepDown:pe})):e.unref(fe)&&!t.hideActions&&e.unref(Se)?(e.openBlock(),e.createBlock(e.unref(Oe),{key:4,onClear:me})):e.createCommentVNode("v-if",!0),t.$slots.after?(e.openBlock(),e.createElementBlock("div",K,[e.renderSlot(t.$slots,"after",e.normalizeProps(e.guardReactiveProps(e.unref($e))))])):e.createCommentVNode("v-if",!0),e.unref(L)?(e.openBlock(),e.createElementBlock("span",X,[e.renderSlot(t.$slots,"count",e.normalizeProps(e.guardReactiveProps(e.unref($e))),(()=>[e.createTextVNode(e.toDisplayString(e.unref(ge)),1)]))])):e.createCommentVNode("v-if",!0)]),e.createVNode(e.unref(Te),{id:e.unref(R),class:"vv-input-text__hint"},e.createSlots({_:2},[t.$slots.hint?{name:"hint",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"hint",e.normalizeProps(e.guardReactiveProps(e.unref(Ce))))])),key:"0"}:void 0,t.$slots.loading?{name:"loading",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"loading",e.normalizeProps(e.guardReactiveProps(e.unref(Ce))))])),key:"1"}:void 0,t.$slots.valid?{name:"valid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"valid",e.normalizeProps(e.guardReactiveProps(e.unref(Ce))))])),key:"2"}:void 0,t.$slots.invalid?{name:"invalid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"invalid",e.normalizeProps(e.guardReactiveProps(e.unref(Ce))))])),key:"3"}:void 0]),1032,["id"])],2))}})}));
|
|
@@ -68,28 +68,56 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
68
68
|
type: BooleanConstructor;
|
|
69
69
|
default: boolean;
|
|
70
70
|
};
|
|
71
|
-
minlength:
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
71
|
+
minlength: {
|
|
72
|
+
type: (StringConstructor | NumberConstructor)[];
|
|
73
|
+
default: undefined;
|
|
74
|
+
};
|
|
75
|
+
maxlength: {
|
|
76
|
+
type: (StringConstructor | NumberConstructor)[];
|
|
77
|
+
default: undefined;
|
|
78
|
+
};
|
|
79
|
+
placeholder: {
|
|
80
|
+
type: StringConstructor;
|
|
81
|
+
default: undefined;
|
|
82
|
+
};
|
|
83
|
+
required: {
|
|
84
|
+
type: BooleanConstructor;
|
|
85
|
+
default: boolean;
|
|
86
|
+
};
|
|
87
|
+
label: {
|
|
88
|
+
type: (StringConstructor | NumberConstructor)[];
|
|
89
|
+
default: undefined;
|
|
90
|
+
};
|
|
91
|
+
floating: {
|
|
92
|
+
type: BooleanConstructor;
|
|
93
|
+
default: boolean;
|
|
94
|
+
};
|
|
77
95
|
icon: {
|
|
78
|
-
type:
|
|
96
|
+
type: globalThis.PropType<string | import("../VvIcon").VvIconProps>;
|
|
97
|
+
default: undefined;
|
|
79
98
|
};
|
|
80
99
|
iconPosition: {
|
|
81
100
|
type: globalThis.PropType<"before" | "after">;
|
|
82
101
|
default: import("../../constants").Position;
|
|
83
102
|
validation: (value: import("../../constants").Position) => boolean;
|
|
84
103
|
};
|
|
85
|
-
debounce:
|
|
104
|
+
debounce: {
|
|
105
|
+
type: (StringConstructor | NumberConstructor)[];
|
|
106
|
+
default: undefined;
|
|
107
|
+
};
|
|
86
108
|
count: {
|
|
87
|
-
type: (
|
|
109
|
+
type: (BooleanConstructor | StringConstructor)[];
|
|
88
110
|
default: boolean;
|
|
89
111
|
validator: (value: string) => boolean;
|
|
90
112
|
};
|
|
91
|
-
modifiers:
|
|
92
|
-
|
|
113
|
+
modifiers: {
|
|
114
|
+
type: globalThis.PropType<string | string[]>;
|
|
115
|
+
default: undefined;
|
|
116
|
+
};
|
|
117
|
+
loading: {
|
|
118
|
+
type: BooleanConstructor;
|
|
119
|
+
default: boolean;
|
|
120
|
+
};
|
|
93
121
|
loadingLabel: {
|
|
94
122
|
type: StringConstructor;
|
|
95
123
|
default: string;
|
|
@@ -98,12 +126,30 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
98
126
|
type: StringConstructor;
|
|
99
127
|
default: string;
|
|
100
128
|
};
|
|
101
|
-
invalid:
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
129
|
+
invalid: {
|
|
130
|
+
type: BooleanConstructor;
|
|
131
|
+
default: boolean;
|
|
132
|
+
};
|
|
133
|
+
invalidLabel: {
|
|
134
|
+
type: (ArrayConstructor | StringConstructor)[];
|
|
135
|
+
default: undefined;
|
|
136
|
+
};
|
|
137
|
+
valid: {
|
|
138
|
+
type: BooleanConstructor;
|
|
139
|
+
default: boolean;
|
|
140
|
+
};
|
|
141
|
+
validLabel: {
|
|
142
|
+
type: (ArrayConstructor | StringConstructor)[];
|
|
143
|
+
default: undefined;
|
|
144
|
+
};
|
|
145
|
+
readonly: {
|
|
146
|
+
type: BooleanConstructor;
|
|
147
|
+
default: boolean;
|
|
148
|
+
};
|
|
149
|
+
disabled: {
|
|
150
|
+
type: BooleanConstructor;
|
|
151
|
+
default: boolean;
|
|
152
|
+
};
|
|
107
153
|
tabindex: {
|
|
108
154
|
type: (StringConstructor | NumberConstructor)[];
|
|
109
155
|
default: number;
|
|
@@ -112,7 +158,10 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
112
158
|
type: StringConstructor;
|
|
113
159
|
default: string;
|
|
114
160
|
};
|
|
115
|
-
autofocus:
|
|
161
|
+
autofocus: {
|
|
162
|
+
type: BooleanConstructor;
|
|
163
|
+
default: boolean;
|
|
164
|
+
};
|
|
116
165
|
name: {
|
|
117
166
|
type: StringConstructor;
|
|
118
167
|
required: boolean;
|
|
@@ -120,7 +169,9 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
120
169
|
id: (StringConstructor | NumberConstructor)[];
|
|
121
170
|
}, {
|
|
122
171
|
$inner: globalThis.Ref<any>;
|
|
123
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin,
|
|
172
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
173
|
+
[x: string]: (...args: any[]) => void;
|
|
174
|
+
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<globalThis.ExtractPropTypes<{
|
|
124
175
|
modelValue: (StringConstructor | NumberConstructor)[];
|
|
125
176
|
type: {
|
|
126
177
|
type: globalThis.PropType<import("../VvInputText").InputType>;
|
|
@@ -190,28 +241,56 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
190
241
|
type: BooleanConstructor;
|
|
191
242
|
default: boolean;
|
|
192
243
|
};
|
|
193
|
-
minlength:
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
244
|
+
minlength: {
|
|
245
|
+
type: (StringConstructor | NumberConstructor)[];
|
|
246
|
+
default: undefined;
|
|
247
|
+
};
|
|
248
|
+
maxlength: {
|
|
249
|
+
type: (StringConstructor | NumberConstructor)[];
|
|
250
|
+
default: undefined;
|
|
251
|
+
};
|
|
252
|
+
placeholder: {
|
|
253
|
+
type: StringConstructor;
|
|
254
|
+
default: undefined;
|
|
255
|
+
};
|
|
256
|
+
required: {
|
|
257
|
+
type: BooleanConstructor;
|
|
258
|
+
default: boolean;
|
|
259
|
+
};
|
|
260
|
+
label: {
|
|
261
|
+
type: (StringConstructor | NumberConstructor)[];
|
|
262
|
+
default: undefined;
|
|
263
|
+
};
|
|
264
|
+
floating: {
|
|
265
|
+
type: BooleanConstructor;
|
|
266
|
+
default: boolean;
|
|
267
|
+
};
|
|
199
268
|
icon: {
|
|
200
|
-
type:
|
|
269
|
+
type: globalThis.PropType<string | import("../VvIcon").VvIconProps>;
|
|
270
|
+
default: undefined;
|
|
201
271
|
};
|
|
202
272
|
iconPosition: {
|
|
203
273
|
type: globalThis.PropType<"before" | "after">;
|
|
204
274
|
default: import("../../constants").Position;
|
|
205
275
|
validation: (value: import("../../constants").Position) => boolean;
|
|
206
276
|
};
|
|
207
|
-
debounce:
|
|
277
|
+
debounce: {
|
|
278
|
+
type: (StringConstructor | NumberConstructor)[];
|
|
279
|
+
default: undefined;
|
|
280
|
+
};
|
|
208
281
|
count: {
|
|
209
|
-
type: (
|
|
282
|
+
type: (BooleanConstructor | StringConstructor)[];
|
|
210
283
|
default: boolean;
|
|
211
284
|
validator: (value: string) => boolean;
|
|
212
285
|
};
|
|
213
|
-
modifiers:
|
|
214
|
-
|
|
286
|
+
modifiers: {
|
|
287
|
+
type: globalThis.PropType<string | string[]>;
|
|
288
|
+
default: undefined;
|
|
289
|
+
};
|
|
290
|
+
loading: {
|
|
291
|
+
type: BooleanConstructor;
|
|
292
|
+
default: boolean;
|
|
293
|
+
};
|
|
215
294
|
loadingLabel: {
|
|
216
295
|
type: StringConstructor;
|
|
217
296
|
default: string;
|
|
@@ -220,12 +299,30 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
220
299
|
type: StringConstructor;
|
|
221
300
|
default: string;
|
|
222
301
|
};
|
|
223
|
-
invalid:
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
302
|
+
invalid: {
|
|
303
|
+
type: BooleanConstructor;
|
|
304
|
+
default: boolean;
|
|
305
|
+
};
|
|
306
|
+
invalidLabel: {
|
|
307
|
+
type: (ArrayConstructor | StringConstructor)[];
|
|
308
|
+
default: undefined;
|
|
309
|
+
};
|
|
310
|
+
valid: {
|
|
311
|
+
type: BooleanConstructor;
|
|
312
|
+
default: boolean;
|
|
313
|
+
};
|
|
314
|
+
validLabel: {
|
|
315
|
+
type: (ArrayConstructor | StringConstructor)[];
|
|
316
|
+
default: undefined;
|
|
317
|
+
};
|
|
318
|
+
readonly: {
|
|
319
|
+
type: BooleanConstructor;
|
|
320
|
+
default: boolean;
|
|
321
|
+
};
|
|
322
|
+
disabled: {
|
|
323
|
+
type: BooleanConstructor;
|
|
324
|
+
default: boolean;
|
|
325
|
+
};
|
|
229
326
|
tabindex: {
|
|
230
327
|
type: (StringConstructor | NumberConstructor)[];
|
|
231
328
|
default: number;
|
|
@@ -234,30 +331,37 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
234
331
|
type: StringConstructor;
|
|
235
332
|
default: string;
|
|
236
333
|
};
|
|
237
|
-
autofocus:
|
|
334
|
+
autofocus: {
|
|
335
|
+
type: BooleanConstructor;
|
|
336
|
+
default: boolean;
|
|
337
|
+
};
|
|
238
338
|
name: {
|
|
239
339
|
type: StringConstructor;
|
|
240
340
|
required: boolean;
|
|
241
341
|
};
|
|
242
342
|
id: (StringConstructor | NumberConstructor)[];
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
}, {
|
|
343
|
+
}>>, {
|
|
344
|
+
readonly: boolean;
|
|
246
345
|
disabled: boolean;
|
|
346
|
+
valid: boolean;
|
|
347
|
+
invalid: boolean;
|
|
348
|
+
multiple: boolean;
|
|
349
|
+
modifiers: string | string[];
|
|
247
350
|
floating: boolean;
|
|
351
|
+
label: string | number;
|
|
248
352
|
type: import("../VvInputText").InputType;
|
|
249
|
-
tabindex: string | number;
|
|
250
353
|
required: boolean;
|
|
354
|
+
icon: string | import("../VvIcon").VvIconProps;
|
|
251
355
|
iconPosition: "before" | "after";
|
|
252
|
-
autofocus: boolean;
|
|
253
356
|
loading: boolean;
|
|
254
357
|
loadingLabel: string;
|
|
255
|
-
multiple: boolean;
|
|
256
|
-
readonly: boolean;
|
|
257
358
|
hintLabel: string;
|
|
258
|
-
|
|
259
|
-
|
|
359
|
+
invalidLabel: string | unknown[];
|
|
360
|
+
validLabel: string | unknown[];
|
|
361
|
+
tabindex: string | number;
|
|
362
|
+
placeholder: string;
|
|
260
363
|
autocomplete: string;
|
|
364
|
+
autofocus: boolean;
|
|
261
365
|
step: string | number;
|
|
262
366
|
iconShowPassword: string;
|
|
263
367
|
iconHidePassword: string;
|
|
@@ -272,6 +376,9 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
272
376
|
autoWidth: boolean;
|
|
273
377
|
hideActions: boolean;
|
|
274
378
|
selectOnFocus: boolean;
|
|
379
|
+
minlength: string | number;
|
|
380
|
+
maxlength: string | number;
|
|
381
|
+
debounce: string | number;
|
|
275
382
|
count: string | boolean;
|
|
276
383
|
}, {}>, {
|
|
277
384
|
before?(_: {
|
|
@@ -174,28 +174,58 @@ export declare const VvInputTextProps: {
|
|
|
174
174
|
type: BooleanConstructor;
|
|
175
175
|
default: boolean;
|
|
176
176
|
};
|
|
177
|
-
minlength:
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
177
|
+
minlength: {
|
|
178
|
+
type: (StringConstructor | NumberConstructor)[];
|
|
179
|
+
default: undefined;
|
|
180
|
+
};
|
|
181
|
+
maxlength: {
|
|
182
|
+
type: (StringConstructor | NumberConstructor)[];
|
|
183
|
+
default: undefined;
|
|
184
|
+
};
|
|
185
|
+
placeholder: {
|
|
186
|
+
type: StringConstructor;
|
|
187
|
+
default: undefined;
|
|
188
|
+
};
|
|
189
|
+
required: {
|
|
190
|
+
type: BooleanConstructor;
|
|
191
|
+
default: boolean;
|
|
192
|
+
};
|
|
193
|
+
label: {
|
|
194
|
+
type: (StringConstructor | NumberConstructor)[];
|
|
195
|
+
default: undefined;
|
|
196
|
+
};
|
|
197
|
+
floating: {
|
|
198
|
+
type: BooleanConstructor;
|
|
199
|
+
default: boolean;
|
|
200
|
+
};
|
|
183
201
|
icon: {
|
|
184
|
-
type:
|
|
202
|
+
type: PropType<string | import("../VvIcon").VvIconProps>;
|
|
203
|
+
default: undefined;
|
|
185
204
|
};
|
|
186
205
|
iconPosition: {
|
|
187
206
|
type: PropType<"before" | "after">;
|
|
188
207
|
default: import("../../constants").Position;
|
|
189
208
|
validation: (value: import("../../constants").Position) => boolean;
|
|
190
209
|
};
|
|
191
|
-
debounce:
|
|
210
|
+
debounce: {
|
|
211
|
+
type: (StringConstructor | NumberConstructor)[];
|
|
212
|
+
default: undefined;
|
|
213
|
+
}; /**
|
|
214
|
+
* Hide type number, password and search actions
|
|
215
|
+
*/
|
|
192
216
|
count: {
|
|
193
|
-
type: (
|
|
217
|
+
type: (BooleanConstructor | StringConstructor)[];
|
|
194
218
|
default: boolean;
|
|
195
219
|
validator: (value: string) => boolean;
|
|
196
220
|
};
|
|
197
|
-
modifiers:
|
|
198
|
-
|
|
221
|
+
modifiers: {
|
|
222
|
+
type: PropType<string | string[]>;
|
|
223
|
+
default: undefined;
|
|
224
|
+
};
|
|
225
|
+
loading: {
|
|
226
|
+
type: BooleanConstructor;
|
|
227
|
+
default: boolean;
|
|
228
|
+
};
|
|
199
229
|
loadingLabel: {
|
|
200
230
|
type: StringConstructor;
|
|
201
231
|
default: string;
|
|
@@ -204,12 +234,30 @@ export declare const VvInputTextProps: {
|
|
|
204
234
|
type: StringConstructor;
|
|
205
235
|
default: string;
|
|
206
236
|
};
|
|
207
|
-
invalid:
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
237
|
+
invalid: {
|
|
238
|
+
type: BooleanConstructor;
|
|
239
|
+
default: boolean;
|
|
240
|
+
};
|
|
241
|
+
invalidLabel: {
|
|
242
|
+
type: (ArrayConstructor | StringConstructor)[];
|
|
243
|
+
default: undefined;
|
|
244
|
+
};
|
|
245
|
+
valid: {
|
|
246
|
+
type: BooleanConstructor;
|
|
247
|
+
default: boolean;
|
|
248
|
+
};
|
|
249
|
+
validLabel: {
|
|
250
|
+
type: (ArrayConstructor | StringConstructor)[];
|
|
251
|
+
default: undefined;
|
|
252
|
+
};
|
|
253
|
+
readonly: {
|
|
254
|
+
type: BooleanConstructor;
|
|
255
|
+
default: boolean;
|
|
256
|
+
};
|
|
257
|
+
disabled: {
|
|
258
|
+
type: BooleanConstructor;
|
|
259
|
+
default: boolean;
|
|
260
|
+
};
|
|
213
261
|
tabindex: {
|
|
214
262
|
type: (StringConstructor | NumberConstructor)[];
|
|
215
263
|
default: number;
|
|
@@ -218,7 +266,10 @@ export declare const VvInputTextProps: {
|
|
|
218
266
|
type: StringConstructor;
|
|
219
267
|
default: string;
|
|
220
268
|
};
|
|
221
|
-
autofocus:
|
|
269
|
+
autofocus: {
|
|
270
|
+
type: BooleanConstructor;
|
|
271
|
+
default: boolean;
|
|
272
|
+
};
|
|
222
273
|
name: {
|
|
223
274
|
type: StringConstructor;
|
|
224
275
|
required: boolean;
|