@a-vision-software/vue-input-components 1.4.10 → 1.4.11

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@a-vision-software/vue-input-components",
3
- "version": "1.4.10",
3
+ "version": "1.4.11",
4
4
  "description": "A collection of reusable Vue 3 input components with TypeScript support",
5
5
  "author": "A-Vision Software",
6
6
  "license": "MIT",
@@ -121,7 +121,7 @@ const filterInput = ref<HTMLInputElement | null>(null)
121
121
 
122
122
  const selectedOptions = computed(() => {
123
123
  if (Array.isArray(props.modelValue)) {
124
- return props.options.filter((option) => props.modelValue.includes(option.id))
124
+ return props.options.filter((option) => props.modelValue?.includes(option.id))
125
125
  }
126
126
  return props.options.filter((option) => option.id === props.modelValue)
127
127
  })
@@ -272,7 +272,7 @@ watch(
272
272
  () => props.modelValue,
273
273
  (newValue) => {
274
274
  if (props.type === 'date' && newValue) {
275
- dateValue.value = parseDateFromModel(newValue)
275
+ dateValue.value = parseDateFromModel(newValue as string)
276
276
  }
277
277
  },
278
278
  )
@@ -6,7 +6,7 @@ export interface DropdownOption {
6
6
 
7
7
  export interface DropdownProps {
8
8
  options: DropdownOption[]
9
- modelValue: string | string[]
9
+ modelValue: string | string[] | null
10
10
  multiple?: boolean
11
11
  placeholder?: string
12
12
  filterable?: boolean
@@ -1,6 +1,6 @@
1
1
  export interface NavigationItem {
2
2
  id: string
3
- label: string
3
+ label?: string
4
4
  url?: string
5
5
  icon?: string
6
6
  disabled?: boolean
@@ -1,7 +1,6 @@
1
- export interface TextInputProps {
2
- modelValue: string
1
+ export type TextInputProps =
2
+ {
3
3
  required?: boolean
4
- type?: 'text' | 'textarea' | 'password' | 'email' | 'tel' | 'url' | 'date' | 'number'
5
4
  placeholder?: string
6
5
  label?: string
7
6
  labelPosition?: 'top' | 'left'
@@ -19,7 +18,16 @@ export interface TextInputProps {
19
18
  bgColor?: string
20
19
  autosave?: (value: string) => Promise<void>
21
20
  error?: string
22
- }
21
+ } & (
22
+ | {
23
+ modelValue: string
24
+ type?: 'text' | 'textarea' | 'password' | 'email' | 'tel' | 'url' | 'date'
25
+ }
26
+ | {
27
+ modelValue: number
28
+ type: 'number'
29
+ }
30
+ )
23
31
 
24
32
  export interface TextInputEmits {
25
33
  (e: 'update:modelValue', value: string): void
@@ -48,6 +48,8 @@
48
48
  label-position="top" label-align="left" />
49
49
  <TextInput v-model="comment" label="Comment" type="text" placeholder="Your comment" label-position="top"
50
50
  label-align="left" />
51
+ <TextInput v-model="age" type="number" label="Age" placeholder="Enter your age" label-position="top"
52
+ label-align="left" />
51
53
  </div>
52
54
  </div>
53
55
  </div>
@@ -66,6 +68,7 @@ const postalCode = ref('')
66
68
  const country = ref('')
67
69
  const birthDate = ref('1967-08-22')
68
70
  const comment = ref('')
71
+ const age = ref(0)
69
72
  const bio = ref('')
70
73
  const feedback = ref('')
71
74