-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add boostrap4 single and multi error templates.
* add bindingProps and bindingActions to default scopedSlots * add new isValid computed property * add messages prop to formWrapper. Allows injecting local messages to all singleExtractor fields.
- Loading branch information
1 parent
fd1d4d5
commit 39e185d
Showing
11 changed files
with
197 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<template> | ||
<base-multi-error-extractor v-bind="$attrs" class="was-validated"> | ||
<template slot-scope="{ errorMessage }"> | ||
<label class="invalid-feedback d-block">{{ errorMessage }}</label> | ||
</template> | ||
</base-multi-error-extractor> | ||
</template> | ||
|
||
<script> | ||
import baseMultiErrorExtractor from './baseMultiErrorExtractor.vue' | ||
export default { | ||
inheritAttrs: false, | ||
components: { | ||
baseMultiErrorExtractor | ||
} | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
import baseMultiErrorExtractor from './baseMultiErrorExtractor.vue' | ||
import bootstrap3 from './bootstrap3.vue' | ||
import bootstrap4 from './bootstrap4.vue' | ||
import foundation6 from './foundation6.vue' | ||
|
||
export default { | ||
baseMultiErrorExtractor, | ||
bootstrap3, | ||
bootstrap4, | ||
foundation6 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<template> | ||
<div> | ||
<slot name="label"> | ||
<label>{{ label }}</label> | ||
</slot> | ||
<slot | ||
:attributes="attributes" | ||
:errors="activeErrors" | ||
:events="events" | ||
:first-error-message="firstErrorMessage" | ||
:has-errors="hasErrors" | ||
:validator="preferredValidator" | ||
/> | ||
<slot | ||
name="errors" | ||
:errors="activeErrors" | ||
:error-messages="activeErrorMessages" | ||
:has-errors="hasErrors" | ||
:first-error-message="firstErrorMessage" | ||
> | ||
<div | ||
:class="{ 'invalid-feedback': hasErrors, 'valid-feedback': !hasErrors }" | ||
v-if="hasErrors"> | ||
<template v-if="showSingleError">{{ firstErrorMessage }}</template> | ||
<template v-else> | ||
<div | ||
v-for="errorMessage in activeErrorMessages" | ||
:key="errorMessage" | ||
> | ||
{{ errorMessage }} | ||
</div> | ||
</template> | ||
</div> | ||
</slot> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import singleErrorExtractorMixin from '../../single-error-extractor-mixin' | ||
export default { | ||
name: 'Bootstrap4', | ||
mixins: [singleErrorExtractorMixin], | ||
computed: { | ||
attributes () { | ||
return { | ||
class: { 'form-control': true, 'is-invalid': this.hasErrors, 'is-valid': this.isValid }, | ||
name: this.name || undefined | ||
} | ||
} | ||
} | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
import foundation6 from './foundation6.vue' | ||
import bootstrap3 from './bootstrap3.vue' | ||
import bootstrap4 from './bootstrap4.vue' | ||
|
||
export default { | ||
foundation6, | ||
bootstrap3 | ||
bootstrap3, | ||
bootstrap4 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters