@bildvitta/quasar-ui-asteroid 3.5.0-beta.5 → 3.5.0-beta.6

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.5.0-beta.5",
4
+ "version": "3.5.0-beta.6",
5
5
  "author": "Bild & Vitta <systemteam@bild.com.br>",
6
6
  "license": "MIT",
7
7
  "main": "dist/asteroid.cjs.min.js",
@@ -149,28 +149,38 @@ export default {
149
149
  select: { is: 'qas-select', entity, name, multiple, options, useLazyLoading, ...input }
150
150
  }
151
151
 
152
- return { ...(profiles[type] || profiles.default), ...this.$attrs }
152
+ return {
153
+ ...(profiles[type] || profiles.default),
154
+ ...this.$attrs,
155
+ label: this.formattedLabel
156
+ }
153
157
  },
154
158
 
155
159
  errorMessage () {
156
160
  return Array.isArray(this.error) ? this.error.join(' ') : this.error
157
161
  },
158
162
 
163
+ formattedLabel () {
164
+ const nonRequiredFieldsLabel = ['boolean', 'checkbox', 'radio']
165
+
166
+ const label = this.$attrs.label || this.formattedField.label
167
+ const { required, type } = this.formattedField
168
+
169
+ if (required && label && !nonRequiredFieldsLabel.includes(type)) {
170
+ return `${label}*`
171
+ }
172
+
173
+ return label
174
+ },
175
+
159
176
  // This computed will change the key name when the server sends different key.
160
177
  formattedField () {
161
178
  const field = {}
162
- const nonRequiredFieldsLabel = ['boolean', 'checkbox', 'radio']
163
179
 
164
180
  for (const key in this.field) {
165
181
  field[attributesProfile[key] || key] = this.field[key]
166
182
  }
167
183
 
168
- const { label, required, type } = field
169
-
170
- if (required && label && !nonRequiredFieldsLabel.includes(type)) {
171
- field.label = `${label}*`
172
- }
173
-
174
184
  return field
175
185
  },
176
186
 
@@ -10,7 +10,7 @@
10
10
  <slot v-if="useActions" name="actions">
11
11
  <div class="justify-end q-col-gutter-md q-my-lg row">
12
12
  <div v-if="hasCancelButton" class="col-12 col-sm-2" :class="cancelButtonClass">
13
- <qas-btn v-close-popup class="full-width" :data-cy="`btnCancel-${entity}`" :disable="isCancelButtonDisabled" :label="cancelButtonLabel" outline type="button" @click="cancel" />
13
+ <qas-btn v-close-popup class="full-width" :data-cy="`btnCancel-${entity}`" :disable="isSubmitting" :label="cancelButtonLabel" outline type="button" @click="cancel" />
14
14
  </div>
15
15
 
16
16
  <div v-if="useSubmitButton" class="col-12 col-sm-2" :class="submitButtonClass">
@@ -194,10 +194,6 @@ export default {
194
194
  return this.$qas.screen.isSmall && 'order-first'
195
195
  },
196
196
 
197
- isCancelButtonDisabled () {
198
- return this.disable || this.isSubmitting
199
- },
200
-
201
197
  defaultNotifyMessages () {
202
198
  return {
203
199
  validationError: 'Existem campos no formulário que ainda não foram preenchidos. Complete todas as informações para avançar.',