Skip to content

Commit

Permalink
feat(j-components): add hints prop to j-text-field
Browse files Browse the repository at this point in the history
  • Loading branch information
phojie committed Nov 6, 2022
1 parent c7fbc12 commit a425843
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
8 changes: 7 additions & 1 deletion resources/js/j-components/JTextField.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,12 @@ const details = computed(() => {
if (props.isDirty)
return props.errorMessage
return props.hints
else
return props.hints
})
const hasDetails = computed(() => {
return props.isDirty || props.hints
})
// autofocus
Expand Down Expand Up @@ -93,6 +98,7 @@ onMounted(() => {

<!-- details -->
<p
v-if="hasDetails"
:id="`${id}-details`"
:class="[isDirty ? 'text-error-600' : 'text-gray-500']"
class="mt-1 text-sm"
Expand Down
1 change: 1 addition & 0 deletions resources/js/j-components/Types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export interface TextField {
modelValue?: string
label?: string
appendInnerIcon?: string
hints?: string
errorMessage?: string
autofocus?: boolean

Expand Down

0 comments on commit a425843

Please sign in to comment.