forked from bcgov/business-filings-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
18027 AGM Location change (bcgov#551)
* 18027-agm location details 1 * 18027-agm location details 2 * 18027-agm location details 3 * 18027-update package version * 18027-agm location details 4 * 18027-agm location details 5 * 18027-agm location details 6 * 18027-agm location details 7 * 18027-agm location details 8 * 18027-agm location details 9
- Loading branch information
1 parent
3f71127
commit 4ba88d2
Showing
21 changed files
with
504 additions
and
531 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,71 @@ | ||
<template> | ||
<v-text-field | ||
id="year-txt" | ||
ref="textAreaRef" | ||
hide-spin-buttons | ||
type="number" | ||
filled | ||
:label="label" | ||
:rules="rules" | ||
:value="value" | ||
validate-on-blur | ||
@input="emitInput($event)" | ||
/> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import { Component, Emit, Prop, Vue, Watch } from 'vue-property-decorator' | ||
import { Debounce } from 'vue-debounce-decorator' | ||
@Component({}) | ||
export default class AgmYear extends Vue { | ||
// Refs | ||
$refs!: { | ||
textAreaRef: any | ||
} | ||
@Prop({ default: '' }) readonly value!: string | ||
@Prop({ default: 'Year' }) readonly label!: string | ||
@Prop({ default: () => [] }) readonly rules!: any[] | ||
@Prop({ default: false }) readonly validateForm!: boolean | ||
agmYear = '' | ||
/** Called when component is created. */ | ||
created (): void { | ||
// inform parent of initial validity | ||
this.emitValid(this.value) | ||
} | ||
@Watch('value') | ||
@Debounce(300) | ||
onValueChanged (val: string): void { | ||
this.emitValid(val) | ||
} | ||
/** Validate business name field */ | ||
@Watch('validateForm') | ||
validateAgmYear (): void { | ||
if (this.validateForm && !this.agmYear) { | ||
this.$refs.textAreaRef.validate() | ||
this.$refs.textAreaRef.error = true | ||
} | ||
} | ||
/** Emits an event with the changed input (ie, updated v-model). */ | ||
@Emit('input') | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
emitInput (val: string): void {} | ||
/** Emits an event indicating whether or not this component is valid. */ | ||
@Emit('valid') | ||
emitValid (val: string): boolean { | ||
// component is valid if every rule is valid | ||
return this.rules.every(rule => rule(val) === true) | ||
} | ||
} | ||
</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
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
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
Oops, something went wrong.