Skip to content

Commit

Permalink
remove default title implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
AmonDeShir committed Dec 12, 2024
1 parent 053b462 commit dd0c8c7
Showing 1 changed file with 2 additions and 23 deletions.
25 changes: 2 additions & 23 deletions resources/js/components/Crud/CrudItem.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<script setup lang="ts" generic="T extends { id: string | number }">
<script setup lang="ts" generic="T extends { id: string | number, createdAt: string, updatedAt: string }">
import useRequestResolution from '@/Helpers/RequestResolution'
import InputWrapper from '@/components/QuizzesPanel/InputWrapper.vue'

Check failure on line 3 in resources/js/components/Crud/CrudItem.vue

View workflow job for this annotation

GitHub Actions / Test & lint JS codebase

'InputWrapper' is defined but never used
import RequestWrapper from '@/components/Common/RequestWrapper.vue'
Expand Down Expand Up @@ -58,28 +58,7 @@ const showDeleteMessage = ref(false)

<div class="flex justify-between">
<div class="size-full md:h-auto px-0">
<slot name="title" :item="item as T" :editing="editing" :errors="errors">
<InputWrapper
v-if="!slots.title"
:has-content="!!item.name || editing"
:error="errors.name"
:show-error="editing"
>
<input
v-model="item.name"
v-dynamic-input-width
type="text"
name="name"
autocomplete="off"
class="w-full outline-none font-bold border-b border-transparent duration-200 transition-colors text-lg bg-transparent focus:border-b-primary"
:class="{
'border-b-primary/30 duration-200 transition-colors hover:border-b-primary/60 text-primary' : editing,
'border-b-red' : errors.name
}"
:disabled="!editing"
>
</InputWrapper>
</slot>
<slot name="title" :item="item as T" :editing="editing" :errors="errors" />

<div class="h-full md:hidden pt-1">
<slot name="data" :item="item as T" :editing="editing" :errors="errors" />
Expand Down

0 comments on commit dd0c8c7

Please sign in to comment.