@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("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="eye-on",r="eye-off",d="calendar",s="time",c="color",v="close",p={prefix:"normal"};var f=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(f||{}),m=(e=>(e.before="before",e.after="after",e))(m||{}),h=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(h||{}),b=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(b||{});const y=Symbol.for("volver");function g(){return e.inject(y)}function S(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 w=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:{}},p),setup(t){const o=t,a=e.computed((()=>"string"==typeof o.rotate?parseFloat(o.rotate):o.rotate)),n=e.ref(!0),i=g(),{modifiers:u}=e.toRefs(o),r=S("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 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(`@${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&&(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(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)}}),k={valid:{type:Boolean,default:!1},validLabel:{type:[String,Array],default:void 0}},L={invalid:{type:Boolean,default:!1},invalidLabel:{type:[String,Array],default:void 0}},E={loading:{type:Boolean,default:!1},loadingLabel:{type:String,default:"Loading..."}},B={disabled:{type:Boolean,default:!1}},x=(Boolean,Boolean,Boolean,{label:{type:[String,Number],default:void 0}}),$={readonly:{type:Boolean,default:!1}},C={modifiers:{type:[String,Array],default:void 0}},T={hintLabel:{type:String,default:""}},A={count:{type:[Boolean,String],default:!1,validator:e=>[!0,!1,"limit","countdown"].includes(e)}},I={debounce:{type:[Number,String],default:void 0}},P={icon:{type:[String,Object],default:void 0},iconPosition:{type:String,default:m.before,validation:e=>Object.values(m).includes(e)}},O={tabindex:{type:[String,Number],default:0}},D={floating:{type:Boolean,default:!1}},V={id:[String,Number]};f.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const N={...{...V,name:{type:String,required:!0}},...{autofocus:{type:Boolean,default:!1}},...{autocomplete:{type:String,default:"off"}},...O,...B,...$,...k,...L,...T,...E,...C,...A,...I,...P,...D,...x,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}};h.button,b.button;const _={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"},M={...N,modelValue:[String,Number],type:{type:String,default:_.TEXT,validator:e=>Object.values(_).includes(e)},min:[Number,Date,String],max:[Number,Date,String],step:{type:[String,Number],default:1},pattern:String,multiple:Boolean,iconShowPassword:{type:[String,Object],default:u},iconHidePassword:{type:[String,Object],default:r},iconClear:{type:[String,Object],default:v},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}};function R(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)===m.before?o.value:void 0)),n=e.computed((()=>(null==l?void 0:l.value)===m.after?o.value:void 0)),i=e.computed((()=>(null==l?void 0:l.value)===f.left?o.value:void 0)),u=e.computed((()=>(null==l?void 0:l.value)===f.right?o.value:void 0)),r=e.computed((()=>(null==l?void 0:l.value)===f.top?o.value:void 0)),d=e.computed((()=>(null==l?void 0:l.value)===f.bottom?o.value:void 0));return{hasIcon:o,hasIconLeft:i,hasIconRight:u,hasIconTop:r,hasIconBottom:d,hasIconBefore:a,hasIconAfter:n}}const H=e.defineComponent({components:{VvIcon:w},props:{disabled:{type:Boolean,default:!1},labelShow:{type:String,default:"Show password"},labelHide:{type:String,default:"Hide password"},iconShow:{type:[String,Object],default:u},iconHide:{type:[String,Object],default:r}},emits:["toggle-password"],setup(t,{emit:l}){const o=e.ref(!1),a=e.computed((()=>o.value?t.iconHide:t.iconShow)),{hasIcon:n}=R(a);return{active:o,activeIcon:a,hasIcon:n,onClick:function(e){null==e||e.stopPropagation(),t.disabled||(o.value=!o.value,l("toggle-password",o.value))}}},render(){const t=this.hasIcon?e.h(w,{...this.hasIcon,class:"vv-input-text__icon"}):void 0;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)}}),U=e.defineComponent({components:{VvIcon:w},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})}}),j=e.defineComponent({components:{VvIcon:w},props:{disabled:{type:Boolean,default:!1},label:{type:String,default:"Clear"},icon:{type:[String,Object],default:"close"}},emits:["clear"],setup(t,{emit:l}){const{hasIcon:o}=R(e.computed((()=>t.icon)));return{hasIcon:o,onClick:function(e){null==e||e.stopPropagation(),t.disabled||l("clear")}}},render(){const t=this.hasIcon?e.h(w,{...this.hasIcon,class:"vv-input-text__icon"}):void 0;return e.h("button",{disabled:this.disabled,class:"vv-input-text__action",ariaLabel:this.label,type:"button",onClick:this.onClick},t)}});function F(t,l){return{name:"VvInputTextActions",components:{VvIcon:w,VvInputPasswordAction:H,VvInputStepAction:U,VvInputClearAction:j},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 _.SEARCH:{const{onClear:t}=this.$attrs;o=[e.h(j,{disabled:this.isDisabled,label:this.labelShowPassword,onClear:t})];break}case _.PASSWORD:{const{onTogglePassword:t}=this.$attrs;o=[e.h(H,{disabled:this.isDisabled,onTogglePassword:t,labelShow:this.labelShowPassword,labelHide:this.labelHidePassword,iconShow:this.iconShowPassword,iconHide:this.iconHidePassword})];break}case _.NUMBER:{const{onStepUp:t,onStepDown:a}=this.$attrs;o=[e.h(U,{mode:"up",disabled:this.isDisabled||void 0!==l.max&&l.modelValue===l.max,label:this.labelStepUp,onStepUp:t,onStepDown:a}),e.h(U,{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 W=["for"],z={class:"vv-input-text__wrapper"},q={key:0,class:"vv-input-text__input-before"},K=["id"],X={key:1,class:"vv-input-text__unit"},J={key:5,class:"vv-input-text__input-after"},Y={key:6,class:"vv-input-text__limit"};return e.defineComponent({name:"VvInputText",props:M,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:r}){const v=l,p=r,f=e.useSlots(),m=function(t,l,o){const a=g(),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",M,v),{id:h,icon:b,iconPosition:y,label:k,modelValue:L,count:E,valid:B,invalid:x,loading:$,debounce:C,maxlength:T,minlength:A,type:I,iMask:P,step:O}=e.toRefs(v),D=(t=>e.computed((()=>String((null==t?void 0:t.value)||o.uid()))))(h),V=e.computed((()=>`${D.value}-hint`)),N=e.computed((()=>v.floating&&n(v.placeholder)?" ":v.placeholder)),H=e.ref(!1),{el:U,mask:j,typed:G,masked:Q,unmasked:Z}=t.useIMask(e.computed((()=>(null==P?void 0:P.value)??{mask:/./})),{emit:p,onAccept:()=>{if(H.value){if(p("update:masked",Q.value),I.value===_.NUMBER){if(""===Q.value){if(null===le.value||void 0===le.value)return;return void(le.value=void 0)}return"number"!=typeof G.value?void(le.value=Number(G.value)):void(le.value=G.value)}if(I.value===_.DATE){if(U.value instanceof HTMLInputElement&&"date"===U.value.type)return void(le.value=U.value.value);let e=G.value;if(null===e||""===e){if(!le.value)return;return void(le.value="")}return e instanceof Date||(e=new Date(e)),void(le.value=`${e.getFullYear()}-${("0"+(e.getMonth()+1)).slice(-2)}-${("0"+e.getDate()).slice(-2)}`)}if(I.value===_.DATETIME_LOCAL){if(U.value instanceof HTMLInputElement&&"datetime-local"===U.value.type)return void(le.value=U.value.value);let e=G.value;if(null===e||""===e){if(!le.value)return;return void(le.value="")}return G.value instanceof Date||(e=new Date(e)),void(le.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)}`)}(le.value||Z.value)&&(le.value=Z.value)}}});e.onMounted((()=>{j.value&&(H.value=!0,G.value=le.value??"")})),e.watch((()=>v.modelValue),(e=>{var t;j.value&&(G.value=e&&(null==(t=null==P?void 0:P.value)?void 0:t.mask)===Date?new Date(e):e??"")})),e.watch((()=>v.masked),(e=>{Q.value=e??""}));const ee=U,te=e.ref();u({$inner:te});const le=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)}})}(L,p,(null==C?void 0:C.value)??0),{focused:oe}=function(t,l){const{focused:o}=a.useFocus(t);return e.watch(o,(o=>{l(o?"focus":"blur",e.unref(t))})),{focused:o}}(ee,p),ae=e.computed((()=>oe.value&&!v.disabled&&!v.readonly));e.watch(ae,(e=>{e&&m.value.selectOnFocus&&ee.value&&ee.value.select()}));const ne=a.useElementVisibility(ee);e.watch(ne,(e=>{e&&v.autofocus&&!v.disabled&&!v.readonly&&(oe.value=!0)}));const ie=e.ref(!1),ue=e.computed((()=>v.type===_.PASSWORD)),re=()=>{ie.value=!ie.value},de=e.computed((()=>v.type===_.TIME||v.type===_.DATETIME_LOCAL||v.type===_.DATE||v.type===_.WEEK||v.type===_.MONTH)),se=e.computed((()=>v.type===_.NUMBER)),ce=()=>{if(ge.value){if(null==P?void 0:P.value)return void(G.value=G.value+Number((null==O?void 0:O.value)??1));ee.value.stepUp(),le.value=Number(e.unref(ee).value)}},ve=()=>{if(ge.value){if(null==P?void 0:P.value)return void(G.value=G.value-Number((null==O?void 0:O.value)??1));ee.value.stepDown(),le.value=Number(e.unref(ee).value)}},pe=e.computed((()=>v.type===_.SEARCH)),fe=()=>{le.value=""},{hasIconBefore:me,hasIconAfter:he}=R(b,y),be=e.computed((()=>{if(void 0!==he.value)return he.value;switch(v.type){case _.COLOR:return{name:c};case _.DATE:case _.DATETIME_LOCAL:case _.WEEK:case _.MONTH:return{name:d};case _.TIME:return{name:s}}})),{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}}(le,{mode:E.value,upperLimit:Number(null==T?void 0:T.value),lowerLimit:Number(null==A?void 0:A.value)}),ge=e.computed((()=>!v.disabled&&!v.readonly)),Se=e.computed((()=>ge.value?v.tabindex:-1)),we=e.computed((()=>!n(L))),ke=e.computed((()=>!0===x.value||!0!==B.value&&void 0)),{modifiers:Le}=e.toRefs(v),Ee=S("vv-input-text",Le,e.computed((()=>({valid:B.value,invalid:x.value,loading:$.value,disabled:v.disabled,readonly:v.readonly,"icon-before":!!me.value,"icon-after":!!be.value,floating:v.floating&&!n(v.label),dirty:we.value,focus:ae.value,"auto-width":v.autoWidth})))),Be=e.computed((()=>{const e=ue.value&&ie.value?_.TEXT:!de.value||we.value||oe.value?(null==P?void 0:P.value)?_.TEXT:v.type:_.TEXT,t={type:e,name:v.name,tabindex:Se.value,disabled:v.disabled,readonly:v.readonly,required:v.required,autocomplete:v.autocomplete,"aria-invalid":ke.value,"aria-describedby":Ce.value?V.value:void 0,"aria-errormessage":Te.value?V.value:void 0};return e!==_.DATE&&e!==_.MONTH&&e!==_.WEEK&&e!==_.TIME&&e!==_.DATETIME_LOCAL&&e!==_.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!==_.TEXT&&e!==_.SEARCH&&e!==_.URL&&e!==_.TEL&&e!==_.EMAIL&&e!==_.PASSWORD&&e!==_.NUMBER||(t.placeholder=N.value),e!==_.TEXT&&e!==_.SEARCH&&e!==_.URL&&e!==_.TEL&&e!==_.EMAIL&&e!==_.PASSWORD||(t.minlength=v.minlength,t.maxlength=v.maxlength,t.pattern=v.pattern),e===_.EMAIL&&(t.multiple=v.multiple),t})),xe=e.computed((()=>({valid:v.valid,invalid:v.invalid,modelValue:v.modelValue,togglePassword:re,stepUp:ce,stepDown:ve,clear:fe}))),{HintSlot:$e,hasHintLabelOrSlot:Ce,hasInvalidLabelOrSlot:Te,hintSlotScope:Ae}=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)))),c=e.computed((()=>!d.value&&!s.value&&Boolean(o.value.valid&&(l.valid||n.value)))),v=e.computed((()=>!d.value&&!s.value&&!c.value&&Boolean(l.hint||r.value))),p=e.computed((()=>s.value||c.value||d.value||v.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:c,hasLoadingLabelOrSlot:d,hasHintLabelOrSlot:v}),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:v,hasValidLabelOrSlot:c,hasLoadingLabelOrSlot:d,hintSlotScope:f,HintSlot:m}}(m,f),Ie=F(_.PASSWORD,v),Pe=F(_.NUMBER,v),Oe=F(_.SEARCH,v),De=()=>{ge.value&&(oe.value=!0)},Ve=e.computed((()=>{if(v.autoWidth)return{width:void 0!==le.value?`${String(le.value).length+1}ch`:void 0}})),Ne=e=>{switch(e.code){case"ArrowUp":se.value&&(ce(),e.preventDefault());break;case"ArrowDown":se.value&&(ve(),e.preventDefault())}p("keydown",e)};return(t,l)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(Ee))},[e.unref(k)?(e.openBlock(),e.createElementBlock("label",{key:0,for:e.unref(D),class:"vv-input-text__label"},e.toDisplayString(e.unref(k)),9,W)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",z,[t.$slots.before?(e.openBlock(),e.createElementBlock("div",q,[e.createCommentVNode(" @slot Slot before input icon "),e.renderSlot(t.$slots,"before",e.normalizeProps(e.guardReactiveProps(e.unref(xe))))])):e.createCommentVNode("v-if",!0),e.createElementVNode("div",{ref_key:"innerEl",ref:te,class:"vv-input-text__inner",onClick:e.withModifiers(De,["stop"])},[e.unref(me)?(e.openBlock(),e.createBlock(w,e.mergeProps({key:0},e.unref(me),{class:"vv-input-text__icon"}),null,16)):e.createCommentVNode("v-if",!0),e.createElementVNode("input",e.mergeProps({id:e.unref(D),ref_key:"inputEl",ref:ee},e.unref(Be),{style:e.unref(Ve),onKeyup:l[0]||(l[0]=e=>p("keyup",e)),onKeydown:Ne,onKeypress:l[1]||(l[1]=e=>p("keypress",e))}),null,16,K),(t.unit||t.$slots.unit)&&e.unref(we)?(e.openBlock(),e.createElementBlock("div",X,[e.createCommentVNode(" @slot Slot to replace unit"),e.renderSlot(t.$slots,"default",e.normalizeProps(e.guardReactiveProps(e.unref(xe))),(()=>[e.createTextVNode(e.toDisplayString(t.unit),1)]))])):e.createCommentVNode("v-if",!0)],512),e.createCommentVNode(" @slot Slot to replace right icon "),e.unref(be)?(e.openBlock(),e.createBlock(w,e.mergeProps({key:1},e.unref(be),{class:"vv-input-text__icon vv-input-text__icon-after"}),null,16)):e.unref(ue)&&!t.hideActions&&e.unref(ge)?(e.openBlock(),e.createBlock(e.unref(Ie),{key:2,onTogglePassword:re})):e.unref(se)&&!t.hideActions&&e.unref(ge)?(e.openBlock(),e.createBlock(e.unref(Pe),{key:3,onStepUp:ce,onStepDown:ve})):e.unref(pe)&&!t.hideActions&&e.unref(ge)?(e.openBlock(),e.createBlock(e.unref(Oe),{key:4,onClear:fe})):e.createCommentVNode("v-if",!0),e.createCommentVNode(" @slot Slot after input "),t.$slots.after?(e.openBlock(),e.createElementBlock("div",J,[e.createCommentVNode(" @slot Slot before input icon "),e.renderSlot(t.$slots,"after",e.normalizeProps(e.guardReactiveProps(e.unref(xe))))])):e.createCommentVNode("v-if",!0),e.unref(E)?(e.openBlock(),e.createElementBlock("span",Y,[e.createCommentVNode(" @slot Slot to replace count "),e.renderSlot(t.$slots,"count",e.normalizeProps(e.guardReactiveProps(e.unref(xe))),(()=>[e.createTextVNode(e.toDisplayString(e.unref(ye)),1)]))])):e.createCommentVNode("v-if",!0)]),e.createVNode(e.unref($e),{id:e.unref(V),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(Ae))))])),key:"0"}:void 0,t.$slots.loading?{name:"loading",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"loading",e.normalizeProps(e.guardReactiveProps(e.unref(Ae))))])),key:"1"}:void 0,t.$slots.valid?{name:"valid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"valid",e.normalizeProps(e.guardReactiveProps(e.unref(Ae))))])),key:"2"}:void 0,t.$slots.invalid?{name:"invalid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"invalid",e.normalizeProps(e.guardReactiveProps(e.unref(Ae))))])),key:"3"}:void 0]),1032,["id"])],2))}})}));
|
|
@@ -14,15 +14,15 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
14
14
|
pattern: StringConstructor;
|
|
15
15
|
multiple: BooleanConstructor;
|
|
16
16
|
iconShowPassword: {
|
|
17
|
-
type:
|
|
17
|
+
type: globalThis.PropType<string | import("../VvIcon").VvIconProps>;
|
|
18
18
|
default: "eye-on";
|
|
19
19
|
};
|
|
20
20
|
iconHidePassword: {
|
|
21
|
-
type:
|
|
21
|
+
type: globalThis.PropType<string | import("../VvIcon").VvIconProps>;
|
|
22
22
|
default: "eye-off";
|
|
23
23
|
};
|
|
24
24
|
iconClear: {
|
|
25
|
-
type:
|
|
25
|
+
type: globalThis.PropType<string | import("../VvIcon").VvIconProps>;
|
|
26
26
|
default: "close";
|
|
27
27
|
};
|
|
28
28
|
labelStepUp: {
|
|
@@ -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").PublicProps, Readonly<globalThis.ExtractPropTypes<{
|
|
124
175
|
modelValue: (StringConstructor | NumberConstructor)[];
|
|
125
176
|
type: {
|
|
126
177
|
type: globalThis.PropType<import("../VvInputText").InputType>;
|
|
@@ -136,15 +187,15 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
136
187
|
pattern: StringConstructor;
|
|
137
188
|
multiple: BooleanConstructor;
|
|
138
189
|
iconShowPassword: {
|
|
139
|
-
type:
|
|
190
|
+
type: globalThis.PropType<string | import("../VvIcon").VvIconProps>;
|
|
140
191
|
default: "eye-on";
|
|
141
192
|
};
|
|
142
193
|
iconHidePassword: {
|
|
143
|
-
type:
|
|
194
|
+
type: globalThis.PropType<string | import("../VvIcon").VvIconProps>;
|
|
144
195
|
default: "eye-off";
|
|
145
196
|
};
|
|
146
197
|
iconClear: {
|
|
147
|
-
type:
|
|
198
|
+
type: globalThis.PropType<string | import("../VvIcon").VvIconProps>;
|
|
148
199
|
default: "close";
|
|
149
200
|
};
|
|
150
201
|
labelStepUp: {
|
|
@@ -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,34 +331,41 @@ 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
|
-
iconShowPassword: string;
|
|
263
|
-
iconHidePassword: string;
|
|
264
|
-
iconClear: string;
|
|
366
|
+
iconShowPassword: string | import("../VvIcon").VvIconProps;
|
|
367
|
+
iconHidePassword: string | import("../VvIcon").VvIconProps;
|
|
368
|
+
iconClear: string | import("../VvIcon").VvIconProps;
|
|
265
369
|
labelStepUp: string;
|
|
266
370
|
labelStepDown: string;
|
|
267
371
|
labelShowPassword: 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?(_: {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ExtractPropTypes, PropType } from 'vue';
|
|
2
2
|
import type { FactoryOpts } from 'imask';
|
|
3
|
+
import { type VvIconProps } from '../VvIcon';
|
|
3
4
|
export declare const INPUT_TYPES: {
|
|
4
5
|
readonly TEXT: "text";
|
|
5
6
|
readonly PASSWORD: "password";
|
|
@@ -16,14 +17,6 @@ export declare const INPUT_TYPES: {
|
|
|
16
17
|
readonly WEEK: "week";
|
|
17
18
|
};
|
|
18
19
|
export type InputType = ValueOf<typeof INPUT_TYPES>;
|
|
19
|
-
export declare const TYPES_ICON: {
|
|
20
|
-
readonly PASSWORD_SHOW: "eye-on";
|
|
21
|
-
readonly PASSWORD_HIDE: "eye-off";
|
|
22
|
-
readonly DATE: "calendar";
|
|
23
|
-
readonly TIME: "time";
|
|
24
|
-
readonly COLOR: "color";
|
|
25
|
-
readonly SEARCH: "close";
|
|
26
|
-
};
|
|
27
20
|
export declare const VvInputTextEvents: string[];
|
|
28
21
|
export declare const VvInputTextProps: {
|
|
29
22
|
/**
|
|
@@ -78,7 +71,7 @@ export declare const VvInputTextProps: {
|
|
|
78
71
|
* @see VVIcon
|
|
79
72
|
*/
|
|
80
73
|
iconShowPassword: {
|
|
81
|
-
type:
|
|
74
|
+
type: PropType<string | VvIconProps>;
|
|
82
75
|
default: "eye-on";
|
|
83
76
|
};
|
|
84
77
|
/**
|
|
@@ -86,7 +79,7 @@ export declare const VvInputTextProps: {
|
|
|
86
79
|
* @see VVIcon
|
|
87
80
|
*/
|
|
88
81
|
iconHidePassword: {
|
|
89
|
-
type:
|
|
82
|
+
type: PropType<string | VvIconProps>;
|
|
90
83
|
default: "eye-off";
|
|
91
84
|
};
|
|
92
85
|
/**
|
|
@@ -94,7 +87,7 @@ export declare const VvInputTextProps: {
|
|
|
94
87
|
* @see VVIcon
|
|
95
88
|
*/
|
|
96
89
|
iconClear: {
|
|
97
|
-
type:
|
|
90
|
+
type: PropType<string | VvIconProps>;
|
|
98
91
|
default: "close";
|
|
99
92
|
};
|
|
100
93
|
/**
|
|
@@ -174,28 +167,56 @@ export declare const VvInputTextProps: {
|
|
|
174
167
|
type: BooleanConstructor;
|
|
175
168
|
default: boolean;
|
|
176
169
|
};
|
|
177
|
-
minlength:
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
170
|
+
minlength: {
|
|
171
|
+
type: (StringConstructor | NumberConstructor)[];
|
|
172
|
+
default: undefined;
|
|
173
|
+
};
|
|
174
|
+
maxlength: {
|
|
175
|
+
type: (StringConstructor | NumberConstructor)[];
|
|
176
|
+
default: undefined;
|
|
177
|
+
};
|
|
178
|
+
placeholder: {
|
|
179
|
+
type: StringConstructor;
|
|
180
|
+
default: undefined;
|
|
181
|
+
};
|
|
182
|
+
required: {
|
|
183
|
+
type: BooleanConstructor;
|
|
184
|
+
default: boolean;
|
|
185
|
+
};
|
|
186
|
+
label: {
|
|
187
|
+
type: (StringConstructor | NumberConstructor)[];
|
|
188
|
+
default: undefined;
|
|
189
|
+
};
|
|
190
|
+
floating: {
|
|
191
|
+
type: BooleanConstructor;
|
|
192
|
+
default: boolean;
|
|
193
|
+
};
|
|
183
194
|
icon: {
|
|
184
|
-
type:
|
|
195
|
+
type: PropType<string | VvIconProps>;
|
|
196
|
+
default: undefined;
|
|
185
197
|
};
|
|
186
198
|
iconPosition: {
|
|
187
199
|
type: PropType<"before" | "after">;
|
|
188
200
|
default: import("../../constants").Position;
|
|
189
201
|
validation: (value: import("../../constants").Position) => boolean;
|
|
190
202
|
};
|
|
191
|
-
debounce:
|
|
203
|
+
debounce: {
|
|
204
|
+
type: (StringConstructor | NumberConstructor)[];
|
|
205
|
+
default: undefined;
|
|
206
|
+
};
|
|
192
207
|
count: {
|
|
193
|
-
type: (
|
|
208
|
+
type: (BooleanConstructor | StringConstructor)[];
|
|
194
209
|
default: boolean;
|
|
195
210
|
validator: (value: string) => boolean;
|
|
196
211
|
};
|
|
197
|
-
modifiers:
|
|
198
|
-
|
|
212
|
+
modifiers: {
|
|
213
|
+
type: PropType<string | string[]>;
|
|
214
|
+
default: undefined;
|
|
215
|
+
};
|
|
216
|
+
loading: {
|
|
217
|
+
type: BooleanConstructor;
|
|
218
|
+
default: boolean;
|
|
219
|
+
};
|
|
199
220
|
loadingLabel: {
|
|
200
221
|
type: StringConstructor;
|
|
201
222
|
default: string;
|
|
@@ -204,12 +225,30 @@ export declare const VvInputTextProps: {
|
|
|
204
225
|
type: StringConstructor;
|
|
205
226
|
default: string;
|
|
206
227
|
};
|
|
207
|
-
invalid:
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
228
|
+
invalid: {
|
|
229
|
+
type: BooleanConstructor;
|
|
230
|
+
default: boolean;
|
|
231
|
+
};
|
|
232
|
+
invalidLabel: {
|
|
233
|
+
type: (ArrayConstructor | StringConstructor)[];
|
|
234
|
+
default: undefined;
|
|
235
|
+
};
|
|
236
|
+
valid: {
|
|
237
|
+
type: BooleanConstructor;
|
|
238
|
+
default: boolean;
|
|
239
|
+
};
|
|
240
|
+
validLabel: {
|
|
241
|
+
type: (ArrayConstructor | StringConstructor)[];
|
|
242
|
+
default: undefined;
|
|
243
|
+
};
|
|
244
|
+
readonly: {
|
|
245
|
+
type: BooleanConstructor;
|
|
246
|
+
default: boolean;
|
|
247
|
+
};
|
|
248
|
+
disabled: {
|
|
249
|
+
type: BooleanConstructor;
|
|
250
|
+
default: boolean;
|
|
251
|
+
};
|
|
213
252
|
tabindex: {
|
|
214
253
|
type: (StringConstructor | NumberConstructor)[];
|
|
215
254
|
default: number;
|
|
@@ -218,7 +257,10 @@ export declare const VvInputTextProps: {
|
|
|
218
257
|
type: StringConstructor;
|
|
219
258
|
default: string;
|
|
220
259
|
};
|
|
221
|
-
autofocus:
|
|
260
|
+
autofocus: {
|
|
261
|
+
type: BooleanConstructor;
|
|
262
|
+
default: boolean;
|
|
263
|
+
};
|
|
222
264
|
name: {
|
|
223
265
|
type: StringConstructor;
|
|
224
266
|
required: boolean;
|