@bildvitta/quasar-ui-asteroid 3.0.0-beta.2 → 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 (33) hide show
  1. package/dist/api/QasBtn.json +5 -2
  2. package/dist/asteroid.cjs.js +370 -419
  3. package/dist/asteroid.cjs.min.js +2 -2
  4. package/dist/asteroid.esm.css +1 -1
  5. package/dist/asteroid.esm.js +370 -419
  6. package/dist/asteroid.esm.min.js +2 -2
  7. package/dist/asteroid.umd.css +1 -1
  8. package/dist/asteroid.umd.js +373 -422
  9. package/dist/asteroid.umd.min.js +2 -2
  10. package/dist/vetur/asteroid-attributes.json +4 -0
  11. package/dist/vetur/asteroid-tags.json +2 -1
  12. package/package.json +1 -1
  13. package/src/components/actions/QasActions.vue +1 -5
  14. package/src/components/app-menu/QasAppMenu.vue +1 -4
  15. package/src/components/btn/QasBtn.vue +9 -10
  16. package/src/components/btn/QasBtn.yml +4 -1
  17. package/src/components/dialog/QasDialog.vue +2 -6
  18. package/src/components/form-view/QasFormView.vue +4 -4
  19. package/src/components/gallery/QasGallery.vue +4 -8
  20. package/src/components/profile/QasProfile.vue +2 -5
  21. package/src/components/select-list/QasSelectList.vue +2 -5
  22. package/src/components/signature-uploader/QasSignatureUploader.vue +6 -9
  23. package/src/components/table-generator/QasTableGenerator.vue +1 -4
  24. package/src/components/text-truncate/QasTextTruncate.vue +1 -4
  25. package/src/components/transfer/QasTransfer.vue +3 -6
  26. package/src/composables/useForm.js +3 -0
  27. package/src/css/design-system/button.scss +6 -0
  28. package/src/css/design-system/index.scss +2 -0
  29. package/src/css/design-system/typography.scss +91 -0
  30. package/src/index.scss +1 -0
  31. package/src/mixins/index.js +1 -3
  32. package/src/plugins/screen/Screen.js +5 -0
  33. package/src/mixins/screen.js +0 -34
@@ -1,10 +1,10 @@
1
1
  /*!
2
- * @bildvitta/quasar-ui-asteroid v3.0.0-beta.2
2
+ * @bildvitta/quasar-ui-asteroid v3.0.0-beta.3
3
3
  * (c) 2022 Bild & Vitta <systemteam@bild.com.br>
4
4
  * Released under the MIT License.
5
5
  */
6
+ import { openBlock, createElementBlock, normalizeClass, createElementVNode, renderSlot, resolveComponent, createBlock, mergeProps, createSlots, withCtx, createCommentVNode, renderList, normalizeProps, guardReactiveProps, createVNode, Fragment, toDisplayString, resolveDynamicComponent, createTextVNode, resolveDirective, withDirectives, reactive, computed, markRaw, vShow, normalizeStyle, withModifiers, TransitionGroup } from 'vue';
6
7
  import { camelize, camelizeKeys } from 'humps';
7
- import { markRaw, openBlock, createElementBlock, normalizeClass, createElementVNode, renderSlot, resolveComponent, createBlock, mergeProps, createSlots, withCtx, createCommentVNode, renderList, normalizeProps, guardReactiveProps, createVNode, Fragment, toDisplayString, resolveDynamicComponent, createTextVNode, resolveDirective, withDirectives, reactive, computed, vShow, normalizeStyle, withModifiers, TransitionGroup } from 'vue';
8
8
  import { parseISO, format, isMatch } from 'date-fns';
9
9
  import { ptBR } from 'date-fns/locale';
10
10
  import { copyToClipboard, date as date$1, Dialog as Dialog$1, Notify, Screen as Screen$1, Platform, Loading, extend, uid, Quasar } from 'quasar';
@@ -17,342 +17,9 @@ import Fuse from 'fuse.js';
17
17
  import Sortable from 'sortablejs';
18
18
  import VueGoogleMaps from '@fawmi/vue-google-maps';
19
19
 
20
- var contextMixin = {
21
- computed: {
22
- mx_context () {
23
- const { limit, ordering, page, search, ...filters } = this.$route.query;
24
- return { filters, limit, ordering, page: page ? parseInt(page) : 1, search }
25
- }
26
- }
27
- };
28
-
29
- const irregularClasses = ['col', 'col-auto', 'fit'];
30
-
31
- var generatorMixin = {
32
- props: {
33
- columns: {
34
- default: () => [],
35
- type: [Array, String, Object]
36
- },
37
-
38
- fields: {
39
- default: () => ({}),
40
- type: Object
41
- },
42
-
43
- gutter: {
44
- default: 'md',
45
- type: [String, Boolean],
46
- validator: value => ['xs', 'sm', 'md', 'lg', 'xl'].includes(value)
47
- }
48
- },
49
-
50
- computed: {
51
- mx_classes () {
52
- const classes = ['row'];
53
-
54
- if (this.gutter) {
55
- classes.push(`q-col-gutter-${this.gutter}`);
56
- }
57
-
58
- return classes
59
- }
60
- },
61
-
62
- methods: {
63
- mx_getBreakpoint (columns) {
64
- const classes = [];
65
- const profiles = { col: 'col', xs: 'col-xs', sm: 'col-sm', md: 'col-md', lg: 'col-lg', xl: 'col-xl' };
66
- const { fieldProps, classes: renamedClasses, ...formattedColumns } = columns || {};
67
-
68
- for (const key in formattedColumns) {
69
- const value = formattedColumns[key];
70
- classes.push(irregularClasses.includes(value) ? value : `${profiles[key]}-${value}`);
71
- }
72
-
73
- return [...classes, renamedClasses]
74
- },
75
-
76
- mx_getFieldClass (index, isGridGenerator) {
77
- if (typeof this.columns === 'string') {
78
- return irregularClasses.includes(this.columns) ? this.columns : `col-${this.columns}`
79
- }
80
-
81
- return Array.isArray(this.columns)
82
- ? this.mx_handleColumnsByIndex(index, isGridGenerator)
83
- : this.mx_handleColumnsByField(index, isGridGenerator)
84
- },
85
-
86
- mx_handleColumnsByField (index, isGridGenerator) {
87
- if (!this.columns[index]) {
88
- return this.mx_setDefaultColumnClass(isGridGenerator)
89
- }
90
-
91
- return this.mx_getBreakpoint(this.columns[index])
92
- },
93
-
94
- mx_handleColumnsByIndex (index, isGridGenerator) {
95
- const fields = isGridGenerator ? this.fields : this.groupedFields.visible;
96
-
97
- if (!Array.isArray(fields)) {
98
- index = Object.keys(fields).findIndex(field => field === index);
99
- }
100
-
101
- const length = this.columns.length;
102
-
103
- if (!length) {
104
- return this.mx_setDefaultColumnClass(isGridGenerator)
105
- }
106
-
107
- return this.mx_getBreakpoint(this.columns[index])
108
- },
109
-
110
- mx_setDefaultColumnClass (isGridGenerator) {
111
- return isGridGenerator ? 'col-6 col-xs-12 col-sm-4' : 'col-6'
112
- }
113
- }
114
- };
115
-
116
- const levels = {
117
- 0: {
118
- color: 'negative',
119
- label: 'Muito fraco',
120
- progress: 0.05,
121
- textClass: 'text-negative'
122
- },
123
-
124
- 1: {
125
- color: 'warning',
126
- label: 'Fraco',
127
- progress: 0.25,
128
- textClass: 'text-warning'
129
- },
130
-
131
- 2: {
132
- color: 'warning',
133
- label: 'Bom',
134
- progress: 0.5,
135
- textClass: 'text-warning'
136
- },
137
-
138
- 3: {
139
- color: 'positive',
140
- label: 'Forte',
141
- progress: 0.75,
142
- textClass: 'text-positive'
143
- },
144
-
145
- 4: {
146
- color: 'positive',
147
- label: 'Muito forte',
148
- progress: 1,
149
- textClass: 'text-positive'
150
- }
151
- };
152
-
153
- var passwordMixin = {
154
- props: {
155
- levels: {
156
- default: () => levels,
157
- type: Object
158
- },
159
-
160
- // https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/minlength
161
- minlength: {
162
- default: 8,
163
- type: [Number, String]
164
- },
165
-
166
- specials: {
167
- default: /[!@#$%^&*()_+\-=[\]{}|;:'",<.>/?`~]/g,
168
- type: RegExp
169
- },
170
-
171
- trackColor: {
172
- default: 'blue-grey-1',
173
- type: String
174
- },
175
-
176
- useLowercase: {
177
- default: true,
178
- type: Boolean
179
- },
180
-
181
- useNumbers: {
182
- default: true,
183
- type: Boolean
184
- },
185
-
186
- useSpecial: {
187
- default: true,
188
- type: Boolean
189
- },
190
-
191
- useUppercase: {
192
- default: true,
193
- type: Boolean
194
- }
195
- }
196
- };
197
-
198
- var screenMixin = {
199
- // TODO: Esses nomes precisam ser alterados para algo mais inteligente.
200
-
201
- computed: {
202
- mx_isSmall () {
203
- // until 599
204
- return this.$q.screen.xs
205
- },
206
-
207
- mx_isMedium () {
208
- // from 600 until 1023
209
- return this.$q.screen.sm
210
- },
211
-
212
- mx_isLarge () {
213
- // from 1024 until the limit
214
- return this.$q.screen.gt.sm
215
- },
216
-
217
- mx_untilMedium () {
218
- // from 0 until 599
219
- return this.$q.screen.lt.sm
220
- },
221
-
222
- mx_untilLarge () {
223
- // from 0 until 1023
224
- return this.$q.screen.lt.md
225
- },
226
-
227
- mx_isMobile () {
228
- return this.$q.platform.is.mobile
229
- }
230
- }
231
- };
232
-
233
- var viewMixin = {
234
- props: {
235
- dialog: {
236
- type: Boolean
237
- },
238
-
239
- entity: {
240
- required: true,
241
- type: String
242
- },
243
-
244
- url: {
245
- default: '',
246
- type: String
247
- },
248
-
249
- fields: {
250
- default: () => ({}),
251
- type: Object
252
- },
253
-
254
- errors: {
255
- default: () => ({}),
256
- type: Object
257
- },
258
-
259
- metadata: {
260
- default: () => ({}),
261
- type: Object
262
- },
263
-
264
- fetching: {
265
- type: Boolean
266
- }
267
- },
268
-
269
- emits: [
270
- 'update:fields',
271
- 'update:errors',
272
- 'update:metadata',
273
- 'update:fetching'
274
- ],
275
-
276
- data () {
277
- return {
278
- mx_errors: {},
279
- mx_fields: {},
280
- mx_metadata: {},
281
-
282
- mx_isFetching: false
283
- }
284
- },
285
-
286
- watch: {
287
- mx_isFetching (value) {
288
- this.$emit('update:fetching', value);
289
- }
290
- },
291
-
292
- computed: {
293
- mx_componentTag () {
294
- return this.dialog ? 'div' : 'q-page'
295
- },
296
-
297
- mx_componentClass () {
298
- return !this.dialog && 'container spaced'
299
- },
300
-
301
- mx_hasFooterSlot () {
302
- return !!(this.$slots.footer)
303
- },
304
-
305
- mx_hasHeaderSlot () {
306
- return !!(this.$slots.header)
307
- }
308
- },
309
-
310
- methods: {
311
- mx_fetchError (error) {
312
- const { response } = error;
313
- const exception = response?.data?.exception || error.message;
314
-
315
- this.$qas.error('Ops! Erro ao obter os dados.', exception);
316
-
317
- const status = response?.status;
318
- const redirect = ({ 403: 'Forbidden', 404: 'NotFound' })[status];
319
-
320
- if (redirect) {
321
- this.$router.replace({ name: redirect });
322
- }
323
- },
324
-
325
- mx_setErrors (errors = {}) {
326
- this.mx_errors = markRaw(errors);
327
- },
328
-
329
- mx_setFields (fields = {}) {
330
- for (const field in fields) {
331
- fields[field].name = camelize(fields[field].name);
332
- }
333
-
334
- this.mx_fields = markRaw(fields);
335
- },
336
-
337
- mx_setMetadata (metadata = {}) {
338
- this.mx_metadata = markRaw(metadata);
339
- },
340
-
341
- mx_updateModels (models) {
342
- for (const key in models) {
343
- if (!models[key]) continue
344
-
345
- this.$emit(`update:${key}`, models[key]);
346
- }
347
- }
348
- }
349
- };
350
-
351
20
  var script$L = {
352
21
  name: 'QasActions',
353
22
 
354
- mixins: [screenMixin],
355
-
356
23
  props: {
357
24
  align: {
358
25
  default: 'end',
@@ -372,7 +39,7 @@ var script$L = {
372
39
  return [
373
40
  `justify-${this.align}`,
374
41
  `q-col-gutter-${this.gutter}`,
375
- this.mx_isSmall ? 'column reverse' : 'row'
42
+ this.$qas.screen.isSmall ? 'column reverse' : 'row'
376
43
  ]
377
44
  }
378
45
  }
@@ -400,30 +67,31 @@ script$L.__file = "src/components/actions/QasActions.vue";
400
67
  var script$K = {
401
68
  name: 'QasBtn',
402
69
 
403
- mixins: [screenMixin],
404
-
405
70
  props: {
406
71
  hideLabelOnSmallScreen: {
407
72
  type: Boolean
73
+ },
74
+
75
+ label: {
76
+ type: String,
77
+ default: ''
408
78
  }
409
79
  },
410
80
 
411
81
  computed: {
412
82
  attributes () {
413
- const { label, ...attributes } = this.$attrs;
414
-
415
83
  return {
416
- ...(this.showLabel && { label }),
417
- ...attributes
84
+ ...(this.showLabel && { label: this.label }),
85
+ ...this.$attrs
418
86
  }
419
87
  },
420
88
 
421
89
  hasLabel () {
422
- return !!(this.$attrs.label || this.$slots.default)
90
+ return !!(this.label || this.$slots.default)
423
91
  },
424
92
 
425
93
  showLabel () {
426
- return this.hasLabel && !(this.hideLabelOnSmallScreen && this.mx_isSmall)
94
+ return this.hasLabel && !(this.hideLabelOnSmallScreen && this.$qas.screen.isSmall)
427
95
  },
428
96
 
429
97
  slots () {
@@ -1518,8 +1186,6 @@ script$F.__file = "src/components/app-bar/QasAppBar.vue";
1518
1186
  var script$E = {
1519
1187
  name: 'QasAppMenu',
1520
1188
 
1521
- mixins: [screenMixin],
1522
-
1523
1189
  props: {
1524
1190
  items: {
1525
1191
  default: () => [],
@@ -1621,7 +1287,7 @@ var script$E = {
1621
1287
  },
1622
1288
 
1623
1289
  beforeHide () {
1624
- if (this.mx_isLarge) {
1290
+ if (this.$qas.screen.isLarge) {
1625
1291
  this.model = true;
1626
1292
  this.miniMode = !this.miniMode;
1627
1293
  }
@@ -2520,8 +2186,6 @@ var script$x = {
2520
2186
  QasActions: script$L
2521
2187
  },
2522
2188
 
2523
- mixins: [screenMixin],
2524
-
2525
2189
  props: {
2526
2190
  actionsProps: {
2527
2191
  default: () => ({}),
@@ -2604,8 +2268,8 @@ var script$x = {
2604
2268
 
2605
2269
  style () {
2606
2270
  return {
2607
- maxWidth: this.maxWidth || (this.mx_isSmall ? '' : '600px'),
2608
- minWidth: this.minWidth || (this.mx_isSmall ? '' : '400px')
2271
+ maxWidth: this.maxWidth || (this.$qas.screen.isSmall ? '' : '600px'),
2272
+ minWidth: this.minWidth || (this.$qas.screen.isSmall ? '' : '400px')
2609
2273
  }
2610
2274
  },
2611
2275
 
@@ -2773,10 +2437,15 @@ var NotifySuccess = (message, caption) => {
2773
2437
 
2774
2438
  var Screen = () => {
2775
2439
  const screensModel = {
2440
+ // até 599px
2776
2441
  isSmall: () => Screen$1.xs,
2442
+ // de 600 até 1023px
2777
2443
  isMedium: () => Screen$1.sm,
2444
+ // de 600 até 1023px
2778
2445
  isLarge: () => Screen$1.gt.sm,
2446
+ // de 0 até 599px
2779
2447
  untilMedium: () => Screen$1.lt.sm,
2448
+ // de 0 ate 1023px
2780
2449
  untilLarge: () => Screen$1.lt.md,
2781
2450
 
2782
2451
  // Plataforma
@@ -3389,39 +3058,121 @@ var script$t = {
3389
3058
  });
3390
3059
  },
3391
3060
 
3392
- beforeUnmount () {
3393
- this.autoNumeric.remove();
3061
+ beforeUnmount () {
3062
+ this.autoNumeric.remove();
3063
+ }
3064
+ };
3065
+
3066
+ const _hoisted_1$j = ["id", "model-value", "onInput"];
3067
+
3068
+ function render$t(_ctx, _cache, $props, $setup, $data, $options) {
3069
+ const _component_q_field = resolveComponent("q-field");
3070
+
3071
+ return (openBlock(), createBlock(_component_q_field, {
3072
+ modelValue: $options.model,
3073
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => (($options.model) = $event)),
3074
+ outlined: ""
3075
+ }, {
3076
+ control: withCtx(({ emitValue, floatingLabel, id, value }) => [
3077
+ withDirectives(createElementVNode("input", {
3078
+ id: id,
3079
+ ref: "input",
3080
+ class: "q-field__input",
3081
+ "model-value": value,
3082
+ onInput: $event => (emitValue($event.target.value))
3083
+ }, null, 40 /* PROPS, HYDRATE_EVENTS */, _hoisted_1$j), [
3084
+ [vShow, floatingLabel]
3085
+ ])
3086
+ ]),
3087
+ _: 1 /* STABLE */
3088
+ }, 8 /* PROPS */, ["modelValue"]))
3089
+ }
3090
+
3091
+ script$t.render = render$t;
3092
+ script$t.__file = "src/components/numeric-input/QasNumericInput.vue";
3093
+
3094
+ const levels = {
3095
+ 0: {
3096
+ color: 'negative',
3097
+ label: 'Muito fraco',
3098
+ progress: 0.05,
3099
+ textClass: 'text-negative'
3100
+ },
3101
+
3102
+ 1: {
3103
+ color: 'warning',
3104
+ label: 'Fraco',
3105
+ progress: 0.25,
3106
+ textClass: 'text-warning'
3107
+ },
3108
+
3109
+ 2: {
3110
+ color: 'warning',
3111
+ label: 'Bom',
3112
+ progress: 0.5,
3113
+ textClass: 'text-warning'
3114
+ },
3115
+
3116
+ 3: {
3117
+ color: 'positive',
3118
+ label: 'Forte',
3119
+ progress: 0.75,
3120
+ textClass: 'text-positive'
3121
+ },
3122
+
3123
+ 4: {
3124
+ color: 'positive',
3125
+ label: 'Muito forte',
3126
+ progress: 1,
3127
+ textClass: 'text-positive'
3128
+ }
3129
+ };
3130
+
3131
+ var passwordMixin = {
3132
+ props: {
3133
+ levels: {
3134
+ default: () => levels,
3135
+ type: Object
3136
+ },
3137
+
3138
+ // https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/minlength
3139
+ minlength: {
3140
+ default: 8,
3141
+ type: [Number, String]
3142
+ },
3143
+
3144
+ specials: {
3145
+ default: /[!@#$%^&*()_+\-=[\]{}|;:'",<.>/?`~]/g,
3146
+ type: RegExp
3147
+ },
3148
+
3149
+ trackColor: {
3150
+ default: 'blue-grey-1',
3151
+ type: String
3152
+ },
3153
+
3154
+ useLowercase: {
3155
+ default: true,
3156
+ type: Boolean
3157
+ },
3158
+
3159
+ useNumbers: {
3160
+ default: true,
3161
+ type: Boolean
3162
+ },
3163
+
3164
+ useSpecial: {
3165
+ default: true,
3166
+ type: Boolean
3167
+ },
3168
+
3169
+ useUppercase: {
3170
+ default: true,
3171
+ type: Boolean
3172
+ }
3394
3173
  }
3395
3174
  };
3396
3175
 
3397
- const _hoisted_1$j = ["id", "model-value", "onInput"];
3398
-
3399
- function render$t(_ctx, _cache, $props, $setup, $data, $options) {
3400
- const _component_q_field = resolveComponent("q-field");
3401
-
3402
- return (openBlock(), createBlock(_component_q_field, {
3403
- modelValue: $options.model,
3404
- "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => (($options.model) = $event)),
3405
- outlined: ""
3406
- }, {
3407
- control: withCtx(({ emitValue, floatingLabel, id, value }) => [
3408
- withDirectives(createElementVNode("input", {
3409
- id: id,
3410
- ref: "input",
3411
- class: "q-field__input",
3412
- "model-value": value,
3413
- onInput: $event => (emitValue($event.target.value))
3414
- }, null, 40 /* PROPS, HYDRATE_EVENTS */, _hoisted_1$j), [
3415
- [vShow, floatingLabel]
3416
- ])
3417
- ]),
3418
- _: 1 /* STABLE */
3419
- }, 8 /* PROPS */, ["modelValue"]))
3420
- }
3421
-
3422
- script$t.render = render$t;
3423
- script$t.__file = "src/components/numeric-input/QasNumericInput.vue";
3424
-
3425
3176
  var script$s = {
3426
3177
  name: 'QasPasswordStrengthChecker',
3427
3178
 
@@ -4298,8 +4049,6 @@ var script$o = {
4298
4049
  QasSignaturePad: script$p
4299
4050
  },
4300
4051
 
4301
- mixins: [screenMixin],
4302
-
4303
4052
  props: {
4304
4053
  dialogProps: {
4305
4054
  type: Object,
@@ -4365,18 +4114,18 @@ var script$o = {
4365
4114
 
4366
4115
  signaturePadWidth () {
4367
4116
  const sizes = {
4368
- [this.mx_isSmall]: { width: '100%' },
4369
- [this.mx_isMedium]: { width: '570px' },
4370
- [this.mx_isLarge]: { width: '350px' }
4117
+ [this.$qas.screen.isSmall]: { width: '100%' },
4118
+ [this.$qas.screen.isMedium]: { width: '570px' },
4119
+ [this.$qas.screen.isLarge]: { width: '350px' }
4371
4120
  };
4372
4121
  return sizes.true
4373
4122
  },
4374
4123
 
4375
4124
  signaturePadHeight () {
4376
4125
  const sizes = {
4377
- [this.mx_isSmall]: '250',
4378
- [this.mx_isMedium]: '400',
4379
- [this.mx_isLarge]: '250'
4126
+ [this.$qas.screen.isSmall]: '250',
4127
+ [this.$qas.screen.isMedium]: '400',
4128
+ [this.$qas.screen.isLarge]: '250'
4380
4129
  };
4381
4130
 
4382
4131
  return sizes.true
@@ -4733,6 +4482,15 @@ function render$n(_ctx, _cache, $props, $setup, $data, $options) {
4733
4482
  script$n.render = render$n;
4734
4483
  script$n.__file = "src/components/field/QasField.vue";
4735
4484
 
4485
+ var contextMixin = {
4486
+ computed: {
4487
+ mx_context () {
4488
+ const { limit, ordering, page, search, ...filters } = this.$route.query;
4489
+ return { filters, limit, ordering, page: page ? parseInt(page) : 1, search }
4490
+ }
4491
+ }
4492
+ };
4493
+
4736
4494
  var script$m = {
4737
4495
  name: 'QasFilters',
4738
4496
 
@@ -5170,6 +4928,93 @@ function render$m(_ctx, _cache, $props, $setup, $data, $options) {
5170
4928
  script$m.render = render$m;
5171
4929
  script$m.__file = "src/components/filters/QasFilters.vue";
5172
4930
 
4931
+ const irregularClasses = ['col', 'col-auto', 'fit'];
4932
+
4933
+ var generatorMixin = {
4934
+ props: {
4935
+ columns: {
4936
+ default: () => [],
4937
+ type: [Array, String, Object]
4938
+ },
4939
+
4940
+ fields: {
4941
+ default: () => ({}),
4942
+ type: Object
4943
+ },
4944
+
4945
+ gutter: {
4946
+ default: 'md',
4947
+ type: [String, Boolean],
4948
+ validator: value => ['xs', 'sm', 'md', 'lg', 'xl'].includes(value)
4949
+ }
4950
+ },
4951
+
4952
+ computed: {
4953
+ mx_classes () {
4954
+ const classes = ['row'];
4955
+
4956
+ if (this.gutter) {
4957
+ classes.push(`q-col-gutter-${this.gutter}`);
4958
+ }
4959
+
4960
+ return classes
4961
+ }
4962
+ },
4963
+
4964
+ methods: {
4965
+ mx_getBreakpoint (columns) {
4966
+ const classes = [];
4967
+ const profiles = { col: 'col', xs: 'col-xs', sm: 'col-sm', md: 'col-md', lg: 'col-lg', xl: 'col-xl' };
4968
+ const { fieldProps, classes: renamedClasses, ...formattedColumns } = columns || {};
4969
+
4970
+ for (const key in formattedColumns) {
4971
+ const value = formattedColumns[key];
4972
+ classes.push(irregularClasses.includes(value) ? value : `${profiles[key]}-${value}`);
4973
+ }
4974
+
4975
+ return [...classes, renamedClasses]
4976
+ },
4977
+
4978
+ mx_getFieldClass (index, isGridGenerator) {
4979
+ if (typeof this.columns === 'string') {
4980
+ return irregularClasses.includes(this.columns) ? this.columns : `col-${this.columns}`
4981
+ }
4982
+
4983
+ return Array.isArray(this.columns)
4984
+ ? this.mx_handleColumnsByIndex(index, isGridGenerator)
4985
+ : this.mx_handleColumnsByField(index, isGridGenerator)
4986
+ },
4987
+
4988
+ mx_handleColumnsByField (index, isGridGenerator) {
4989
+ if (!this.columns[index]) {
4990
+ return this.mx_setDefaultColumnClass(isGridGenerator)
4991
+ }
4992
+
4993
+ return this.mx_getBreakpoint(this.columns[index])
4994
+ },
4995
+
4996
+ mx_handleColumnsByIndex (index, isGridGenerator) {
4997
+ const fields = isGridGenerator ? this.fields : this.groupedFields.visible;
4998
+
4999
+ if (!Array.isArray(fields)) {
5000
+ index = Object.keys(fields).findIndex(field => field === index);
5001
+ }
5002
+
5003
+ const length = this.columns.length;
5004
+
5005
+ if (!length) {
5006
+ return this.mx_setDefaultColumnClass(isGridGenerator)
5007
+ }
5008
+
5009
+ return this.mx_getBreakpoint(this.columns[index])
5010
+ },
5011
+
5012
+ mx_setDefaultColumnClass (isGridGenerator) {
5013
+ return isGridGenerator ? 'col-6 col-xs-12 col-sm-4' : 'col-6'
5014
+ }
5015
+ }
5016
+ };
5017
+
5173
5018
  var script$l = {
5174
5019
  name: 'QasFormGenerator',
5175
5020
 
@@ -5277,6 +5122,124 @@ function render$l(_ctx, _cache, $props, $setup, $data, $options) {
5277
5122
  script$l.render = render$l;
5278
5123
  script$l.__file = "src/components/form-generator/QasFormGenerator.vue";
5279
5124
 
5125
+ var viewMixin = {
5126
+ props: {
5127
+ dialog: {
5128
+ type: Boolean
5129
+ },
5130
+
5131
+ entity: {
5132
+ required: true,
5133
+ type: String
5134
+ },
5135
+
5136
+ url: {
5137
+ default: '',
5138
+ type: String
5139
+ },
5140
+
5141
+ fields: {
5142
+ default: () => ({}),
5143
+ type: Object
5144
+ },
5145
+
5146
+ errors: {
5147
+ default: () => ({}),
5148
+ type: Object
5149
+ },
5150
+
5151
+ metadata: {
5152
+ default: () => ({}),
5153
+ type: Object
5154
+ },
5155
+
5156
+ fetching: {
5157
+ type: Boolean
5158
+ }
5159
+ },
5160
+
5161
+ emits: [
5162
+ 'update:fields',
5163
+ 'update:errors',
5164
+ 'update:metadata',
5165
+ 'update:fetching'
5166
+ ],
5167
+
5168
+ data () {
5169
+ return {
5170
+ mx_errors: {},
5171
+ mx_fields: {},
5172
+ mx_metadata: {},
5173
+
5174
+ mx_isFetching: false
5175
+ }
5176
+ },
5177
+
5178
+ watch: {
5179
+ mx_isFetching (value) {
5180
+ this.$emit('update:fetching', value);
5181
+ }
5182
+ },
5183
+
5184
+ computed: {
5185
+ mx_componentTag () {
5186
+ return this.dialog ? 'div' : 'q-page'
5187
+ },
5188
+
5189
+ mx_componentClass () {
5190
+ return !this.dialog && 'container spaced'
5191
+ },
5192
+
5193
+ mx_hasFooterSlot () {
5194
+ return !!(this.$slots.footer)
5195
+ },
5196
+
5197
+ mx_hasHeaderSlot () {
5198
+ return !!(this.$slots.header)
5199
+ }
5200
+ },
5201
+
5202
+ methods: {
5203
+ mx_fetchError (error) {
5204
+ const { response } = error;
5205
+ const exception = response?.data?.exception || error.message;
5206
+
5207
+ this.$qas.error('Ops! Erro ao obter os dados.', exception);
5208
+
5209
+ const status = response?.status;
5210
+ const redirect = ({ 403: 'Forbidden', 404: 'NotFound' })[status];
5211
+
5212
+ if (redirect) {
5213
+ this.$router.replace({ name: redirect });
5214
+ }
5215
+ },
5216
+
5217
+ mx_setErrors (errors = {}) {
5218
+ this.mx_errors = markRaw(errors);
5219
+ },
5220
+
5221
+ mx_setFields (fields = {}) {
5222
+ for (const field in fields) {
5223
+ fields[field].name = camelize(fields[field].name);
5224
+ }
5225
+
5226
+ this.mx_fields = markRaw(fields);
5227
+ },
5228
+
5229
+ mx_setMetadata (metadata = {}) {
5230
+ this.mx_metadata = markRaw(metadata);
5231
+ },
5232
+
5233
+ mx_updateModels (models) {
5234
+ for (const key in models) {
5235
+ if (!models[key]) continue
5236
+
5237
+ this.$emit(`update:${key}`, models[key]);
5238
+ }
5239
+ }
5240
+ }
5241
+ };
5242
+
5280
5243
  var script$k = {
5281
5244
  name: 'QasFormView',
5282
5245
 
@@ -5285,7 +5248,7 @@ var script$k = {
5285
5248
  QasDialog: script$x
5286
5249
  },
5287
5250
 
5288
- mixins: [viewMixin, screenMixin],
5251
+ mixins: [viewMixin],
5289
5252
 
5290
5253
  props: {
5291
5254
  cancelButton: {
@@ -5379,7 +5342,7 @@ var script$k = {
5379
5342
 
5380
5343
  computed: {
5381
5344
  cancelButtonClass () {
5382
- return this.mx_isSmall && 'order-last'
5345
+ return this.$qas.screen.isSmall && 'order-last'
5383
5346
  },
5384
5347
 
5385
5348
  fetchURL () {
@@ -5407,7 +5370,7 @@ var script$k = {
5407
5370
  },
5408
5371
 
5409
5372
  saveButtonClass () {
5410
- return this.mx_isSmall && 'order-first'
5373
+ return this.$qas.screen.isSmall && 'order-first'
5411
5374
  },
5412
5375
 
5413
5376
  isCancelButtonDisabled () {
@@ -5695,8 +5658,6 @@ script$k.__file = "src/components/form-view/QasFormView.vue";
5695
5658
  var script$j = {
5696
5659
  name: 'QasGallery',
5697
5660
 
5698
- mixins: [screenMixin],
5699
-
5700
5661
  props: {
5701
5662
  carouselNextIcon: {
5702
5663
  type: String,
@@ -5753,13 +5714,13 @@ var script$j = {
5753
5714
  return this.height || 'auto'
5754
5715
  }
5755
5716
 
5756
- return this.mx_isSmall ? '90px' : '120px'
5717
+ return this.$qas.screen.isSmall ? '90px' : '120px'
5757
5718
  },
5758
5719
 
5759
5720
  galleryColumnsClasses () {
5760
5721
  if (this.isSingleImage) return 'col-12'
5761
5722
 
5762
- return this.mx_isSmall ? 'col-6' : 'col-2'
5723
+ return this.$qas.screen.isSmall ? 'col-6' : 'col-2'
5763
5724
  },
5764
5725
 
5765
5726
  hideShowMore () {
@@ -5894,9 +5855,9 @@ function render$j(_ctx, _cache, $props, $setup, $data, $options) {
5894
5855
  modelValue: $data.imageIndex,
5895
5856
  "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => (($data.imageIndex) = $event)),
5896
5857
  animated: "",
5897
- arrows: !_ctx.mx_isSmall,
5858
+ arrows: !_ctx.$qas.screen.isSmall,
5898
5859
  "control-text-color": "primary",
5899
- fullscreen: _ctx.mx_isSmall,
5860
+ fullscreen: _ctx.$qas.screen.isSmall,
5900
5861
  height: $options.carouselImageHeight,
5901
5862
  "next-icon": $props.carouselNextIcon,
5902
5863
  "prev-icon": $props.carouselPreviousIcon,
@@ -5912,7 +5873,7 @@ function render$j(_ctx, _cache, $props, $setup, $data, $options) {
5912
5873
  name: index
5913
5874
  }, {
5914
5875
  default: withCtx(() => [
5915
- (_ctx.mx_isSmall)
5876
+ (_ctx.$qas.screen.isSmall)
5916
5877
  ? (openBlock(), createElementBlock("div", _hoisted_4$5, [
5917
5878
  createVNode(_component_qas_btn, {
5918
5879
  dense: "",
@@ -7286,8 +7247,6 @@ var script$a = {
7286
7247
  QasGridGenerator: script$i
7287
7248
  },
7288
7249
 
7289
- mixins: [screenMixin],
7290
-
7291
7250
  props: {
7292
7251
  columns: {
7293
7252
  type: Object,
@@ -7328,7 +7287,7 @@ var script$a = {
7328
7287
 
7329
7288
  computed: {
7330
7289
  directionClasses () {
7331
- return this.mx_untilMedium ? 'col' : 'row items-center'
7290
+ return this.$qas.screen.untilMedium ? 'col' : 'row items-center'
7332
7291
  },
7333
7292
 
7334
7293
  userAvatarImage () {
@@ -7336,7 +7295,7 @@ var script$a = {
7336
7295
  },
7337
7296
 
7338
7297
  avatarSize () {
7339
- return this.mx_isSmall ? '145px' : '188px'
7298
+ return this.$qas.screen.isSmall ? '145px' : '188px'
7340
7299
  }
7341
7300
  },
7342
7301
 
@@ -7917,8 +7876,6 @@ var script$6 = {
7917
7876
  QasSearchBox: script$8
7918
7877
  },
7919
7878
 
7920
- mixins: [screenMixin],
7921
-
7922
7879
  props: {
7923
7880
  deleteOnly: {
7924
7881
  type: Boolean
@@ -8024,9 +7981,9 @@ var script$6 = {
8024
7981
  const isSelected = this.values.includes(value);
8025
7982
 
8026
7983
  return {
8027
- dense: this.mx_isSmall,
7984
+ dense: this.$qas.screen.isSmall,
8028
7985
  hideLabelOnSmallScreen: true,
8029
- icon: !this.mx_isSmall ? undefined : isSelected ? 'o_close' : 'o_add',
7986
+ icon: !this.$qas.screen.isSmall ? undefined : isSelected ? 'o_close' : 'o_add',
8030
7987
  label: isSelected ? 'Remover' : 'Adicionar',
8031
7988
  outline: isSelected,
8032
7989
  size: 'sm'
@@ -8427,8 +8384,6 @@ script$4.__file = "src/components/sortable/QasSortable.vue";
8427
8384
  var script$3 = {
8428
8385
  name: 'QasTableGenerator',
8429
8386
 
8430
- mixins: [screenMixin],
8431
-
8432
8387
  props: {
8433
8388
  columns: {
8434
8389
  default: () => [],
@@ -8555,7 +8510,7 @@ var script$3 = {
8555
8510
  },
8556
8511
 
8557
8512
  tableClass () {
8558
- return this.mx_isSmall && 'qas-table-generator--mobile'
8513
+ return this.$qas.screen.isSmall && 'qas-table-generator--mobile'
8559
8514
  },
8560
8515
 
8561
8516
  hasScrollOnGrab () {
@@ -8796,8 +8751,6 @@ var script$1 = {
8796
8751
  QasDialog: script$x
8797
8752
  },
8798
8753
 
8799
- mixins: [screenMixin],
8800
-
8801
8754
  props: {
8802
8755
  dialogProps: {
8803
8756
  type: Object,
@@ -8837,7 +8790,7 @@ var script$1 = {
8837
8790
 
8838
8791
  computed: {
8839
8792
  truncateTextClass () {
8840
- return (this.isTruncated || this.mx_isSmall) && 'ellipsis q-pr-sm'
8793
+ return (this.isTruncated || this.$qas.screen.isSmall) && 'ellipsis q-pr-sm'
8841
8794
  },
8842
8795
 
8843
8796
  isTruncated () {
@@ -8939,8 +8892,6 @@ var script = {
8939
8892
  QasSearchBox: script$8
8940
8893
  },
8941
8894
 
8942
- mixins: [screenMixin],
8943
-
8944
8895
  props: {
8945
8896
  emitValue: {
8946
8897
  type: Boolean
@@ -8998,15 +8949,15 @@ var script = {
8998
8949
 
8999
8950
  computed: {
9000
8951
  actionsClass () {
9001
- return !this.mx_isSmall && 'column'
8952
+ return !this.$qas.screen.isSmall && 'column'
9002
8953
  },
9003
8954
 
9004
8955
  gutterClass () {
9005
- return `q-col-gutter-${this.mx_untilLarge ? 'md' : 'xl'}`
8956
+ return `q-col-gutter-${this.$qas.screen.untilLarge ? 'md' : 'xl'}`
9006
8957
  },
9007
8958
 
9008
8959
  iconClass () {
9009
- return !this.mx_isSmall && 'qas-transfer__icon'
8960
+ return !this.$qas.screen.isSmall && 'qas-transfer__icon'
9010
8961
  },
9011
8962
 
9012
8963
  searchBoxProps () {
@@ -9263,7 +9214,7 @@ script.__file = "src/components/transfer/QasTransfer.vue";
9263
9214
 
9264
9215
  var name = "@bildvitta/quasar-ui-asteroid";
9265
9216
  var description = "Asteroid";
9266
- var version$1 = "3.0.0-beta.2";
9217
+ var version$1 = "3.0.0-beta.3";
9267
9218
  var author = "Bild & Vitta <systemteam@bild.com.br>";
9268
9219
  var license = "MIT";
9269
9220
  var main = "dist/asteroid.cjs.min.js";