Skip to content

Commit

Permalink
feat(vstateselect): added states list
Browse files Browse the repository at this point in the history
Added the list of US states to VStateSelect
  • Loading branch information
morphatic committed Sep 8, 2019
1 parent ddb0875 commit f7c7ef1
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 5 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# VAddressFields

[![Build Status](https://travis-ci.org/morphatic/v-address-fields.svg?branch=master)](https://travis-ci.org/morphatic/v-address-fields)
[![Coverage Status](https://coveralls.io/repos/github/morphatic/v-address-fields/badge.svg?branch=master)](https://coveralls.io/github/morphatic/v-address-fields?branch=master)
[![NPM](https://img.shields.io/npm/v/v-address-fields)](https://www.npmjs.com/package/v-address-fields)
[![Downloads at NPM](https://img.shields.io/npm/dw/v-address-fields)](https://www.npmjs.com/package/v-address-fields)
[![GitHub](https://img.shields.io/github/license/morphatic/v-address-fields)](https://github.com/morphatic/v-address-fields/blob/master/LICENSE)
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
[![We use Semantic Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)

`VAddressFields` is a [Vue.js](https://vuejs.org) plugin that provides components for collecting postal address information. It extends [the Vuetify UI library](https://vuetifyjs.com) which implements the [Material design standard](https://material.io).

## Questions, Comments, Bug Reports, etc.
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,5 +121,8 @@
"commitizen": {
"path": "./node_modules/cz-conventional-changelog"
}
},
"dependencies": {
"usa-states": "^0.0.5"
}
}
17 changes: 13 additions & 4 deletions src/VStateSelect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
/// <reference path="../node_modules/vuetify/src/globals.d.ts" />
import Vue from 'vue'
// import { VuetifyThemeVariant } from 'vuetify/types/services/theme'
// import { ElementStyles } from '../types'

// 3rd Party Libs
// import merge from 'deepmerge' // EXAMPLE; You can remove this if you have no 3rd party libs
import { UsaStates } from 'usa-states'

// Styles
import './VStateSelect.sass'
Expand All @@ -25,8 +24,12 @@ interface options extends InstanceType<typeof base> {
* about here.
*/
foo: string
/**
* !Props inherited from VAutocomplete
*/
items: Object[]
}
// Extend VTextField to define the VStripeCard component
// Extend VAutocomplete to define the VStateSelect component
export default base.extend<options>().extend({
name: 'v-state-select',
props: {
Expand All @@ -36,10 +39,16 @@ export default base.extend<options>().extend({
},
},
data: () => ({
usaStates: new UsaStates(),
}),
computed: {},
watch: {},
mounted () {},
mounted () {
this.items = this.usaStates.format({
$text: 'name',
$value: 'abbr',
})
},
methods: {
bar () {
return 'baz'
Expand Down
7 changes: 6 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9807,7 +9807,7 @@ selfsigned@^1.10.4:
dependencies:
node-forge "0.7.5"

semantic-release@^15.13.21:
semantic-release@^15.13.24:
version "15.13.24"
resolved "https://registry.yarnpkg.com/semantic-release/-/semantic-release-15.13.24.tgz#f0b9544427d059ba5e3c89ac1545234130796be7"
integrity sha512-OPshm6HSp+KmZP9dUv1o3MRILDgOeHYWPI+XSpQRERMri7QkaEiIPkZzoNm2d6KDeFDnp03GphQQS4+Zfo+x/Q==
Expand Down Expand Up @@ -11223,6 +11223,11 @@ url@^0.11.0:
punycode "1.3.2"
querystring "0.2.0"

usa-states@^0.0.5:
version "0.0.5"
resolved "https://registry.yarnpkg.com/usa-states/-/usa-states-0.0.5.tgz#3a88c972def5345ae9b87186fc4402385b861bb7"
integrity sha1-OojJct71NFrpuHGG/EQCOFuGG7c=

use@^3.1.0:
version "3.1.1"
resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f"
Expand Down

0 comments on commit f7c7ef1

Please sign in to comment.