Files
nimbus/resources/js/components/base/input-group/AppInputGroupAddon.vue
Mazen Touati e1b844cee0 feat(history): add history viewer and rewind (#38)
* feat(ui): add `input group` base component

* feat(history): add history viewer and rewind

* test: update selector snapshot

* test: add PW base page

* style: apply TS style fixes

* chore(history): request history wiki

* chore(history): remove unwanted symbol

* chore: fix type

* style: apply TS style fixes
2026-01-17 20:50:00 +01:00

41 lines
1.0 KiB
Vue

<script setup lang="ts">
import { cn } from '@/utils';
import type { HTMLAttributes } from 'vue';
import type { InputGroupVariants } from '.';
import { inputGroupAddonVariants } from '.';
const props = withDefaults(
defineProps<{
align?: InputGroupVariants['align'];
class?: HTMLAttributes['class'];
}>(),
{
align: 'inline-start',
class: undefined,
},
);
function handleInputGroupAddonClick(e: MouseEvent) {
const currentTarget = e.currentTarget as HTMLElement | null;
const target = e.target as HTMLElement | null;
if (target && target.closest('button')) {
return;
}
if (currentTarget && currentTarget?.parentElement) {
currentTarget.parentElement?.querySelector('input')?.focus();
}
}
</script>
<template>
<div
role="group"
data-slot="input-group-addon"
:data-align="props.align"
:class="cn(inputGroupAddonVariants({ align: props.align }), props.class)"
@click="handleInputGroupAddonClick"
>
<slot />
</div>
</template>