@bildvitta/quasar-ui-asteroid 3.11.0-beta.11 → 3.11.0-beta.13

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.11.0-beta.11",
4
+ "version": "3.11.0-beta.13",
5
5
  "author": "Bild & Vitta <systemteam@bild.com.br>",
6
6
  "license": "MIT",
7
7
  "main": "dist/asteroid.cjs.min.js",
@@ -14,7 +14,7 @@
14
14
  <section class="text-body1 text-grey-8">
15
15
  <component :is="componentTag" ref="form">
16
16
  <slot name="description">
17
- <div v-if="card.description">{{ card.description }}</div>
17
+ <component :is="descriptionComponentTag">{{ card.description }}</component>
18
18
  </slot>
19
19
  </component>
20
20
  </section>
@@ -186,6 +186,14 @@ export default {
186
186
  useEqualWidth: this.hasAllActions,
187
187
  ...this.actionsProps
188
188
  }
189
+ },
190
+
191
+ hasRenderFunction () {
192
+ return typeof this.card.description?.render === 'function'
193
+ },
194
+
195
+ descriptionComponentTag () {
196
+ return this.hasRenderFunction ? this.card.description : 'div'
189
197
  }
190
198
  },
191
199
 
@@ -74,6 +74,7 @@ export default {
74
74
  filled = readonly,
75
75
  suffix,
76
76
  prefix,
77
+ places,
77
78
  type,
78
79
  mask,
79
80
  maxFiles,
@@ -104,7 +105,7 @@ export default {
104
105
  useIso
105
106
  }
106
107
 
107
- const numericInput = { is: 'qas-numeric-input', ...input }
108
+ const numericInput = { is: 'qas-numeric-input', places, ...input }
108
109
  const datetimeInput = { is: 'qas-date-time-input', useIso, ...input }
109
110
 
110
111
  // It'll generate a list of acceptable files extensions.
@@ -4,7 +4,7 @@
4
4
  <slot name="header" />
5
5
  </header>
6
6
 
7
- <q-form ref="form" @submit="submitHandler">
7
+ <q-form ref="form" v-bind="defaultFormProps">
8
8
  <slot />
9
9
 
10
10
  <slot v-if="useActions" name="actions">
@@ -76,6 +76,11 @@ export default {
76
76
  type: Boolean
77
77
  },
78
78
 
79
+ formProps: {
80
+ type: Object,
81
+ default: () => ({})
82
+ },
83
+
79
84
  mode: {
80
85
  default: 'create',
81
86
  type: String
@@ -191,6 +196,17 @@ export default {
191
196
  error: 'Não conseguimos salvar as informações. Por favor, tente novamente em alguns minutos.',
192
197
  success: 'Informações salvas com sucesso.'
193
198
  }
199
+ },
200
+
201
+ defaultFormProps () {
202
+ return {
203
+ ...this.formProps,
204
+
205
+ onSubmit: event => {
206
+ this.submitHandler(event)
207
+ this.formProps?.onSubmit?.(event)
208
+ }
209
+ }
194
210
  }
195
211
  },
196
212
 
@@ -66,6 +66,12 @@ props:
66
66
  examples: [v-model:fields="fields"]
67
67
  model: true
68
68
 
69
+ form-props:
70
+ desc: Repassa todas as props/eventos para o `QForm`.
71
+ default: {}
72
+ type: Object
73
+ examples: ['{ onValidationError: ref => validationErrorHandler(ref) }']
74
+
69
75
  ignore-keys-in-unsaved-changes:
70
76
  desc: Vamos imaginar um cenário onde você precisa alterar valores do v-model por qualquer motivo que seja, mas quando o usuário sair da tela, não pode aparecer o modal perguntando se ele quer sair ou continuar editando, por que o usuário de fato não fez nenhuma alteração nos dados, esta prop serve para você dizer quais keys dentro do v-model você quer ignorar.
71
77
  default: []
@@ -19,6 +19,11 @@ props:
19
19
  type: String
20
20
  examples: [xs, sm, md, lg, xl]
21
21
 
22
+ color:
23
+ desc: Cor da label.
24
+ default: grey-9
25
+ type: String
26
+
22
27
  slots:
23
28
  default:
24
29
  desc: Slot para acessar elemento do texto.
@@ -25,7 +25,7 @@ export default {
25
25
  type: Object
26
26
  },
27
27
 
28
- decimalPlaces: {
28
+ places: {
29
29
  default: 2,
30
30
  type: Number
31
31
  },
@@ -113,7 +113,7 @@ export default {
113
113
  }
114
114
 
115
115
  if (this.mode !== 'integer') {
116
- options.decimalPlaces = this.decimalPlaces
116
+ options.decimalPlaces = this.places
117
117
  }
118
118
 
119
119
  if (this.mode === 'money') {
@@ -12,7 +12,7 @@ props:
12
12
  default: {}
13
13
  type: Object
14
14
 
15
- decimal-places:
15
+ places:
16
16
  desc: Quantidade de casas decimais.
17
17
  default: 2
18
18
  type: Number
@@ -39,7 +39,7 @@
39
39
  position: relative;
40
40
 
41
41
  &:disabled {
42
- color: $grey-8 !important;
42
+ color: $grey-6 !important;
43
43
  }
44
44
  }
45
45
 
@@ -58,7 +58,7 @@
58
58
  padding: 0 !important;
59
59
 
60
60
  &:disabled {
61
- color: $grey-8 !important;
61
+ color: $grey-6 !important;
62
62
  }
63
63
 
64
64
  &-grey-9 {
@@ -20,11 +20,20 @@ export default function (config = {}) {
20
20
  const { entity, id, url } = deleteActionParams
21
21
 
22
22
  const defaultDialogProps = {
23
- card: { description: 'Tem certeza que deseja excluir este item?' },
23
+ ...dialogProps,
24
24
 
25
- ok: { label: 'Excluir', onClick: () => destroy.call(this) },
25
+ card: {
26
+ description: 'Tem certeza que deseja excluir este item?',
26
27
 
27
- ...dialogProps
28
+ ...dialogProps.card
29
+ },
30
+
31
+ ok: {
32
+ label: 'Excluir',
33
+ onClick: () => destroy.call(this),
34
+
35
+ ...dialogProps.ok
36
+ }
28
37
  }
29
38
 
30
39
  const defaultNotifyMessages = {