Skip to content

Commit 9afb187

Browse files
committed
fix tests
1 parent bfbc6f5 commit 9afb187

3 files changed

Lines changed: 4 additions & 14 deletions

File tree

lib/components/SInputDate.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<script setup lang="ts">
22
import { type MaskaDetail } from 'maska'
3+
import { vMaska } from 'maska/vue'
34
import { type Component, computed } from 'vue'
45
import { type Validatable } from '../composables/Validation'
56
import { type Day, day } from '../support/Day'
@@ -37,7 +38,7 @@ const value = computed(() => {
3738
return props.modelValue ? day(props.modelValue).format('YYYY-MM-DD') : null
3839
})
3940
40-
function onChange(detail: MaskaDetail): void {
41+
function onMaska(detail: MaskaDetail): void {
4142
if (!detail.unmasked) {
4243
emit('update:model-value', null)
4344
} else if (detail.completed) {
@@ -48,6 +49,7 @@ function onChange(detail: MaskaDetail): void {
4849

4950
<template>
5051
<SInputText
52+
v-maska="{ mask: '####-##-##', eager: true, onMaska }"
5153
class="SInputDate"
5254
:class="classes"
5355
:size
@@ -65,8 +67,6 @@ function onChange(detail: MaskaDetail): void {
6567
:model-value="value"
6668
:validation
6769
:hide-error
68-
:maska="{ mask: '####-##-##', eager: true }"
69-
@maska="onChange"
7070
>
7171
<template v-if="$slots.info" #info><slot name="info" /></template>
7272
</SInputText>

lib/components/SInputText.vue

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
<script setup lang="ts">
2-
import { type MaskInputOptions, type MaskaDetail } from 'maska'
3-
import { vMaska } from 'maska/vue'
42
import { type Component, computed, ref } from 'vue'
53
import SInputBase, { type Props as BaseProps } from './SInputBase.vue'
64
@@ -10,7 +8,6 @@ export interface Props extends BaseProps {
108
placeholder?: string
119
unitBefore?: Component | string
1210
unitAfter?: Component | string
13-
maska?: string | MaskInputOptions
1411
textColor?: TextColor | ((value: string | null) => TextColor)
1512
align?: Align
1613
disabled?: boolean
@@ -29,7 +26,6 @@ const emit = defineEmits<{
2926
'input': [value: string | null]
3027
'blur': [value: string | null]
3128
'enter': [value: string | null]
32-
'maska': [detail: MaskaDetail]
3329
}>()
3430
3531
const input = ref<HTMLElement | null>(null)
@@ -96,10 +92,6 @@ function emitEnter(e: KeyboardEvent): void {
9692
emit('enter', value)
9793
}
9894
99-
function emitMaska(e: CustomEvent<MaskaDetail>): void {
100-
emit('maska', e.detail)
101-
}
102-
10395
function getValue(e: Event | FocusEvent | KeyboardEvent): string | null {
10496
const value = (e.target as HTMLInputElement).value
10597
@@ -140,7 +132,6 @@ function getValue(e: Event | FocusEvent | KeyboardEvent): string | null {
140132
<input
141133
:id="name"
142134
ref="input"
143-
v-maska="maska"
144135
class="input entity"
145136
:class="inputClasses"
146137
:type="type ?? 'text'"
@@ -152,7 +143,6 @@ function getValue(e: Event | FocusEvent | KeyboardEvent): string | null {
152143
@blur="emitBlur"
153144
@input="emitInput"
154145
@keypress.enter="emitEnter"
155-
@maska="emitMaska"
156146
>
157147
<div v-if="showDisplay" class="input display" :class="[textColor]">
158148
{{ displayValue }}

lib/components/STableCell.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const computedCell = computed<TableCell | undefined>(() =>
3636
:record
3737
:align="computedCell?.align"
3838
:icon="computedCell?.icon"
39-
:text="computedCell?.value ?? value"
39+
:text="String(computedCell?.value ?? value)"
4040
:link="computedCell?.link"
4141
:color="computedCell?.color"
4242
:icon-color="computedCell?.iconColor"

0 commit comments

Comments
 (0)