@bildvitta/quasar-ui-asteroid 3.0.0-alpha.3 → 3.0.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.
Files changed (73) hide show
  1. package/dist/api/QasBtn.json +5 -2
  2. package/dist/api/QasDelete.json +5 -0
  3. package/dist/api/QasFilters.json +4 -0
  4. package/dist/api/QasFormView.json +6 -4
  5. package/dist/api/QasInput.json +16 -1
  6. package/dist/api/QasPasswordInput.json +2 -1
  7. package/dist/api/QasSignatureUploader.json +7 -0
  8. package/dist/asteroid.cjs.css +1 -1
  9. package/dist/asteroid.cjs.js +792 -653
  10. package/dist/asteroid.cjs.min.js +2 -2
  11. package/dist/asteroid.esm.css +1 -1
  12. package/dist/asteroid.esm.js +794 -654
  13. package/dist/asteroid.esm.min.js +2 -2
  14. package/dist/asteroid.umd.css +1 -1
  15. package/dist/asteroid.umd.js +794 -654
  16. package/dist/asteroid.umd.min.js +2 -2
  17. package/dist/vetur/asteroid-attributes.json +31 -3
  18. package/dist/vetur/asteroid-tags.json +11 -4
  19. package/package.json +1 -1
  20. package/src/asteroid.js +1 -0
  21. package/src/components/actions/QasActions.vue +1 -5
  22. package/src/components/actions-menu/QasActionsMenu.vue +3 -5
  23. package/src/components/app-menu/QasAppMenu.vue +1 -4
  24. package/src/components/btn/QasBtn.vue +12 -11
  25. package/src/components/btn/QasBtn.yml +4 -1
  26. package/src/components/delete/QasDelete.vue +23 -1
  27. package/src/components/delete/QasDelete.yml +4 -0
  28. package/src/components/dialog/QasDialog.vue +4 -8
  29. package/src/components/field/QasField.vue +1 -2
  30. package/src/components/filters/QasFilters.vue +6 -2
  31. package/src/components/filters/QasFilters.yml +4 -0
  32. package/src/components/form-view/QasFormView.vue +14 -14
  33. package/src/components/form-view/QasFormView.yml +8 -3
  34. package/src/components/gallery/QasGallery.vue +4 -8
  35. package/src/components/input/QasInput.vue +43 -2
  36. package/src/components/input/QasInput.yml +13 -1
  37. package/src/components/nested-fields/QasNestedFields.vue +47 -35
  38. package/src/components/page-header/QasPageHeader.vue +4 -2
  39. package/src/components/password-input/QasPasswordInput.vue +17 -26
  40. package/src/components/password-input/QasPasswordInput.yml +1 -1
  41. package/src/components/profile/QasProfile.vue +2 -5
  42. package/src/components/search-box/QasSearchBox.vue +6 -1
  43. package/src/components/select-list/QasSelectList.vue +12 -13
  44. package/src/components/signature-uploader/QasSignatureUploader.vue +35 -2
  45. package/src/components/signature-uploader/QasSignatureUploader.yml +5 -0
  46. package/src/components/table-generator/QasTableGenerator.vue +3 -6
  47. package/src/components/text-truncate/QasTextTruncate.vue +1 -4
  48. package/src/components/transfer/QasTransfer.vue +12 -13
  49. package/src/components/uploader/QasUploader.vue +1 -2
  50. package/src/composables/index.js +1 -0
  51. package/src/composables/useForm.js +3 -0
  52. package/src/composables/useHistory.js +46 -0
  53. package/src/css/design-system/button.scss +6 -0
  54. package/src/css/design-system/index.scss +2 -0
  55. package/src/css/design-system/typography.scss +91 -0
  56. package/src/directives/Test.js +13 -0
  57. package/src/helpers/filter-list-by-handle.js +31 -0
  58. package/src/helpers/filter-object-to-array.js +29 -0
  59. package/src/helpers/filter-object.js +2 -3
  60. package/src/helpers/index.js +2 -0
  61. package/src/index.scss +4 -2
  62. package/src/mixins/index.js +1 -3
  63. package/src/mixins/view.js +2 -0
  64. package/src/pages/Forbidden.vue +12 -0
  65. package/src/pages/NotFound.vue +12 -0
  66. package/src/plugins/index.js +2 -0
  67. package/src/plugins/screen/Screen.js +35 -0
  68. package/src/plugins/screen/Screen.yml +16 -0
  69. package/src/vue-plugin.js +12 -3
  70. package/src/css/transitions.scss +0 -12
  71. package/src/mixins/screen.js +0 -34
  72. package/src/store/history.js +0 -43
  73. package/src/store/index.js +0 -1
@@ -123,6 +123,10 @@
123
123
  "description": "Esconde o rótulo (label) do botão quando o tamanho da tela for pequeno.",
124
124
  "type": "boolean"
125
125
  },
126
+ "qas-btn/label": {
127
+ "description": "Rótulo do botão.",
128
+ "type": "string"
129
+ },
126
130
  "qas-card/bg-image-position": {
127
131
  "description": "Posição da imagem \"background-position\".",
128
132
  "type": "string"
@@ -227,6 +231,10 @@
227
231
  "description": "Model para saber se está deletando.",
228
232
  "type": "boolean"
229
233
  },
234
+ "qas-delete/use-auto-delete-route": {
235
+ "description": "Controla se sempre que deletar com sucesso um item, remove todas as rotas do histórico de rotas que contenha id do item deletado.",
236
+ "type": "boolean"
237
+ },
230
238
  "qas-dialog/actions-props": {
231
239
  "description": "Props repassadas para o \"QasActions\".",
232
240
  "type": "object"
@@ -311,6 +319,10 @@
311
319
  "description": "Envia como parâmetro para a action \"fetchFilters\" do modulo correspondente a \"entity\".",
312
320
  "type": "string"
313
321
  },
322
+ "qas-filters/force-refetch": {
323
+ "description": "Força refazer o \"fetch\" mesmo caso já exista dados na store de filters.",
324
+ "type": "boolean"
325
+ },
314
326
  "qas-form-generator/error": {
315
327
  "description": "Objeto contendo propriedades contendo a mensagem de erro.",
316
328
  "type": "object"
@@ -344,8 +356,8 @@
344
356
  "type": "string"
345
357
  },
346
358
  "qas-form-view/cancel-route": {
347
- "description": "Configuração do botão de \"cancelar\", caso seja \"false\", não exibe o botão, caso precise passar uma path direto use como string, e se precisar passar uma configuração como \"name\" ou \"params\" passe como objeto.",
348
- "type": "boolean|object|string"
359
+ "description": "Configuração do botão de \"cancelar\", caso seja \"false\", não exibe o botão, caso precise passar uma path direto use como string, caso precisar passar uma configuração como \"name\" ou \"params\" passe como objeto, agora se precisar de uma logica especifica quando clicar no botão de cancelar, você pode passar uma função que ela será executado.",
360
+ "type": "boolean|object|string|function"
349
361
  },
350
362
  "qas-form-view/custom-id": {
351
363
  "description": "Por padrão, o componente vai pegar o \"id\" que vem como parâmetro na url, caso queira que o id seja diferente da url, use esta prop.",
@@ -481,7 +493,7 @@
481
493
  },
482
494
  "qas-input/model-value": {
483
495
  "description": "Model do componente.",
484
- "type": "string"
496
+ "type": "string|input"
485
497
  },
486
498
  "qas-input/unmasked-value": {
487
499
  "description": "Remove a mascara do v-model.",
@@ -491,6 +503,18 @@
491
503
  "description": "Controla borda do input.",
492
504
  "type": "boolean"
493
505
  },
506
+ "qas-input/error": {
507
+ "description": "Controla cor da borda do input.",
508
+ "type": "boolean"
509
+ },
510
+ "qas-input/error-message": {
511
+ "description": "Controla mensagem de erro (apenas quando \"error\" for \"true\").",
512
+ "type": "string"
513
+ },
514
+ "qas-input/remove-error-on-type": {
515
+ "description": "Limpa os erros do campo caso os mesmos existam toda vez que o model atualiza.",
516
+ "type": "boolean"
517
+ },
494
518
  "qas-label/count": {
495
519
  "description": "Contador que vai ficar ao lado do texto.",
496
520
  "type": "number"
@@ -947,6 +971,10 @@
947
971
  "description": "Tipo da imagem gerada.",
948
972
  "type": "string"
949
973
  },
974
+ "qas-signature-uploader/dialog-props": {
975
+ "description": "Repassa propriedades para o \"QasDialog\".",
976
+ "type": "object"
977
+ },
950
978
  "qas-signature-uploader/upload-label": {
951
979
  "description": "Rótulo do uploader.",
952
980
  "type": "string"
@@ -71,7 +71,8 @@
71
71
  },
72
72
  "qas-btn": {
73
73
  "attributes": [
74
- "hide-label-on-small-screen"
74
+ "hide-label-on-small-screen",
75
+ "label"
75
76
  ],
76
77
  "description": "O mesmo botão do Quasar (QBtn), mas com o nosso estilo, tem acesso a todas propriedades do componente do quasar. Tem a função de criar gatilhos para ações. Eles podem ser utilizados isoladamente ou ​​como parte de outros componentes de padrões maiores, como formulários, caixas de diálogo e feedbacks."
77
78
  },
@@ -127,7 +128,8 @@
127
128
  "dialog-props",
128
129
  "url",
129
130
  "tag",
130
- "deleting"
131
+ "deleting",
132
+ "use-auto-delete-route"
131
133
  ],
132
134
  "description": "Componente para C.R.U.D. responsável por deletar (Delete)."
133
135
  },
@@ -167,7 +169,8 @@
167
169
  "use-search",
168
170
  "use-search-on-type",
169
171
  "search-placeholder",
170
- "url"
172
+ "url",
173
+ "force-refetch"
171
174
  ],
172
175
  "description": "Componente para criação de filtros dinâmicos."
173
176
  },
@@ -237,7 +240,10 @@
237
240
  "attributes": [
238
241
  "model-value",
239
242
  "unmasked-value",
240
- "outlined"
243
+ "outlined",
244
+ "error",
245
+ "error-message",
246
+ "remove-error-on-type"
241
247
  ],
242
248
  "description": "Componente para input que implementa o \"QInput\" repassando propriedades, slots e eventos."
243
249
  },
@@ -437,6 +443,7 @@
437
443
  },
438
444
  "qas-signature-uploader": {
439
445
  "attributes": [
446
+ "dialog-props",
440
447
  "upload-label",
441
448
  "signature-label",
442
449
  "model-value",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bildvitta/quasar-ui-asteroid",
3
3
  "description": "Asteroid",
4
- "version": "3.0.0-alpha.3",
4
+ "version": "3.0.0-beta.3",
5
5
  "author": "Bild & Vitta <systemteam@bild.com.br>",
6
6
  "license": "MIT",
7
7
  "main": "dist/asteroid.cjs.min.js",
package/src/asteroid.js CHANGED
@@ -1,3 +1,4 @@
1
1
  export * from './helpers'
2
2
  export * from './mixins'
3
3
  export * from './vue-plugin'
4
+ export * from './composables'
@@ -11,13 +11,9 @@
11
11
  </template>
12
12
 
13
13
  <script>
14
- import { screenMixin } from '../../mixins'
15
-
16
14
  export default {
17
15
  name: 'QasActions',
18
16
 
19
- mixins: [screenMixin],
20
-
21
17
  props: {
22
18
  align: {
23
19
  default: 'end',
@@ -37,7 +33,7 @@ export default {
37
33
  return [
38
34
  `justify-${this.align}`,
39
35
  `q-col-gutter-${this.gutter}`,
40
- this.mx_isSmall ? 'column reverse' : 'row'
36
+ this.$qas.screen.isSmall ? 'column reverse' : 'row'
41
37
  ]
42
38
  }
43
39
  }
@@ -1,14 +1,12 @@
1
1
  <template>
2
- <qas-btn class="qas-actions-menu" color="primary" hide-label-on-small-screen :icon="icon" :label="label" outline>
3
- <span>{{ label }}</span>
4
-
2
+ <qas-btn class="qas-actions-menu" color="primary" hide-label-on-small-screen :icon="icon" :label="label" outline padding="md">
5
3
  <q-menu class="qas-actions-menu__menu">
6
4
  <q-list class="qas-actions-menu__list" separator>
7
5
  <slot v-for="(item, key) in list" :item="item" :name="key">
8
6
  <q-item :key="key" class="text-bold text-primary" clickable v-bind="item.props" @click="onClick(item)">
9
7
  <q-item-section>
10
8
  <div class="flex items-center justify-center q-gutter-x-md">
11
- <q-icon :name="item.icon" :size="item.iconSize" />
9
+ <q-icon :name="item.icon" size="sm" />
12
10
  <div>{{ item.label }}</div>
13
11
  </div>
14
12
  </q-item-section>
@@ -18,7 +16,7 @@
18
16
  <qas-delete v-if="hasDelete" v-bind="deleteProps" class="text-negative" clickable tag="q-item" @success="onDeleteSuccess">
19
17
  <q-item-section>
20
18
  <div class="flex items-center justify-center q-gutter-x-sm text-bold">
21
- <q-icon :name="deleteIcon" />
19
+ <q-icon :name="deleteIcon" size="sm" />
22
20
  <div>{{ deleteLabel }}</div>
23
21
  </div>
24
22
  </q-item-section>
@@ -44,14 +44,11 @@
44
44
  </template>
45
45
 
46
46
  <script>
47
- import { screenMixin } from '../../mixins'
48
47
  import { isLocalDevelopment } from '../../helpers'
49
48
 
50
49
  export default {
51
50
  name: 'QasAppMenu',
52
51
 
53
- mixins: [screenMixin],
54
-
55
52
  props: {
56
53
  items: {
57
54
  default: () => [],
@@ -153,7 +150,7 @@ export default {
153
150
  },
154
151
 
155
152
  beforeHide () {
156
- if (this.mx_isLarge) {
153
+ if (this.$qas.screen.isLarge) {
157
154
  this.model = true
158
155
  this.miniMode = !this.miniMode
159
156
  }
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <q-btn color="primary" no-caps unelevated v-bind="attributes">
3
- <slot v-if="showLabel">{{ $attrs.label }}</slot>
3
+ <slot v-if="showLabel" />
4
4
 
5
5
  <template v-for="(_, name) in slots" #[name]="context">
6
6
  <slot :name="name" v-bind="context || {}" />
@@ -9,33 +9,34 @@
9
9
  </template>
10
10
 
11
11
  <script>
12
- import { screenMixin } from '../../mixins'
13
-
14
12
  export default {
15
13
  name: 'QasBtn',
16
14
 
17
- mixins: [screenMixin],
18
-
19
- inheritAttrs: false,
20
-
21
15
  props: {
22
16
  hideLabelOnSmallScreen: {
23
17
  type: Boolean
18
+ },
19
+
20
+ label: {
21
+ type: String,
22
+ default: ''
24
23
  }
25
24
  },
26
25
 
27
26
  computed: {
28
27
  attributes () {
29
- const { label, ...attributes } = this.$attrs
30
- return attributes
28
+ return {
29
+ ...(this.showLabel && { label: this.label }),
30
+ ...this.$attrs
31
+ }
31
32
  },
32
33
 
33
34
  hasLabel () {
34
- return !!(this.$attrs.label || this.$slots.default)
35
+ return !!(this.label || this.$slots.default)
35
36
  },
36
37
 
37
38
  showLabel () {
38
- return this.hasLabel && !(this.hideLabelOnSmallScreen && this.mx_isSmall)
39
+ return this.hasLabel && !(this.hideLabelOnSmallScreen && this.$qas.screen.isSmall)
39
40
  },
40
41
 
41
42
  slots () {
@@ -10,4 +10,7 @@ props:
10
10
  hide-label-on-small-screen:
11
11
  desc: Esconde o rótulo (label) do botão quando o tamanho da tela for pequeno.
12
12
  type: Boolean
13
- default: 'false'
13
+
14
+ label:
15
+ desc: Rótulo do botão.
16
+ type: String
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <component :is="tag" v-bind="$attrs" @click="openConfirmDialog">
2
+ <component v-bind="$attrs" :is="tag" @click="openConfirmDialog">
3
3
  <template v-for="(_, name) in $slots" #[name]="context">
4
4
  <slot :name="name" v-bind="context || {}" />
5
5
  </template>
@@ -11,6 +11,7 @@
11
11
  <script>
12
12
  import { Loading } from 'quasar'
13
13
  import { NotifyError, NotifySuccess } from '../../plugins'
14
+ import { useHistory } from '../../composables'
14
15
 
15
16
  import QasBtn from '../btn/QasBtn.vue'
16
17
  import QasDialog from '../dialog/QasDialog.vue'
@@ -51,6 +52,11 @@ export default {
51
52
 
52
53
  deleting: {
53
54
  type: Boolean
55
+ },
56
+
57
+ useAutoDeleteRoute: {
58
+ default: true,
59
+ type: Boolean
54
60
  }
55
61
  },
56
62
 
@@ -98,9 +104,21 @@ export default {
98
104
  this.$emit('update:deleting', true)
99
105
 
100
106
  try {
107
+ const { destroyRoutes, history } = useHistory()
108
+
101
109
  await this.$store.dispatch(`${this.entity}/destroy`, { id: this.id, url: this.url })
110
+
102
111
  NotifySuccess('Item deletado com sucesso!')
112
+
113
+ if (this.useAutoDeleteRoute) {
114
+ // remove todas rotas que possuem o id do item excluído.
115
+ const routesToBeDeleted = this.getRoutesToBeDeletedById(history.list)
116
+ destroyRoutes(routesToBeDeleted)
117
+ }
118
+
119
+ // cria um evento para notificar que o item foi excluído no "window".
103
120
  this.createDeleteSuccessEvent()
121
+
104
122
  this.$emit('success')
105
123
  } catch (error) {
106
124
  NotifyError('Ops! Não foi possível deletar o item.')
@@ -111,6 +129,10 @@ export default {
111
129
  }
112
130
  },
113
131
 
132
+ getRoutesToBeDeletedById (routes = []) {
133
+ return routes.filter(({ params }) => params.id === this.id)
134
+ },
135
+
114
136
  createDeleteSuccessEvent () {
115
137
  const event = new CustomEvent('delete-success', {
116
138
  bubbles: false,
@@ -35,6 +35,10 @@ props:
35
35
  examples: [v-model:deleting="isDeleting"]
36
36
  model: true
37
37
 
38
+ use-auto-delete-route:
39
+ desc: Controla se sempre que deletar com sucesso um item, remove todas as rotas do histórico de rotas que contenha id do item deletado.
40
+ default: true
41
+ type: Boolean
38
42
 
39
43
  slots:
40
44
  default:
@@ -39,8 +39,6 @@
39
39
  import QasBtn from '../btn/QasBtn.vue'
40
40
  import QasActions from '../actions/QasActions.vue'
41
41
 
42
- import screenMixin from '../../mixins/screen'
43
-
44
42
  export default {
45
43
  name: 'QasDialog',
46
44
 
@@ -49,8 +47,6 @@ export default {
49
47
  QasActions
50
48
  },
51
49
 
52
- mixins: [screenMixin],
53
-
54
50
  props: {
55
51
  actionsProps: {
56
52
  default: () => ({}),
@@ -133,8 +129,8 @@ export default {
133
129
 
134
130
  style () {
135
131
  return {
136
- maxWidth: this.maxWidth || (this.mx_isSmall ? '' : '600px'),
137
- minWidth: this.minWidth || (this.mx_isSmall ? '' : '400px')
132
+ maxWidth: this.maxWidth || (this.$qas.screen.isSmall ? '' : '600px'),
133
+ minWidth: this.minWidth || (this.$qas.screen.isSmall ? '' : '400px')
138
134
  }
139
135
  },
140
136
 
@@ -155,12 +151,12 @@ export default {
155
151
  this.useForm && this.$emit('validate', await this.$refs.form.validate())
156
152
  },
157
153
 
158
- // metodo para funcionar como plugin
154
+ // método para funcionar como plugin
159
155
  show () {
160
156
  this.$refs.dialog.show()
161
157
  },
162
158
 
163
- // metodo para funcionar como plugin
159
+ // método para funcionar como plugin
164
160
  hide () {
165
161
  this.$refs.dialog.hide()
166
162
  },
@@ -74,7 +74,6 @@ export default {
74
74
  prefix,
75
75
  type,
76
76
  mask,
77
- pattern,
78
77
  maxFiles,
79
78
  searchable,
80
79
  gmt
@@ -125,7 +124,7 @@ export default {
125
124
  number: { is: 'qas-input', type: 'number', ...input },
126
125
  hidden: { is: 'input', name, type },
127
126
  email: { is: 'qas-input', type, ...input },
128
- password: { is: 'qas-password-input', type, pattern, hideStrengthChecker: !pattern, ...input },
127
+ password: { is: 'qas-password-input', ...input },
129
128
 
130
129
  decimal: { ...numericInput, mode: 'decimal' },
131
130
  money: { ...numericInput, mode: 'money' },
@@ -16,7 +16,7 @@
16
16
 
17
17
  <slot v-if="showFilterButton" :filter="filter" name="filter-button">
18
18
  <q-btn v-if="useFilterButton" :color="filterButtonColor" flat icon="o_filter_list" :label="filterButtonLabel">
19
- <q-menu @before-show="fetchFilters">
19
+ <q-menu>
20
20
  <div v-if="isFetching" class="q-pa-xl text-center">
21
21
  <q-spinner color="grey" size="2em" />
22
22
  </div>
@@ -98,6 +98,10 @@ export default {
98
98
  url: {
99
99
  default: '',
100
100
  type: String
101
+ },
102
+
103
+ forceRefetch: {
104
+ type: Boolean
101
105
  }
102
106
  },
103
107
 
@@ -227,7 +231,7 @@ export default {
227
231
  },
228
232
 
229
233
  async fetchFilters () {
230
- if (this.hasFields || !this.useFilterButton) {
234
+ if (!this.forceRefetch && (this.hasFields || !this.useFilterButton)) {
231
235
  return null
232
236
  }
233
237
 
@@ -38,6 +38,10 @@ props:
38
38
  desc: Envia como parâmetro para a action "fetchFilters" do modulo correspondente a "entity".
39
39
  type: String
40
40
 
41
+ force-refetch:
42
+ desc: Força refazer o "fetch" mesmo caso já exista dados na store de filters.
43
+ type: Boolean
44
+
41
45
  slots:
42
46
  search:
43
47
  desc: Slot para seção do campo de busca.
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <component :is="mx_componentTag">
2
+ <component :is="mx_componentTag" :class="mx_componentClass">
3
3
  <header v-if="mx_hasHeaderSlot">
4
4
  <slot name="header" />
5
5
  </header>
@@ -36,13 +36,13 @@ import { isEqualWith } from 'lodash-es'
36
36
  import { extend } from 'quasar'
37
37
  import { onBeforeRouteLeave } from 'vue-router'
38
38
 
39
- import { addRoute, history } from '../../store/history'
39
+ import { useHistory } from '../../composables'
40
40
  import { NotifyError, NotifySuccess } from '../../plugins'
41
41
 
42
42
  import QasBtn from '../btn/QasBtn.vue'
43
43
  import QasDialog from '../dialog/QasDialog.vue'
44
44
 
45
- import { viewMixin, screenMixin } from '../../mixins'
45
+ import { viewMixin } from '../../mixins'
46
46
 
47
47
  export default {
48
48
  name: 'QasFormView',
@@ -52,7 +52,7 @@ export default {
52
52
  QasDialog
53
53
  },
54
54
 
55
- mixins: [viewMixin, screenMixin],
55
+ mixins: [viewMixin],
56
56
 
57
57
  props: {
58
58
  cancelButton: {
@@ -62,7 +62,7 @@ export default {
62
62
 
63
63
  cancelRoute: {
64
64
  default: '',
65
- type: [Boolean, Object, String]
65
+ type: [Boolean, Object, String, Function]
66
66
  },
67
67
 
68
68
  customId: {
@@ -146,7 +146,7 @@ export default {
146
146
 
147
147
  computed: {
148
148
  cancelButtonClass () {
149
- return this.mx_isSmall && 'order-last'
149
+ return this.$qas.screen.isSmall && 'order-last'
150
150
  },
151
151
 
152
152
  fetchURL () {
@@ -174,17 +174,13 @@ export default {
174
174
  },
175
175
 
176
176
  saveButtonClass () {
177
- return this.mx_isSmall && 'order-first'
177
+ return this.$qas.screen.isSmall && 'order-first'
178
178
  },
179
179
 
180
180
  isCancelButtonDisabled () {
181
181
  return this.disable || this.isSubmitting
182
182
  },
183
183
 
184
- history () {
185
- return history.list
186
- },
187
-
188
184
  fieldsNameWithDefaultValue () {
189
185
  return Object.keys(this.fields).filter(field => 'default' in this.fields[field])
190
186
  }
@@ -253,7 +249,7 @@ export default {
253
249
  this.mx_updateModels({
254
250
  errors: errors,
255
251
  fields: this.mx_fields,
256
- metadata: metadata
252
+ metadata
257
253
  })
258
254
 
259
255
  if (result) {
@@ -282,9 +278,11 @@ export default {
282
278
  },
283
279
 
284
280
  handleCancelRoute () {
285
- const acceptTypes = ['string', 'object']
281
+ if (typeof this.cancelRoute === 'function') {
282
+ return this.cancelRoute()
283
+ }
286
284
 
287
- if (this.cancelRoute && acceptTypes.includes(typeof this.cancelRoute)) {
285
+ if (this.cancelRoute && ['string', 'object'].includes(typeof this.cancelRoute)) {
288
286
  return this.$router.push(this.cancelRoute)
289
287
  }
290
288
 
@@ -297,6 +295,8 @@ export default {
297
295
  handleDialog (next) {
298
296
  this.openDialog()
299
297
 
298
+ const { addRoute } = useHistory()
299
+
300
300
  this.defaultDialogProps.ok.onClick = () => addRoute(this.$route)
301
301
  this.defaultDialogProps.cancel.onClick = next
302
302
  },
@@ -10,10 +10,15 @@ props:
10
10
  type: String
11
11
 
12
12
  cancel-route:
13
- desc: Configuração do botão de "cancelar", caso seja "false", não exibe o botão, caso precise passar uma path direto use como string, e se precisar passar uma configuração como "name" ou "params" passe como objeto.
13
+ desc: Configuração do botão de "cancelar", caso seja "false", não exibe o botão, caso precise passar uma path direto use como string, caso precisar passar uma configuração como "name" ou "params" passe como objeto, agora se precisar de uma logica especifica quando clicar no botão de cancelar, você pode passar uma função que ela será executado.
14
14
  default: "''"
15
- type: [Boolean, Object, String]
16
- examples: [/users, "false", "{ name: 'UsersForm', params: { id: 'uuid-1' } }"]
15
+ type: [Boolean, Object, String, Function]
16
+ examples: [
17
+ /users,
18
+ false,
19
+ "{ name: 'UsersForm', params: { id: 'uuid-1' } }",
20
+ () => alert('Lógica especifica.')
21
+ ]
17
22
 
18
23
  custom-id:
19
24
  desc: Por padrão, o componente vai pegar o "id" que vem como parâmetro na url, caso queira que o id seja diferente da url, use esta prop.
@@ -17,9 +17,9 @@
17
17
  </div>
18
18
  </template>
19
19
  <template #description>
20
- <q-carousel v-model="imageIndex" animated :arrows="!mx_isSmall" control-text-color="primary" :fullscreen="mx_isSmall" :height="carouselImageHeight" :next-icon="carouselNextIcon" :prev-icon="carouselPreviousIcon" swipeable :thumbnails="showThumbnails">
20
+ <q-carousel v-model="imageIndex" animated :arrows="!$qas.screen.isSmall" control-text-color="primary" :fullscreen="$qas.screen.isSmall" :height="carouselImageHeight" :next-icon="carouselNextIcon" :prev-icon="carouselPreviousIcon" swipeable :thumbnails="showThumbnails">
21
21
  <q-carousel-slide v-for="(image, index) in clonedImages" :key="index" class="bg-no-repeat bg-size-contain" :img-src="image" :name="index">
22
- <div v-if="mx_isSmall" class="full-width justify-end row">
22
+ <div v-if="$qas.screen.isSmall" class="full-width justify-end row">
23
23
  <qas-btn dense flat icon="o_close" @click="toggleCarouselDialog" />
24
24
  </div>
25
25
  </q-carousel-slide>
@@ -31,13 +31,9 @@
31
31
  </template>
32
32
 
33
33
  <script>
34
- import screenMixin from '../../mixins/screen'
35
-
36
34
  export default {
37
35
  name: 'QasGallery',
38
36
 
39
- mixins: [screenMixin],
40
-
41
37
  props: {
42
38
  carouselNextIcon: {
43
39
  type: String,
@@ -94,13 +90,13 @@ export default {
94
90
  return this.height || 'auto'
95
91
  }
96
92
 
97
- return this.mx_isSmall ? '90px' : '120px'
93
+ return this.$qas.screen.isSmall ? '90px' : '120px'
98
94
  },
99
95
 
100
96
  galleryColumnsClasses () {
101
97
  if (this.isSingleImage) return 'col-12'
102
98
 
103
- return this.mx_isSmall ? 'col-6' : 'col-2'
99
+ return this.$qas.screen.isSmall ? 'col-6' : 'col-2'
104
100
  },
105
101
 
106
102
  hideShowMore () {