@bcrs-shared-components/base-address 2.0.2 → 2.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/BaseAddress.stories.ts +30 -2
- package/BaseAddress.vue +2 -2
- package/package.json +6 -6
package/BaseAddress.stories.ts
CHANGED
|
@@ -1,12 +1,40 @@
|
|
|
1
1
|
import type { Meta } from '@storybook/vue'
|
|
2
2
|
import { BaseAddress } from './index'
|
|
3
3
|
import Vuetify from 'vuetify'
|
|
4
|
+
import { required, maxLength } from 'vuelidate/lib/validators'
|
|
4
5
|
|
|
5
6
|
const meta: Meta<typeof BaseAddress> = {
|
|
6
7
|
title: 'component/BaseAddress'
|
|
7
8
|
}
|
|
8
9
|
export default meta
|
|
9
10
|
|
|
11
|
+
const PersonAddressSchema = {
|
|
12
|
+
streetAddress: {
|
|
13
|
+
required,
|
|
14
|
+
maxLength: maxLength(50)
|
|
15
|
+
},
|
|
16
|
+
streetAddressAdditional: {
|
|
17
|
+
maxLength: maxLength(50)
|
|
18
|
+
},
|
|
19
|
+
addressCity: {
|
|
20
|
+
required,
|
|
21
|
+
maxLength: maxLength(40)
|
|
22
|
+
},
|
|
23
|
+
addressCountry: {
|
|
24
|
+
required
|
|
25
|
+
},
|
|
26
|
+
addressRegion: {
|
|
27
|
+
maxLength: maxLength(2)
|
|
28
|
+
},
|
|
29
|
+
postalCode: {
|
|
30
|
+
required,
|
|
31
|
+
maxLength: maxLength(15)
|
|
32
|
+
},
|
|
33
|
+
deliveryInstructions: {
|
|
34
|
+
maxLength: maxLength(80)
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
10
38
|
const Template = (args, { argTypes }) => ({
|
|
11
39
|
vuetify: new Vuetify({ iconfont: 'mdi' }),
|
|
12
40
|
props: Object.keys(argTypes),
|
|
@@ -17,13 +45,13 @@ const Template = (args, { argTypes }) => ({
|
|
|
17
45
|
export const DefaultBaseAddress = Template.bind({})
|
|
18
46
|
DefaultBaseAddress['args'] = {
|
|
19
47
|
editing: true,
|
|
20
|
-
schema:
|
|
48
|
+
schema: PersonAddressSchema,
|
|
21
49
|
address: {}
|
|
22
50
|
}
|
|
23
51
|
export const FilledInBaseAddress = Template.bind({})
|
|
24
52
|
FilledInBaseAddress['args'] = {
|
|
25
53
|
editing: true,
|
|
26
|
-
schema:
|
|
54
|
+
schema: PersonAddressSchema,
|
|
27
55
|
address: {
|
|
28
56
|
streetAddress: '1234 Sesame Street',
|
|
29
57
|
streetAddressAdditional: '4th Floor',
|
package/BaseAddress.vue
CHANGED
|
@@ -167,7 +167,7 @@
|
|
|
167
167
|
import Vue from 'vue'
|
|
168
168
|
import { required } from 'vuelidate/lib/validators'
|
|
169
169
|
import { Component, Mixins, Emit, Prop, Watch } from 'vue-property-decorator'
|
|
170
|
-
import {
|
|
170
|
+
import { Validations } from 'vuelidate-property-decorators'
|
|
171
171
|
import { uniqueId } from 'lodash'
|
|
172
172
|
import { ValidationMixin, CountriesProvincesMixin } from '@bcrs-shared-components/mixins'
|
|
173
173
|
|
|
@@ -185,7 +185,7 @@ export default class BaseAddress extends Mixins(ValidationMixin, CountriesProvin
|
|
|
185
185
|
* The validation object used by Vuelidate to compute address model validity.
|
|
186
186
|
* @returns the Vuelidate validations object
|
|
187
187
|
*/
|
|
188
|
-
@
|
|
188
|
+
@Validations()
|
|
189
189
|
public validations (): any {
|
|
190
190
|
return { addressLocal: { ...this.schemaLocal } }
|
|
191
191
|
}
|
package/package.json
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bcrs-shared-components/base-address",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.4",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@bcrs-shared-components/mixins": "^1.1.
|
|
8
|
+
"@bcrs-shared-components/mixins": "^1.1.22",
|
|
9
9
|
"lodash.uniqueid": "^4.0.1",
|
|
10
10
|
"vue": "^2.7.14",
|
|
11
|
-
"vuelidate": "
|
|
11
|
+
"vuelidate": "0.6.2"
|
|
12
12
|
},
|
|
13
13
|
"devDependencies": {
|
|
14
|
-
"vue-
|
|
15
|
-
"
|
|
14
|
+
"vue-property-decorator": "^9.1.2",
|
|
15
|
+
"vuelidate-property-decorators": "1.0.28"
|
|
16
16
|
},
|
|
17
|
-
"gitHead": "
|
|
17
|
+
"gitHead": "8aa48a4d757beca88cfe28074be0c76a2847cbb2"
|
|
18
18
|
}
|