@bildvitta/quasar-ui-asteroid 3.7.0-beta.2 → 3.7.0-beta.3

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.7.0-beta.2",
4
+ "version": "3.7.0-beta.3",
5
5
  "author": "Bild & Vitta <systemteam@bild.com.br>",
6
6
  "license": "MIT",
7
7
  "main": "dist/asteroid.cjs.min.js",
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <q-input ref="input" v-model="model" bottom-slots :error="errorData" v-bind="$attrs" :error-message="errorMessageData" :mask="mask" :outlined="outlined" :unmasked-value="unmaskedValue" @paste="onPaste">
2
+ <q-input ref="input" v-model="model" bottom-slots :error="errorData" v-bind="$attrs" :error-message="errorMessage" :mask="mask" :outlined="outlined" :unmasked-value="unmaskedValue" @paste="onPaste">
3
3
  <template v-for="(_, name) in $slots" #[name]="context">
4
4
  <slot :name="name" v-bind="context || {}" />
5
5
  </template>
@@ -47,7 +47,6 @@ export default {
47
47
  data () {
48
48
  return {
49
49
  errorData: false,
50
- messageErrorData: '',
51
50
  mask: ''
52
51
  }
53
52
  },
@@ -107,14 +106,6 @@ export default {
107
106
  this.errorData = value
108
107
  },
109
108
 
110
- immediate: true
111
- },
112
-
113
- errorMessage: {
114
- handler (value) {
115
- this.errorMessageData = value
116
- },
117
-
118
109
  immediate: true
119
110
  }
120
111
  },
@@ -156,7 +147,6 @@ export default {
156
147
  handleErrors () {
157
148
  if (this.useRemoveErrorOnType && this.error) {
158
149
  this.errorData = false
159
- this.errorMessageData = ''
160
150
  }
161
151
  },
162
152
 
@@ -1,7 +1,11 @@
1
1
  <template>
2
- <qas-input v-model="model" :bottom-slots="hasBottomSlots" v-bind="$attrs" :type="type" use-remove-error-on-type>
2
+ <qas-input v-model="model" class="qas-password-input" :hide-bottom-space="hideBottomSpace" v-bind="$attrs" :type="type" use-remove-error-on-type>
3
+ <template #prepend>
4
+ <q-icon color="grey-8" name="sym_r_lock" />
5
+ </template>
6
+
3
7
  <template #append>
4
- <q-icon class="cursor-pointer" :color="iconColor" :name="icon" @click="toggle" />
8
+ <qas-btn color="primary" :icon="icon" variant="tertiary" @click="toggle" />
5
9
  </template>
6
10
 
7
11
  <template v-for="(_, name) in $slots" #[name]="context">
@@ -9,7 +13,7 @@
9
13
  </template>
10
14
 
11
15
  <template v-if="hasStrengthChecker" #hint>
12
- <qas-password-strength-checker v-bind="strengthCheckerProps" :password="model" />
16
+ <qas-password-strength-checker v-bind="strengthCheckerProps" :password="model" @update:current-level="updateCurrentLevel" />
13
17
  </template>
14
18
  </qas-input>
15
19
  </template>
@@ -37,18 +41,13 @@ export default {
37
41
  type: Boolean
38
42
  },
39
43
 
40
- iconColor: {
41
- type: String,
42
- default: 'primary'
43
- },
44
-
45
44
  modelValue: {
46
45
  type: String,
47
46
  default: ''
48
47
  }
49
48
  },
50
49
 
51
- emits: ['update:modelValue'],
50
+ emits: ['update:modelValue', 'update:currentLevel'],
52
51
 
53
52
  data () {
54
53
  return {
@@ -72,7 +71,12 @@ export default {
72
71
  },
73
72
 
74
73
  strengthCheckerProps () {
75
- const { modelValue, ...props } = this.$props
74
+ const {
75
+ modelValue,
76
+ useStrengthChecker,
77
+ ...props
78
+ } = this.$props
79
+
76
80
  return props
77
81
  },
78
82
 
@@ -86,12 +90,20 @@ export default {
86
90
 
87
91
  hasStrengthChecker () {
88
92
  return this.useStrengthChecker && this.hasBottomSlots
93
+ },
94
+
95
+ hideBottomSpace () {
96
+ return this.$attrs.error || !!this.model.length
89
97
  }
90
98
  },
91
99
 
92
100
  methods: {
93
101
  toggle () {
94
102
  this.toggleType = !this.toggleType
103
+ },
104
+
105
+ updateCurrentLevel (currentLevel) {
106
+ this.$emit('update:currentLevel', currentLevel)
95
107
  }
96
108
  }
97
109
  }
@@ -7,10 +7,11 @@ mixins:
7
7
  - '@bildvitta/quasar-ui-asteroid/dist/api/QasInput.json'
8
8
  - quasar/dist/api/QInput.json
9
9
  props:
10
- icon-color:
11
- desc: Cor do ícone do input.
12
- default: primary
13
- type: String
10
+ current-level:
11
+ desc: model que tem o valor atual do level.
12
+ default: 0
13
+ type: Number
14
+ model: true
14
15
 
15
16
  levels:
16
17
  desc: Níveis de força da senha, é um objeto de objeto.
@@ -101,3 +102,10 @@ events:
101
102
  value:
102
103
  desc: Novo valor do v-model
103
104
  type: Boolean
105
+
106
+ '@update:current-level -> function (level)':
107
+ desc: Dispara toda vez que o level (score) é atualizado.
108
+ params:
109
+ level:
110
+ desc: Novo valor do v-model:currentLevel
111
+ type: Boolean
@@ -1,8 +1,8 @@
1
1
  <template>
2
2
  <div v-if="length">
3
3
  <slot :level="level">
4
- <q-linear-progress :color="level.color" :track-color="trackColor" :value="level.progress" />
5
- <div class="text-caption" :class="level.textClass">{{ level.label }}</div>
4
+ <q-linear-progress :color="level.color" rounded :track-color="trackColor" :value="level.progress" />
5
+ <div class="q-mt-sm text-subtitle2" :class="level.textClass">{{ level.label }}</div>
6
6
  </slot>
7
7
  </div>
8
8
  </template>
@@ -16,18 +16,13 @@ export default {
16
16
  mixins: [passwordMixin],
17
17
 
18
18
  props: {
19
- modelValue: {
20
- default: false,
21
- type: Boolean
22
- },
23
-
24
19
  password: {
25
20
  default: '',
26
21
  type: String
27
22
  }
28
23
  },
29
24
 
30
- emits: ['update:modelValue'],
25
+ emits: ['update:modelValue', 'update:currentLevel'],
31
26
 
32
27
  computed: {
33
28
  length () {
@@ -64,18 +59,12 @@ export default {
64
59
  },
65
60
 
66
61
  watch: {
67
- password () {
68
- this.emitValue()
69
- }
70
- },
71
-
72
- created () {
73
- this.emitValue()
74
- },
62
+ score: {
63
+ handler (score) {
64
+ this.$emit('update:currentLevel', score)
65
+ },
75
66
 
76
- methods: {
77
- emitValue () {
78
- this.$emit('update:modelValue', this.score === 4)
67
+ immediate: true
79
68
  }
80
69
  }
81
70
  }
@@ -4,6 +4,12 @@ meta:
4
4
  desc: Componente para checar nível de força da senha.
5
5
 
6
6
  props:
7
+ current-level:
8
+ desc: model que tem o valor atual do level.
9
+ default: 0
10
+ type: Number
11
+ model: true
12
+
7
13
  levels:
8
14
  desc: Níveis de força da senha, é um objeto de objeto.
9
15
  type: [Object, Boolean]
@@ -44,12 +50,6 @@ props:
44
50
  desc: Senha para ser usado nas validações.
45
51
  type: String
46
52
 
47
- model-value:
48
- desc: Model do componente, retorna se passou ou não na validação de senha.
49
- type: Boolean
50
- examples: [v-model="value"]
51
- model: true
52
-
53
53
  minlength:
54
54
  desc: Número mínimo de caracteres.
55
55
  default: 8
@@ -95,9 +95,9 @@ slots:
95
95
  type: Object
96
96
 
97
97
  events:
98
- '@update:model-value -> function (value)':
99
- desc: Dispara toda vez que o model é atualizado, também utilizado para v-model.
98
+ '@update:current-level -> function (level)':
99
+ desc: Dispara toda vez que o level (score) é atualizado.
100
100
  params:
101
- value:
102
- desc: Novo valor do v-model
101
+ level:
102
+ desc: Novo valor do v-model:currentLevel
103
103
  type: Boolean
@@ -37,6 +37,11 @@ const levels = {
37
37
 
38
38
  export default {
39
39
  props: {
40
+ currentLevel: {
41
+ default: 0,
42
+ type: Number
43
+ },
44
+
40
45
  levels: {
41
46
  default: () => levels,
42
47
  type: Object