@vue-interface/input-field 2.0.11 → 2.0.13
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/dist/input-field.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as p, mergeModels as h, useModel as F, useTemplateRef as w, createElementBlock as d, openBlock as a, normalizeClass as C, unref as t, renderSlot as l, createElementVNode as n, createCommentVNode as s, toDisplayString as c, normalizeProps as u, guardReactiveProps as m, withDirectives as A, mergeProps as M, vModelDynamic as N, createVNode as $, Transition as S, withCtx as y, createBlock as B, createTextVNode as D } from "vue";
|
|
2
2
|
import { ActivityIndicator as E } from "@vue-interface/activity-indicator";
|
|
3
3
|
import { useFormControl as I, FormControlErrors as P, FormControlFeedback as R } from "@vue-interface/form-control";
|
|
4
4
|
const x = ["for"], G = { class: "form-control-inner" }, U = { class: "form-control-activity-indicator" }, j = {
|
|
@@ -7,7 +7,7 @@ const x = ["for"], G = { class: "form-control-inner" }, U = { class: "form-contr
|
|
|
7
7
|
}, q = {
|
|
8
8
|
valid: "",
|
|
9
9
|
class: "valid-feedback"
|
|
10
|
-
}, L = /* @__PURE__ */
|
|
10
|
+
}, L = /* @__PURE__ */ p({
|
|
11
11
|
inheritAttrs: !1,
|
|
12
12
|
__name: "InputField",
|
|
13
13
|
props: /* @__PURE__ */ h({
|
|
@@ -27,7 +27,7 @@ const x = ["for"], G = { class: "form-control-inner" }, U = { class: "form-contr
|
|
|
27
27
|
modelValue: {},
|
|
28
28
|
name: {},
|
|
29
29
|
plaintext: { type: Boolean },
|
|
30
|
-
size: {},
|
|
30
|
+
size: { default: "form-control-md" },
|
|
31
31
|
color: {},
|
|
32
32
|
readonly: { type: Boolean },
|
|
33
33
|
valid: { type: Boolean },
|
|
@@ -36,15 +36,15 @@ const x = ["for"], G = { class: "form-control-inner" }, U = { class: "form-contr
|
|
|
36
36
|
modelValue: {},
|
|
37
37
|
modelModifiers: {}
|
|
38
38
|
}),
|
|
39
|
-
emits: /* @__PURE__ */ h(["
|
|
40
|
-
setup(e, { emit:
|
|
41
|
-
const T = e, f = F(e, "modelValue"),
|
|
39
|
+
emits: /* @__PURE__ */ h(["blur", "focus", "focusin", "focusout", "click", "doubleclick", "contextmenu", "mousedown", "mouseup", "mouseover", "mouseout", "mouseenter", "mouseleave", "mousemove", "keydown", "keyup", "keypress", "select", "selectionchange", "invalid", "submit", "reset", "scroll", "wheel", "copy", "cut", "paste", "touchstart", "touchend", "touchmove", "touchcancel", "change", "input", "beforeinput"], ["update:modelValue"]),
|
|
40
|
+
setup(e, { emit: V }) {
|
|
41
|
+
const T = e, f = F(e, "modelValue"), z = V, {
|
|
42
42
|
controlAttributes: v,
|
|
43
|
-
formGroupClasses:
|
|
43
|
+
formGroupClasses: g,
|
|
44
44
|
listeners: b
|
|
45
|
-
} = I({ model: f, props: T, emit:
|
|
45
|
+
} = I({ model: f, props: T, emit: z }), k = w("field");
|
|
46
46
|
return (o, r) => (a(), d("div", {
|
|
47
|
-
class: C(["input-field", t(
|
|
47
|
+
class: C(["input-field", t(g)])
|
|
48
48
|
}, [
|
|
49
49
|
l(o.$slots, "label", {}, () => [
|
|
50
50
|
e.label ? (a(), d("label", {
|
|
@@ -75,7 +75,7 @@ const x = ["for"], G = { class: "form-control-inner" }, U = { class: "form-contr
|
|
|
75
75
|
l(o.$slots, "activity", {}, () => [
|
|
76
76
|
$(S, { name: "input-field-fade" }, {
|
|
77
77
|
default: y(() => [
|
|
78
|
-
e.activity && e.indicator ? (a(),
|
|
78
|
+
e.activity && e.indicator ? (a(), B(t(E), {
|
|
79
79
|
key: "activity",
|
|
80
80
|
ref: "activity",
|
|
81
81
|
type: e.indicator,
|
|
@@ -88,7 +88,7 @@ const x = ["for"], G = { class: "form-control-inner" }, U = { class: "form-contr
|
|
|
88
88
|
])
|
|
89
89
|
]),
|
|
90
90
|
l(o.$slots, "errors", u(m({ error: e.error, errors: e.errors, id: o.$attrs.id, name: o.$attrs.name })), () => [
|
|
91
|
-
e.error || e.errors ? (a(),
|
|
91
|
+
e.error || e.errors ? (a(), B(t(P), {
|
|
92
92
|
key: 0,
|
|
93
93
|
id: e.id,
|
|
94
94
|
name: e.name,
|
package/dist/input-field.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input-field.js","sources":["../src/InputField.vue"],"sourcesContent":["<script setup lang=\"ts\" generic=\"ModelValue, Value\">\nimport { ActivityIndicator } from '@vue-interface/activity-indicator';\nimport type { FormControlEvents, FormControlProps, FormControlSlots } from '@vue-interface/form-control';\nimport { FormControlErrors, FormControlFeedback, useFormControl } from '@vue-interface/form-control';\nimport { InputHTMLAttributes, useTemplateRef } from 'vue';\n\nconst props = withDefaults(defineProps<InputFieldProps<ModelValue,Value>>(), {\n formControlClass: 'form-control',\n labelClass: 'form-label'\n});\n\ndefineOptions({\n inheritAttrs: false\n});\n\nconst model = defineModel<ModelValue>();\n\ndefineSlots<FormControlSlots<InputFieldControlSizePrefix,ModelValue>>();\n\nconst emit = defineEmits<FormControlEvents
|
|
1
|
+
{"version":3,"file":"input-field.js","sources":["../src/InputField.vue"],"sourcesContent":["<script setup lang=\"ts\" generic=\"ModelValue, Value\">\nimport { ActivityIndicator } from '@vue-interface/activity-indicator';\nimport type { FormControlEvents, FormControlProps, FormControlSlots } from '@vue-interface/form-control';\nimport { FormControlErrors, FormControlFeedback, useFormControl } from '@vue-interface/form-control';\nimport { InputHTMLAttributes, useTemplateRef } from 'vue';\n\nconst props = withDefaults(defineProps<InputFieldProps<ModelValue,Value>>(), {\n formControlClass: 'form-control',\n labelClass: 'form-label',\n size: 'form-control-md'\n});\n\ndefineOptions({\n inheritAttrs: false\n});\n\nconst model = defineModel<ModelValue>();\n\ndefineSlots<FormControlSlots<InputFieldControlSizePrefix,ModelValue>>();\n\nconst emit = defineEmits<FormControlEvents>();\n\nconst {\n controlAttributes,\n formGroupClasses,\n listeners\n} = useFormControl<InputHTMLAttributes, InputFieldControlSizePrefix, ModelValue|undefined, Value>({ model, props, emit });\n\nconst field = useTemplateRef<HTMLInputElement>('field');\n</script>\n\n<script lang=\"ts\">\nexport type InputFieldControlSizePrefix = 'form-control';\n\nexport type InputFieldProps<ModelValue, Value> = FormControlProps<\n InputHTMLAttributes, \n InputFieldControlSizePrefix, \n ModelValue, \n Value\n>;\n</script>\n\n<template>\n <div\n class=\"input-field\"\n :class=\"formGroupClasses\">\n <slot name=\"label\">\n <label\n v-if=\"label\"\n ref=\"label\"\n :class=\"labelClass\"\n :for=\"controlAttributes.id\">\n {{ label }}\n </label>\n </slot>\n \n <div class=\"form-control-inner\">\n <slot\n name=\"control\"\n v-bind=\"{ controlAttributes, listeners }\">\n <div\n v-if=\"$slots.icon\"\n class=\"form-control-inner-icon\"\n @click=\"field?.focus()\">\n <slot name=\"icon\" />\n </div>\n <input\n ref=\"field\"\n v-model=\"model\"\n v-bind=\"{...controlAttributes, ...listeners}\">\n </slot>\n \n <div class=\"form-control-activity-indicator\">\n <slot name=\"activity\">\n <Transition name=\"input-field-fade\">\n <ActivityIndicator\n v-if=\"activity && indicator\"\n key=\"activity\"\n ref=\"activity\"\n :type=\"indicator\"\n :size=\"indicatorSize\" />\n </Transition>\n </slot>\n </div>\n </div>\n\n <slot\n name=\"errors\"\n v-bind=\"{ error, errors, id: $attrs.id, name: $attrs.name }\"> \n <FormControlErrors\n v-if=\"!!(error || errors)\"\n :id=\"id\"\n v-slot=\"{ error }\"\n :name=\"name\"\n :error=\"error\"\n :errors=\"errors\">\n <div\n invalid\n class=\"invalid-feedback\">\n {{ error }}<br>\n </div>\n </FormControlErrors>\n </slot>\n \n <slot\n name=\"feedback\"\n v-bind=\"{ feedback }\">\n <FormControlFeedback\n v-slot=\"{ feedback }\"\n :feedback=\"feedback\">\n <div\n valid\n class=\"valid-feedback\">\n {{ feedback }}\n </div>\n </FormControlFeedback>\n </slot>\n\n <slot\n name=\"help\"\n v-bind=\"{ helpText }\">\n <small\n v-if=\"helpText\"\n ref=\"help\"\n class=\"form-help\">\n {{ helpText }}\n </small>\n </slot>\n </div>\n</template>"],"names":["props","__props","model","_useModel","emit","__emit","controlAttributes","formGroupClasses","listeners","useFormControl","field","useTemplateRef","_createElementBlock","_normalizeClass","_unref","_renderSlot","_ctx","_hoisted_1","_createElementVNode","_hoisted_2","_normalizeProps","_guardReactiveProps","$slots","_cache","$event","_withDirectives","_mergeProps","_hoisted_3","_createVNode","_Transition","_createBlock","ActivityIndicator","$attrs","FormControlErrors","_withCtx","error","_hoisted_4","FormControlFeedback","feedback","_hoisted_5","_toDisplayString"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,UAAMA,IAAQC,GAURC,IAAQC,EAAuBF,GAAA,YAAC,GAIhCG,IAAOC,GAEP;AAAA,MACF,mBAAAC;AAAA,MACA,kBAAAC;AAAA,MACA,WAAAC;AAAA,IAAA,IACAC,EAA8F,EAAE,OAAAP,GAAO,OAAAF,GAAO,MAAAI,GAAM,GAElHM,IAAQC,EAAiC,OAAO;2BAelDC,EAqFM,OAAA;AAAA,MApFF,OAAKC,EAAA,CAAC,eACEC,EAAAP,CAAA,CAAgB,CAAA;AAAA,IAAA;MACxBQ,EAQOC,uBARP,MAQO;AAAA,QANOf,EAAA,cADVW,EAMQ,SAAA;AAAA;UAJJ,KAAI;AAAA,UACH,SAAOX,EAAA,UAAU;AAAA,UACjB,KAAKa,EAAAR,CAAA,EAAkB;AAAA,QAAA,KACrBL,EAAA,KAAK,GAAA,IAAAgB,CAAA;;MAIhBC,EA4BM,OA5BNC,GA4BM;AAAA,QA3BFJ,EAaOC,EAAA,QAAA,WAAAI,EAAAC,EAAA,EAAA,mBAXOP,EAAAR,CAAA,GAAiB,WAAEQ,EAAAN,CAAA,OAFjC,MAaO;AAAA,UATOc,EAAAA,OAAO,aADjBV,EAKM,OAAA;AAAA;YAHF,OAAM;AAAA,YACL,SAAKW,EAAA,CAAA,MAAAA,EA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CAAA,GAFtB,MAYO;AAAA,QATH2B,EAQsBd,EAAAuB,CAAA,GAAA,EANjB,UAAUpC,EAAA,YAAQ;AAAA,UACnB,SAAAiC,EAAA,CAIM,EANI,UAAAI,QAAQ;AAAA,YAElBpB,EAIM,OAJNqB,GAIMC,EADCF,CAAQ,GAAA,CAAA;AAAA,UAAA;;;;MAKvBvB,EASOC,EAAA,QAAA,QAAAI,EAAAC,EAAA,EAAA,UAPOpB,EAAA,SAAA,CAAQ,CAAA,GAFtB,MASO;AAAA,QALOA,EAAA,iBADVW,EAKQ,SAAA;AAAA;UAHJ,KAAI;AAAA,UACJ,OAAM;AAAA,QAAA,KACHX,EAAA,QAAQ,GAAA,GAAA;;;;;"}
|
package/dist/input-field.umd.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(function(r,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("@vue-interface/activity-indicator"),require("@vue-interface/form-control")):typeof define=="function"&&define.amd?define(["exports","vue","@vue-interface/activity-indicator","@vue-interface/form-control"],e):(r=typeof globalThis<"u"?globalThis:r||self,e(r.InputField={},r.Vue,r.VueInterfaceActivityIndicator,r.VueInterfaceFormControl))})(this,(function(r,e,m,i){"use strict";const f=["for"],y={class:"form-control-inner"},k={class:"form-control-activity-indicator"},u={invalid:"",class:"invalid-feedback"},b={valid:"",class:"valid-feedback"},p=e.defineComponent({inheritAttrs:!1,__name:"InputField",props:e.mergeModels({activity:{type:Boolean},disabled:{type:Boolean},error:{},errors:{},feedback:{},formControlClass:{default:"form-control"},helpText:{},id:{},indicator:{},indicatorSize:{},invalid:{type:Boolean},label:{},labelClass:{default:"form-label"},modelValue:{},name:{},plaintext:{type:Boolean},size:{},color:{},readonly:{type:Boolean},valid:{type:Boolean},value:{}},{modelValue:{},modelModifiers:{}}),emits:e.mergeModels(["
|
|
1
|
+
(function(r,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("@vue-interface/activity-indicator"),require("@vue-interface/form-control")):typeof define=="function"&&define.amd?define(["exports","vue","@vue-interface/activity-indicator","@vue-interface/form-control"],e):(r=typeof globalThis<"u"?globalThis:r||self,e(r.InputField={},r.Vue,r.VueInterfaceActivityIndicator,r.VueInterfaceFormControl))})(this,(function(r,e,m,i){"use strict";const f=["for"],y={class:"form-control-inner"},k={class:"form-control-activity-indicator"},u={invalid:"",class:"invalid-feedback"},b={valid:"",class:"valid-feedback"},p=e.defineComponent({inheritAttrs:!1,__name:"InputField",props:e.mergeModels({activity:{type:Boolean},disabled:{type:Boolean},error:{},errors:{},feedback:{},formControlClass:{default:"form-control"},helpText:{},id:{},indicator:{},indicatorSize:{},invalid:{type:Boolean},label:{},labelClass:{default:"form-label"},modelValue:{},name:{},plaintext:{type:Boolean},size:{default:"form-control-md"},color:{},readonly:{type:Boolean},valid:{type:Boolean},value:{}},{modelValue:{},modelModifiers:{}}),emits:e.mergeModels(["blur","focus","focusin","focusout","click","doubleclick","contextmenu","mousedown","mouseup","mouseover","mouseout","mouseenter","mouseleave","mousemove","keydown","keyup","keypress","select","selectionchange","invalid","submit","reset","scroll","wheel","copy","cut","paste","touchstart","touchend","touchmove","touchcancel","change","input","beforeinput"],["update:modelValue"]),setup(t,{emit:h}){const V=t,a=e.useModel(t,"modelValue"),C=h,{controlAttributes:d,formGroupClasses:B,listeners:s}=i.useFormControl({model:a,props:V,emit:C}),c=e.useTemplateRef("field");return(o,l)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["input-field",e.unref(B)])},[e.renderSlot(o.$slots,"label",{},()=>[t.label?(e.openBlock(),e.createElementBlock("label",{key:0,ref:"label",class:e.normalizeClass(t.labelClass),for:e.unref(d).id},e.toDisplayString(t.label),11,f)):e.createCommentVNode("",!0)]),e.createElementVNode("div",y,[e.renderSlot(o.$slots,"control",e.normalizeProps(e.guardReactiveProps({controlAttributes:e.unref(d),listeners:e.unref(s)})),()=>[o.$slots.icon?(e.openBlock(),e.createElementBlock("div",{key:0,class:"form-control-inner-icon",onClick:l[0]||(l[0]=n=>c.value?.focus())},[e.renderSlot(o.$slots,"icon")])):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("input",e.mergeProps({ref_key:"field",ref:c,"onUpdate:modelValue":l[1]||(l[1]=n=>a.value=n)},{...e.unref(d),...e.unref(s)}),null,16),[[e.vModelDynamic,a.value]])]),e.createElementVNode("div",k,[e.renderSlot(o.$slots,"activity",{},()=>[e.createVNode(e.Transition,{name:"input-field-fade"},{default:e.withCtx(()=>[t.activity&&t.indicator?(e.openBlock(),e.createBlock(e.unref(m.ActivityIndicator),{key:"activity",ref:"activity",type:t.indicator,size:t.indicatorSize},null,8,["type","size"])):e.createCommentVNode("",!0)]),_:1})])])]),e.renderSlot(o.$slots,"errors",e.normalizeProps(e.guardReactiveProps({error:t.error,errors:t.errors,id:o.$attrs.id,name:o.$attrs.name})),()=>[t.error||t.errors?(e.openBlock(),e.createBlock(e.unref(i.FormControlErrors),{key:0,id:t.id,name:t.name,error:t.error,errors:t.errors},{default:e.withCtx(({error:n})=>[e.createElementVNode("div",u,[e.createTextVNode(e.toDisplayString(n),1),l[2]||(l[2]=e.createElementVNode("br",null,null,-1))])]),_:1},8,["id","name","error","errors"])):e.createCommentVNode("",!0)]),e.renderSlot(o.$slots,"feedback",e.normalizeProps(e.guardReactiveProps({feedback:t.feedback})),()=>[e.createVNode(e.unref(i.FormControlFeedback),{feedback:t.feedback},{default:e.withCtx(({feedback:n})=>[e.createElementVNode("div",b,e.toDisplayString(n),1)]),_:1},8,["feedback"])]),e.renderSlot(o.$slots,"help",e.normalizeProps(e.guardReactiveProps({helpText:t.helpText})),()=>[t.helpText?(e.openBlock(),e.createElementBlock("small",{key:0,ref:"help",class:"form-help"},e.toDisplayString(t.helpText),513)):e.createCommentVNode("",!0)])],2))}});r.InputField=p,Object.defineProperty(r,Symbol.toStringTag,{value:"Module"})}));
|
|
2
2
|
//# sourceMappingURL=input-field.umd.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input-field.umd.cjs","sources":["../src/InputField.vue"],"sourcesContent":["<script setup lang=\"ts\" generic=\"ModelValue, Value\">\nimport { ActivityIndicator } from '@vue-interface/activity-indicator';\nimport type { FormControlEvents, FormControlProps, FormControlSlots } from '@vue-interface/form-control';\nimport { FormControlErrors, FormControlFeedback, useFormControl } from '@vue-interface/form-control';\nimport { InputHTMLAttributes, useTemplateRef } from 'vue';\n\nconst props = withDefaults(defineProps<InputFieldProps<ModelValue,Value>>(), {\n formControlClass: 'form-control',\n labelClass: 'form-label'\n});\n\ndefineOptions({\n inheritAttrs: false\n});\n\nconst model = defineModel<ModelValue>();\n\ndefineSlots<FormControlSlots<InputFieldControlSizePrefix,ModelValue>>();\n\nconst emit = defineEmits<FormControlEvents
|
|
1
|
+
{"version":3,"file":"input-field.umd.cjs","sources":["../src/InputField.vue"],"sourcesContent":["<script setup lang=\"ts\" generic=\"ModelValue, Value\">\nimport { ActivityIndicator } from '@vue-interface/activity-indicator';\nimport type { FormControlEvents, FormControlProps, FormControlSlots } from '@vue-interface/form-control';\nimport { FormControlErrors, FormControlFeedback, useFormControl } from '@vue-interface/form-control';\nimport { InputHTMLAttributes, useTemplateRef } from 'vue';\n\nconst props = withDefaults(defineProps<InputFieldProps<ModelValue,Value>>(), {\n formControlClass: 'form-control',\n labelClass: 'form-label',\n size: 'form-control-md'\n});\n\ndefineOptions({\n inheritAttrs: false\n});\n\nconst model = defineModel<ModelValue>();\n\ndefineSlots<FormControlSlots<InputFieldControlSizePrefix,ModelValue>>();\n\nconst emit = defineEmits<FormControlEvents>();\n\nconst {\n controlAttributes,\n formGroupClasses,\n listeners\n} = useFormControl<InputHTMLAttributes, InputFieldControlSizePrefix, ModelValue|undefined, Value>({ model, props, emit });\n\nconst field = useTemplateRef<HTMLInputElement>('field');\n</script>\n\n<script lang=\"ts\">\nexport type InputFieldControlSizePrefix = 'form-control';\n\nexport type InputFieldProps<ModelValue, Value> = FormControlProps<\n InputHTMLAttributes, \n InputFieldControlSizePrefix, \n ModelValue, \n Value\n>;\n</script>\n\n<template>\n <div\n class=\"input-field\"\n :class=\"formGroupClasses\">\n <slot name=\"label\">\n <label\n v-if=\"label\"\n ref=\"label\"\n :class=\"labelClass\"\n :for=\"controlAttributes.id\">\n {{ label }}\n </label>\n </slot>\n \n <div class=\"form-control-inner\">\n <slot\n name=\"control\"\n v-bind=\"{ controlAttributes, listeners }\">\n <div\n v-if=\"$slots.icon\"\n class=\"form-control-inner-icon\"\n @click=\"field?.focus()\">\n <slot name=\"icon\" />\n </div>\n <input\n ref=\"field\"\n v-model=\"model\"\n v-bind=\"{...controlAttributes, ...listeners}\">\n </slot>\n \n <div class=\"form-control-activity-indicator\">\n <slot name=\"activity\">\n <Transition name=\"input-field-fade\">\n <ActivityIndicator\n v-if=\"activity && indicator\"\n key=\"activity\"\n ref=\"activity\"\n :type=\"indicator\"\n :size=\"indicatorSize\" />\n </Transition>\n </slot>\n </div>\n </div>\n\n <slot\n name=\"errors\"\n v-bind=\"{ error, errors, id: $attrs.id, name: $attrs.name }\"> \n <FormControlErrors\n v-if=\"!!(error || errors)\"\n :id=\"id\"\n v-slot=\"{ error }\"\n :name=\"name\"\n :error=\"error\"\n :errors=\"errors\">\n <div\n invalid\n class=\"invalid-feedback\">\n {{ error }}<br>\n </div>\n </FormControlErrors>\n </slot>\n \n <slot\n name=\"feedback\"\n v-bind=\"{ feedback }\">\n <FormControlFeedback\n v-slot=\"{ feedback }\"\n :feedback=\"feedback\">\n <div\n valid\n class=\"valid-feedback\">\n {{ feedback }}\n </div>\n </FormControlFeedback>\n </slot>\n\n <slot\n name=\"help\"\n v-bind=\"{ helpText }\">\n <small\n v-if=\"helpText\"\n ref=\"help\"\n class=\"form-help\">\n {{ helpText }}\n </small>\n </slot>\n </div>\n</template>"],"names":["props","__props","model","_useModel","emit","__emit","controlAttributes","formGroupClasses","listeners","useFormControl","field","useTemplateRef","_createElementBlock","_normalizeClass","_unref","_renderSlot","_ctx","_hoisted_1","_createElementVNode","_hoisted_2","_normalizeProps","_guardReactiveProps","$slots","_cache","$event","_withDirectives","_mergeProps","_hoisted_3","_createVNode","_Transition","_createBlock","ActivityIndicator","$attrs","FormControlErrors","_withCtx","error","_hoisted_4","FormControlFeedback","feedback","_hoisted_5","_toDisplayString"],"mappings":"2gDAMA,MAAMA,EAAQC,EAURC,EAAQC,EAAAA,SAAuBF,EAAA,YAAC,EAIhCG,EAAOC,EAEP,CACF,kBAAAC,EACA,iBAAAC,EACA,UAAAC,CAAA,EACAC,EAAAA,eAA8F,CAAE,MAAAP,EAAO,MAAAF,EAAO,KAAAI,EAAM,EAElHM,EAAQC,EAAAA,eAAiC,OAAO,8BAelDC,EAAAA,mBAqFM,MAAA,CApFF,MAAKC,EAAAA,eAAA,CAAC,cACEC,EAAAA,MAAAP,CAAA,CAAgB,CAAA,CAAA,GACxBQ,EAAAA,WAQOC,oBARP,IAQO,CANOf,EAAA,qBADVW,EAAAA,mBAMQ,QAAA,OAJJ,IAAI,QACH,uBAAOX,EAAA,UAAU,EACjB,IAAKa,EAAAA,MAAAR,CAAA,EAAkB,EAAA,oBACrBL,EAAA,KAAK,EAAA,GAAAgB,CAAA,iCAIhBC,EAAAA,mBA4BM,MA5BNC,EA4BM,CA3BFJ,EAAAA,WAaOC,EAAA,OAAA,UAAAI,EAAAA,eAAAC,EAAAA,mBAAA,CAAA,kBAXOP,EAAAA,MAAAR,CAAA,EAAiB,UAAEQ,EAAAA,MAAAN,CAAA,KAFjC,IAaO,CATOc,EAAAA,OAAO,oBADjBV,EAAAA,mBAKM,MAAA,OAHF,MAAM,0BACL,QAAKW,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAAC,GAAEd,EAAA,OAAO,MAAA,EAAK,GACpBK,aAAoBC,EAAA,OAAA,MAAA,CAAA,gCAExBS,iBAAAP,EAAAA,mBAGkD,QAHlDQ,aAGkD,SAF1C,QAAJ,IAAIhB,uCACKR,EAAK,MAAAsB,EAAA,EACF,CAAA,GAAAV,E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B,EAAAA,WASOC,EAAA,OAAA,OAAAI,EAAAA,eAAAC,EAAAA,mBAAA,CAAA,SAPOpB,EAAA,QAAA,CAAQ,CAAA,EAFtB,IASO,CALOA,EAAA,wBADVW,EAAAA,mBAKQ,QAAA,OAHJ,IAAI,OACJ,MAAM,WAAA,oBACHX,EAAA,QAAQ,EAAA,GAAA"}
|
|
@@ -6,7 +6,6 @@ declare const _default: <ModelValue, Value>(__VLS_props: NonNullable<Awaited<typ
|
|
|
6
6
|
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
|
7
7
|
readonly onInput?: ((event: Event) => any) | undefined;
|
|
8
8
|
readonly onSelect?: ((event: Event) => any) | undefined;
|
|
9
|
-
readonly "onUpdate:modelValue"?: ((...args: unknown[]) => any) | undefined;
|
|
10
9
|
readonly onBlur?: ((event: FocusEvent) => any) | undefined;
|
|
11
10
|
readonly onFocus?: ((event: FocusEvent) => any) | undefined;
|
|
12
11
|
readonly onFocusin?: ((event: FocusEvent) => any) | undefined;
|
|
@@ -39,6 +38,7 @@ declare const _default: <ModelValue, Value>(__VLS_props: NonNullable<Awaited<typ
|
|
|
39
38
|
readonly onTouchcancel?: ((event: TouchEvent) => any) | undefined;
|
|
40
39
|
readonly onChange?: ((event: Event) => any) | undefined;
|
|
41
40
|
readonly onBeforeinput?: ((event: Event) => any) | undefined;
|
|
41
|
+
readonly "onUpdate:modelValue"?: ((value: ModelValue) => any) | undefined;
|
|
42
42
|
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onCopy" | "onCut" | "onPaste" | "onFocus" | "onFocusin" | "onFocusout" | "onBlur" | "onChange" | "onBeforeinput" | "onInput" | "onReset" | "onSubmit" | "onInvalid" | "onKeydown" | "onKeypress" | "onKeyup" | "onMousedown" | "onMouseenter" | "onMouseleave" | "onMousemove" | "onMouseout" | "onMouseover" | "onMouseup" | "onSelect" | "onScroll" | "onTouchcancel" | "onTouchend" | "onTouchmove" | "onTouchstart" | "onClick" | "onContextmenu" | "onWheel" | "onDoubleclick" | "onSelectionchange" | "onUpdate:modelValue"> & ({
|
|
43
43
|
modelValue?: ModelValue;
|
|
44
44
|
} & {
|
|
@@ -67,7 +67,7 @@ declare const _default: <ModelValue, Value>(__VLS_props: NonNullable<Awaited<typ
|
|
|
67
67
|
expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
|
|
68
68
|
attrs: any;
|
|
69
69
|
slots: Readonly<FormControlSlots<"form-control", ModelValue>> & FormControlSlots<"form-control", ModelValue>;
|
|
70
|
-
emit: (((evt: "input", event: Event) => void) & ((evt: "select", event: Event) => void) & ((evt: "
|
|
70
|
+
emit: (((evt: "input", event: Event) => void) & ((evt: "select", event: Event) => void) & ((evt: "blur", event: FocusEvent) => void) & ((evt: "focus", event: FocusEvent) => void) & ((evt: "focusin", event: FocusEvent) => void) & ((evt: "focusout", event: FocusEvent) => void) & ((evt: "click", event: MouseEvent) => void) & ((evt: "doubleclick", event: MouseEvent) => void) & ((evt: "contextmenu", event: MouseEvent) => void) & ((evt: "mousedown", event: MouseEvent) => void) & ((evt: "mouseup", event: MouseEvent) => void) & ((evt: "mouseover", event: MouseEvent) => void) & ((evt: "mouseout", event: MouseEvent) => void) & ((evt: "mouseenter", event: MouseEvent) => void) & ((evt: "mouseleave", event: MouseEvent) => void) & ((evt: "mousemove", event: MouseEvent) => void) & ((evt: "keydown", event: KeyboardEvent) => void) & ((evt: "keyup", event: KeyboardEvent) => void) & ((evt: "keypress", event: KeyboardEvent) => void) & ((evt: "selectionchange", event: Event) => void) & ((evt: "invalid", event: Event) => void) & ((evt: "submit", event: Event) => void) & ((evt: "reset", event: Event) => void) & ((evt: "scroll", event: Event) => void) & ((evt: "wheel", event: WheelEvent) => void) & ((evt: "copy", event: ClipboardEvent) => void) & ((evt: "cut", event: ClipboardEvent) => void) & ((evt: "paste", event: ClipboardEvent) => void) & ((evt: "touchstart", event: TouchEvent) => void) & ((evt: "touchend", event: TouchEvent) => void) & ((evt: "touchmove", event: TouchEvent) => void) & ((evt: "touchcancel", event: TouchEvent) => void) & ((evt: "change", event: Event) => void) & ((evt: "beforeinput", event: Event) => void)) & ((evt: "update:modelValue", value: ModelValue) => void);
|
|
71
71
|
}>) => import('vue').VNode & {
|
|
72
72
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
73
73
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vue-interface/input-field",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.13",
|
|
4
4
|
"description": "A Vue input field component.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/input-field.umd.cjs",
|
|
@@ -45,8 +45,8 @@
|
|
|
45
45
|
],
|
|
46
46
|
"peerDependencies": {
|
|
47
47
|
"vue": "^3.3.4",
|
|
48
|
-
"@vue-interface/activity-indicator": "3.0.
|
|
49
|
-
"@vue-interface/form-control": "2.0.
|
|
48
|
+
"@vue-interface/activity-indicator": "3.0.5",
|
|
49
|
+
"@vue-interface/form-control": "2.0.12"
|
|
50
50
|
},
|
|
51
51
|
"scripts": {
|
|
52
52
|
"dev": "vite",
|
package/src/InputField.vue
CHANGED
|
@@ -6,7 +6,8 @@ import { InputHTMLAttributes, useTemplateRef } from 'vue';
|
|
|
6
6
|
|
|
7
7
|
const props = withDefaults(defineProps<InputFieldProps<ModelValue,Value>>(), {
|
|
8
8
|
formControlClass: 'form-control',
|
|
9
|
-
labelClass: 'form-label'
|
|
9
|
+
labelClass: 'form-label',
|
|
10
|
+
size: 'form-control-md'
|
|
10
11
|
});
|
|
11
12
|
|
|
12
13
|
defineOptions({
|
|
@@ -17,13 +18,13 @@ const model = defineModel<ModelValue>();
|
|
|
17
18
|
|
|
18
19
|
defineSlots<FormControlSlots<InputFieldControlSizePrefix,ModelValue>>();
|
|
19
20
|
|
|
20
|
-
const emit = defineEmits<FormControlEvents
|
|
21
|
+
const emit = defineEmits<FormControlEvents>();
|
|
21
22
|
|
|
22
23
|
const {
|
|
23
24
|
controlAttributes,
|
|
24
25
|
formGroupClasses,
|
|
25
26
|
listeners
|
|
26
|
-
} = useFormControl<InputHTMLAttributes, InputFieldControlSizePrefix, ModelValue, Value>({ model, props, emit });
|
|
27
|
+
} = useFormControl<InputHTMLAttributes, InputFieldControlSizePrefix, ModelValue|undefined, Value>({ model, props, emit });
|
|
27
28
|
|
|
28
29
|
const field = useTemplateRef<HTMLInputElement>('field');
|
|
29
30
|
</script>
|