Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/CED-1761' into CED-1761
Browse files Browse the repository at this point in the history
  • Loading branch information
tomleo committed Oct 3, 2024
2 parents 5374bd3 + b1872b6 commit ebbaee9
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 19 deletions.
18 changes: 18 additions & 0 deletions es-ds-components/components/es-button.vue
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,16 @@ const props = defineProps({
type: Boolean,
default: true,
},
// Url when using button as a link
href: {
type: String,
default: null,
},
// Url when using button as a link to an internal page
to: {
type: String,
default: null,
},
});
const getRootClasses = computed(() => {
Expand All @@ -73,7 +83,15 @@ const getRootClasses = computed(() => {
</script>

<template>
<nuxt-link
v-if="props.href || props.to"
:href="props.href || undefined"
:to="props.to || undefined"
:class="getRootClasses">
<slot />
</nuxt-link>
<prime-button
v-else
:pt="{
root: { class: getRootClasses },
}">
Expand Down
30 changes: 14 additions & 16 deletions es-ds-docs/pages/examples/form-field-validation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const state = reactive({
password: '',
phone: '',
maskedPhoneNumber: '',
// notes: '',
notes: '',
},
});
Expand All @@ -19,9 +19,9 @@ const rules = {
[vuelidateKeys.REQUIRED]: vuelidateRequired,
[vuelidateKeys.EMAIL]: vuelidateEmail,
},
// notes: {
// [vuelidateKeys.REQUIRED]: vuelidateRequired,
// },
notes: {
[vuelidateKeys.REQUIRED]: vuelidateRequired,
},
password: {
[vuelidateKeys.REQUIRED]: vuelidateRequired,
[vuelidateKeys.MIN_LENGTH]: vuelidateMinLength(8),
Expand Down Expand Up @@ -167,18 +167,16 @@ onMounted(async () => {
<template #label> Masked phone number </template>
<template #errorMessage> Please enter a valid phone number. </template>
</es-form-input>
<!-- <es-form-textarea-->
<!-- id="notes"-->
<!-- v-model="form.notes"-->
<!-- :disabled="isSubmitInProgress"-->
<!-- :state="validateState('form.notes')"-->
<!-- required-->
<!-- @change="touchOnChange('form.notes')"-->
<!-- @blur="$v.form.notes.$touch">-->
<!-- <template #label>-->
<!-- Notes-->
<!-- </template>-->
<!-- </es-form-textarea-->
<es-form-textarea
id="notes"
v-model="state.form.notes"
:disabled="isSubmitInProgress"
:state="validateState('form.notes')"
required
@change="touchOnChange('form.notes')"
@blur="v$.form.notes.$touch">
<template #label> Notes </template>
</es-form-textarea>
<div class="d-flex flex-grow-1 justify-content-end mt-200">
<es-button
type="submit"
Expand Down
14 changes: 11 additions & 3 deletions es-ds-docs/pages/molecules/button.vue
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ const linkExamples = ref([
]);
const propTableRows = ref([
['href', 'String', 'null', 'An external URL to navigate to when using a button as a link.'],
[
'inline',
'Boolean',
Expand All @@ -78,6 +79,7 @@ const propTableRows = ref([
],
['outline', 'Boolean', 'false', 'If true, changes to the outline version of the specified variant.'],
['size', 'String', '"md"', "The size of the button: 'md', or 'sm'."],
['to', 'String', 'null', 'An internal path to navigate to when using a button as a link'],
['variant', 'String', '"primary"', "The name of the desired button variant: 'primary', 'dark-bg', or 'link'."],
]);
Expand Down Expand Up @@ -107,11 +109,17 @@ onMounted(async () => {
<h1>Button</h1>
<p>
Extended from
<a
<nuxt-link
href="https://v3.primevue.org/button/"
target="_blank">
primevue button
</a>
PrimeVue Button
</nuxt-link>
and
<nuxt-link
href="https://nuxt.com/docs/api/components/nuxt-link"
target="_blank">
NuxtLink
</nuxt-link>
</p>
<p>
When using a button, please ensure that the copy style is
Expand Down

0 comments on commit ebbaee9

Please sign in to comment.