lau-ecom-design-system 1.0.29 → 1.0.30
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.
@@ -1430,6 +1430,13 @@ var script$l = /*@__PURE__*/vue.defineComponent({
|
|
1430
1430
|
emit('update:modelValue', '');
|
1431
1431
|
emit('clear');
|
1432
1432
|
};
|
1433
|
+
var handleSearch = function handleSearch() {
|
1434
|
+
if (inputValue.value) {
|
1435
|
+
emit('search', inputValue.value);
|
1436
|
+
inputValue.value = '';
|
1437
|
+
emit('update:modelValue', '');
|
1438
|
+
}
|
1439
|
+
};
|
1433
1440
|
var handleKeyUp = function handleKeyUp(event) {
|
1434
1441
|
if (event.key === 'Enter' && inputValue.value) {
|
1435
1442
|
emit('search', inputValue.value);
|
@@ -1470,11 +1477,7 @@ var script$l = /*@__PURE__*/vue.defineComponent({
|
|
1470
1477
|
}, null, 8 /* PROPS */, ["width", "height", "class"])], 2 /* CLASS */)) : vue.createCommentVNode("v-if", true), vue.createCommentVNode(" Icono de búsqueda "), vue.createElementVNode("button", {
|
1471
1478
|
type: "button",
|
1472
1479
|
class: vue.normalizeClass(['dsEcom-absolute dsEcom-right-0 dsEcom-top-0 dsEcom-bottom-0', 'dsEcom-flex dsEcom-items-center dsEcom-justify-center', 'dsEcom-px-4', 'dsEcom-transition-colors dsEcom-duration-300', 'dsEcom-rounded-r-lg', _ctx.searchIconBgClass, 'hover:dsEcom-opacity-80']),
|
1473
|
-
onClick:
|
1474
|
-
emit('search', inputValue.value.value);
|
1475
|
-
inputValue.value.value = '';
|
1476
|
-
emit('update:modelValue', '');
|
1477
|
-
})
|
1480
|
+
onClick: handleSearch
|
1478
1481
|
}, [vue.createVNode(vue.unref(script$r), {
|
1479
1482
|
width: _ctx.searchIconSize.width,
|
1480
1483
|
height: _ctx.searchIconSize.height,
|
package/package.json
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
<script lang="ts" setup>
|
2
|
-
import { ref, computed } from 'vue';
|
2
|
+
import { ref, computed, type Ref } from 'vue';
|
3
3
|
import { LauEcomUpcIconSearch, LauEcomUpcIconClose } from '../LauEcomIcon';
|
4
4
|
|
5
5
|
interface Props {
|
@@ -56,7 +56,7 @@ const emit = defineEmits<{
|
|
56
56
|
(e: 'blur', event: FocusEvent): void;
|
57
57
|
}>();
|
58
58
|
|
59
|
-
const inputValue = ref(props.modelValue);
|
59
|
+
const inputValue: Ref<string> = ref(props.modelValue);
|
60
60
|
|
61
61
|
const inputClasses = computed(() => [
|
62
62
|
'dsEcom-w-full',
|
@@ -82,6 +82,14 @@ const handleClear = () => {
|
|
82
82
|
emit('clear');
|
83
83
|
};
|
84
84
|
|
85
|
+
const handleSearch = () => {
|
86
|
+
if (inputValue.value) {
|
87
|
+
emit('search', inputValue.value);
|
88
|
+
inputValue.value = '';
|
89
|
+
emit('update:modelValue', '');
|
90
|
+
}
|
91
|
+
};
|
92
|
+
|
85
93
|
const handleKeyUp = (event: KeyboardEvent) => {
|
86
94
|
if (event.key === 'Enter' && inputValue.value) {
|
87
95
|
emit('search', inputValue.value);
|
@@ -138,11 +146,7 @@ const handleKeyUp = (event: KeyboardEvent) => {
|
|
138
146
|
searchIconBgClass,
|
139
147
|
'hover:dsEcom-opacity-80'
|
140
148
|
]"
|
141
|
-
@click="
|
142
|
-
emit('search', inputValue.value);
|
143
|
-
inputValue.value = '';
|
144
|
-
emit('update:modelValue', '');
|
145
|
-
}"
|
149
|
+
@click="handleSearch"
|
146
150
|
>
|
147
151
|
<LauEcomUpcIconSearch
|
148
152
|
:width="searchIconSize.width"
|