@bildvitta/quasar-ui-asteroid 3.3.0 → 3.3.1-beta.0

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bildvitta/quasar-ui-asteroid",
3
3
  "description": "Asteroid",
4
- "version": "3.3.0",
4
+ "version": "3.3.1-beta.0",
5
5
  "author": "Bild & Vitta <systemteam@bild.com.br>",
6
6
  "license": "MIT",
7
7
  "main": "dist/asteroid.cjs.min.js",
@@ -35,7 +35,7 @@
35
35
  "autoprefixer": "^10.4.2",
36
36
  "core-js": "^3.20.2",
37
37
  "postcss": "^8.4.5",
38
- "quasar": "^2.10.0",
38
+ "quasar": "^2.10.1",
39
39
  "rimraf": "^3.0.2",
40
40
  "rollup": "^2.66.0",
41
41
  "rollup-plugin-local-resolve": "^1.0.7",
@@ -47,7 +47,8 @@ export default {
47
47
  data () {
48
48
  return {
49
49
  errorData: false,
50
- messageErrorData: ''
50
+ messageErrorData: '',
51
+ mask: ''
51
52
  }
52
53
  },
53
54
 
@@ -60,13 +61,6 @@ export default {
60
61
  return this.$refs.input
61
62
  },
62
63
 
63
- mask () {
64
- const { mask } = this.$attrs
65
- const hasDefaultMask = Object.prototype.hasOwnProperty.call(this.masks, mask)
66
-
67
- return hasDefaultMask ? this.masks[mask]() : mask
68
- },
69
-
70
64
  masks () {
71
65
  return {
72
66
  'company-document': () => '##.###.###/####-##',
@@ -83,10 +77,7 @@ export default {
83
77
  },
84
78
 
85
79
  set (value) {
86
- if (this.useRemoveErrorOnType && this.error) {
87
- this.errorData = false
88
- this.errorMessageData = ''
89
- }
80
+ this.handleErrors()
90
81
 
91
82
  return this.$emit('update:modelValue', value)
92
83
  }
@@ -94,7 +85,9 @@ export default {
94
85
  },
95
86
 
96
87
  watch: {
97
- mask () {
88
+ mask (value) {
89
+ if (!value) return
90
+
98
91
  const input = this.getInput()
99
92
 
100
93
  requestAnimationFrame(() => {
@@ -102,6 +95,13 @@ export default {
102
95
  })
103
96
  },
104
97
 
98
+ modelValue: {
99
+ handler () {
100
+ this.handleMask()
101
+ },
102
+ immediate: true
103
+ },
104
+
105
105
  error: {
106
106
  handler (value) {
107
107
  this.errorData = value
@@ -129,8 +129,6 @@ export default {
129
129
  },
130
130
 
131
131
  toggleMask (first, second) {
132
- if (!this.modelValue?.length) return
133
-
134
132
  const length = first.split('#').length - 2
135
133
  return this.modelValue?.length > length ? second : first
136
134
  },
@@ -152,7 +150,25 @@ export default {
152
150
  },
153
151
 
154
152
  getInput () {
155
- return this.inputReference.$el?.querySelector('input')
153
+ return this.inputReference?.$el?.querySelector('input')
154
+ },
155
+
156
+ handleErrors () {
157
+ if (this.useRemoveErrorOnType && this.error) {
158
+ this.errorData = false
159
+ this.errorMessageData = ''
160
+ }
161
+ },
162
+
163
+ handleMask () {
164
+ if (!this.modelValue?.length) return
165
+
166
+ const { mask } = this.$attrs
167
+ const hasDefaultMask = Object.prototype.hasOwnProperty.call(this.masks, mask)
168
+
169
+ this.$nextTick(() => {
170
+ this.mask = hasDefaultMask ? this.masks[mask]() : mask
171
+ })
156
172
  }
157
173
  }
158
174
  }