@bildvitta/quasar-ui-asteroid 2.17.1 → 2.20.0

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@bildvitta/quasar-ui-asteroid",
3
- "version": "2.17.1",
3
+ "version": "2.20.0",
4
4
  "description": "",
5
5
  "main": "./src/index.js",
6
6
  "scripts": {
@@ -73,9 +73,5 @@
73
73
  },
74
74
  "peerDependencies": {
75
75
  "vue": "^2.6.14"
76
- },
77
- "engines": {
78
- "node": ">= 12 < 15",
79
- "npm": ">= 6 < 7"
80
76
  }
81
77
  }
@@ -0,0 +1,25 @@
1
+ <?xml version='1.0' encoding='utf-8'?>
2
+ <svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 100 100">
3
+ <g>
4
+ <path id="small" fill="#424242" d="m86.6 10.3v-0.1c-1.5-2-3.3-3.7-5.4-5.3v0.1c-1.7 1.3-3.4 2.7-5 4.1-0.7-0.4-1.3-0.7-1.9-1-0.8-0.4-1.6-0.8-2.5-1-0.3-0.1-0.6-0.2-0.9-0.2-0.2-2.2-0.4-4.4-0.7-6.6-1-0.2-2-0.2-3.1-0.3h-1.6c-1 0.1-1.9 0.1-2.8 0.3-0.3 2.1-0.5 4.3-0.6 6.5-0.4 0-0.7 0.1-1.1 0.2-0.1 0-0.2 0-0.3 0.1-0.8 0.2-1.6 0.6-2.4 1-0.7 0.3-1.3 0.6-1.9 1-1.7-1.4-3.3-2.7-5-4.1l-0.1-0.1c-0.4 0.3-0.8 0.6-1.1 0.9-0.7 0.5-1.3 1.1-1.8 1.7-0.9 0.8-1.6 1.8-2.4 2.8h0.1c1.3 1.7 2.7 3.3 4.1 5-0.4 0.6-0.8 1.3-1.1 1.9-0.4 0.8-0.7 1.7-0.9 2.5-0.2 0.4-0.3 0.8-0.3 1.1-2.2 0.2-4.4 0.4-6.5 0.7-0.2 1-0.3 2-0.3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-6.5z"></path>
5
+ <path fill="#424242" d="m66.5 17.2c-2.2 0-4 0.8-5.6 2.3-1.5 1.6-2.3 3.4-2.3 5.6s0.8 4 2.3 5.6c1.6 1.6 3.4 2.4 5.6 2.4s4-0.8 5.6-2.4 2.3-3.4 2.3-5.6-0.7-4-2.3-5.6c-1.6-1.5-3.4-2.3-5.6-2.3zm-4.2 3.7c1.2-1.1 2.6-1.7 4.2-1.7s3 0.6 4.2 1.7c1.2 1.2 1.7 2.5 1.7 4.2s-0.5 3.1-1.7 4.2c-1.2 1.2-2.6 1.8-4.2 1.8s-3-0.6-4.2-1.8c-1.1-1.1-1.7-2.5-1.7-4.2 0-1.6 0.6-3 1.7-4.2z"/>
6
+ <animateTransform attributeName="transform"
7
+ attributeType="XML"
8
+ type="rotate"
9
+ from="360 66 25.1"
10
+ to="0 66 25.1"
11
+ dur="6s"
12
+ repeatCount="indefinite"/>
13
+ </g>
14
+ <g>
15
+ <path id="big" fill="#424242" d="m40.8 33.6c-0.4-0.2-0.7-0.3-1-0.3-1.2-0.3-2.4-0.5-3.6-0.7-1.1 2.7-2 5.3-2.9 7.9h-1.8c-1.2 0.1-2.3 0.2-3.4 0.4-0.9 0.1-1.8 0.4-2.7 0.7-1.6-2.3-3.3-4.6-4.9-6.8l-0.1-0.1c-0.6 0.2-1.2 0.4-1.7 0.7-1 0.4-1.9 0.9-2.8 1.5-1.4 0.7-2.7 1.6-3.9 2.7v0.1c1.2 2.5 2.3 5 3.5 7.5-0.7 0.7-1.3 1.3-1.9 2.1-0.8 0.8-1.5 1.8-2.1 2.8-0.3 0.4-0.5 0.8-0.7 1.3-2.8-0.5-5.6-1-8.4-1.4-0.5 1.2-1 2.4-1.4 3.7-0.4 2-0.8 3.9-1 5.8l7.8 3v1.4c0 1.1 0.1 2.3 0.4 3.5 0.1 1 0.4 2 0.7 3-2.3 1.6-4.5 3.2-6.8 4.9 1.2 3 2.9 5.8 4.9 8.4h0.1c2.5-1.2 5-2.3 7.6-3.5 0.6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7-2.7-7.3-5.5z"></path>
16
+ <path fill="#424242" d="m22.8 62.4c-0.8 2.7-0.5 5.3 0.9 7.7h0.1c1.4 2.5 3.5 4 6.2 4.8 2.7 0.7 5.3 0.4 7.8-1 2.5-1.5 4-3.5 4.8-6.2v-0.1c0.7-2.7 0.3-5.3-1.1-7.7-1.4-2.5-3.5-4.1-6.2-4.8-2.7-0.8-5.4-0.4-7.8 1-2.5 1.4-4 3.5-4.7 6.3zm6-4c1.9-1.1 3.8-1.4 5.8-0.8 2 0.5 3.6 1.7 4.7 3.6 1.1 1.8 1.3 3.8 0.8 5.8-0.6 2-1.8 3.6-3.6 4.6v0.1c-1.9 1-3.8 1.3-5.8 0.7-2.1-0.5-3.6-1.7-4.7-3.6-1-1.8-1.3-3.7-0.8-5.8 0.6-2 1.8-3.5 3.6-4.6z" />
17
+ <animateTransform attributeName="transform"
18
+ attributeType="XML"
19
+ type="rotate"
20
+ from="0 32.5 65"
21
+ to="360 32.5 65"
22
+ dur="6s"
23
+ repeatCount="indefinite"/>
24
+ </g>
25
+ </svg>
@@ -52,6 +52,10 @@ export default {
52
52
  description: 'Ignore entity and specify another endpoint.'
53
53
  },
54
54
 
55
+ forceRefetch: {
56
+ description: 'Force refetching of filters data.'
57
+ },
58
+
55
59
  // Events
56
60
  'fetch-error': {
57
61
  description: 'Fires when occur an error fetching value.',
@@ -16,7 +16,7 @@
16
16
 
17
17
  <slot v-if="showFilterButton" :filter="filter" name="filter-button">
18
18
  <q-btn v-if="!noFilterButton" :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>
@@ -61,6 +61,7 @@ export default {
61
61
  },
62
62
 
63
63
  mixins: [contextMixin],
64
+
64
65
  props: {
65
66
  badges: {
66
67
  default: true,
@@ -95,6 +96,10 @@ export default {
95
96
  url: {
96
97
  default: '',
97
98
  type: String
99
+ },
100
+
101
+ forceRefetch: {
102
+ type: Boolean
98
103
  }
99
104
  },
100
105
 
@@ -220,7 +225,7 @@ export default {
220
225
  },
221
226
 
222
227
  async fetchFilters () {
223
- if (this.hasFields || this.noFilterButton) {
228
+ if (!this.forceRefetch && (this.hasFields || this.noFilterButton)) {
224
229
  return null
225
230
  }
226
231
 
@@ -44,13 +44,23 @@ export default {
44
44
 
45
45
  // Events
46
46
  input: {
47
- description: 'Emitted when the component needs to change the model. Is also used by `v-model`.',
47
+ description: 'Emitted when the component needs to change the value.',
48
48
  table: {
49
49
  defaultValue: {
50
50
  detail: JSON.stringify({ value: 'number' }),
51
51
  summary: '{}'
52
52
  }
53
53
  }
54
+ },
55
+
56
+ 'update-model': {
57
+ description: 'Emitted when the user inputs a new value in the component.',
58
+ table: {
59
+ defaultValue: {
60
+ detail: JSON.stringify({ value: 'object' }),
61
+ summary: '{}'
62
+ }
63
+ }
54
64
  }
55
65
  }
56
66
  }
@@ -1,8 +1,8 @@
1
1
  <template>
2
2
  <div>
3
- <q-field v-model="model" v-bind="$attrs">
4
- <template #control="{ emitValue, floatingLabel, id, value: modelValue }">
5
- <input v-show="floatingLabel" :id="id" ref="input" class="q-field__input" :model-value="modelValue" @input="emitValue($event.target.value)">
3
+ <q-field :value="value" v-bind="$attrs">
4
+ <template #control="{ floatingLabel, id }">
5
+ <input v-show="floatingLabel" :id="id" ref="input" class="q-field__input" @blur="emitValue" @click="setSelect" @input="emitUpdateModel($event.target.value)">
6
6
  </template>
7
7
  </q-field>
8
8
  </div>
@@ -66,15 +66,13 @@ export default {
66
66
  computed: {
67
67
  defaultMode () {
68
68
  return defaultModes[this.mode]
69
- },
70
-
71
- model: {
72
- get () {
73
- return this.value
74
- },
69
+ }
70
+ },
75
71
 
76
- set () {
77
- this.$emit('input', this.autoNumeric.getNumber())
72
+ watch: {
73
+ value (value) {
74
+ if (this.autoNumeric) {
75
+ this.autoNumeric.set(value)
78
76
  }
79
77
  }
80
78
  },
@@ -110,13 +108,30 @@ export default {
110
108
  Object.assign(options, this.autonumericProps)
111
109
 
112
110
  this.$nextTick(() => {
113
- this.$refs.input.value = this.value
114
111
  this.autoNumeric = new AutoNumeric(this.$refs.input, options)
112
+ this.autoNumeric.set(this.value)
115
113
  })
116
114
  },
117
115
 
118
116
  beforeDestroy () {
119
117
  this.autoNumeric.remove()
118
+ },
119
+
120
+ methods: {
121
+ setSelect () {
122
+ this.$refs?.input?.select()
123
+ },
124
+
125
+ emitValue () {
126
+ this.$emit('input', this.autoNumeric.getNumber())
127
+ },
128
+
129
+ emitUpdateModel (value) {
130
+ this.$emit('update-model', {
131
+ value,
132
+ raw: this.autoNumeric.getNumber()
133
+ })
134
+ }
120
135
  }
121
136
  }
122
137
  </script>
@@ -12,19 +12,19 @@ import { isEqual } from 'lodash'
12
12
 
13
13
  export default {
14
14
  props: {
15
- options: {
16
- default: () => ({}),
17
- type: Object
15
+ height: {
16
+ type: String,
17
+ default: '250'
18
18
  },
19
19
 
20
- type: {
21
- default: 'image/png',
22
- type: String
20
+ options: {
21
+ type: Object,
22
+ default: () => ({})
23
23
  },
24
24
 
25
- height: {
26
- default: '250',
27
- type: String
25
+ type: {
26
+ type: String,
27
+ default: 'image/png'
28
28
  },
29
29
 
30
30
  isEmpty: {
@@ -26,6 +26,13 @@ export default {
26
26
  description: 'Generated signature label.'
27
27
  },
28
28
 
29
+ dialogProps: {
30
+ description: 'Set props in dialog',
31
+ table: {
32
+ defaultValue: { summary: JSON.stringify({}) }
33
+ }
34
+ },
35
+
29
36
  value: {
30
37
  description: 'Model value.'
31
38
  },
@@ -15,13 +15,15 @@
15
15
  </template>
16
16
  </qas-uploader>
17
17
 
18
- <qas-dialog v-model="isOpenedDialog">
18
+ <qas-dialog v-model="isOpenedDialog" v-bind="defaultDialogProps" >
19
19
  <template #header>
20
20
  <div class="text-bold text-center">Insira sua assinatura digital no campo abaixo</div>
21
21
  </template>
22
22
 
23
23
  <template #description>
24
- <qas-signature-pad ref="signaturePadModal" height="250" :is-empty.sync="isEmpty" />
24
+ <div :style="signaturePadWidth">
25
+ <qas-signature-pad ref="signaturePadModal" :height="signaturePadHeight" :is-empty.sync="isEmpty" />
26
+ </div>
25
27
  </template>
26
28
 
27
29
  <template #actions>
@@ -36,10 +38,13 @@
36
38
  import QasDialog from '../dialog/QasDialog.vue'
37
39
  import QasUploader from '../uploader/QasUploader.vue'
38
40
  import QasSignaturePad from '../signature-pad/QasSignaturePad.vue'
41
+ import { screenMixin } from '../../mixins'
39
42
  import { base64ToBlob } from '../../helpers'
40
43
  import { NotifyError } from '../../plugins'
41
44
 
42
45
  export default {
46
+ mixins: [screenMixin],
47
+
43
48
  components: {
44
49
  QasDialog,
45
50
  QasUploader,
@@ -47,6 +52,11 @@ export default {
47
52
  },
48
53
 
49
54
  props: {
55
+ dialogProps: {
56
+ type: Object,
57
+ default: () => ({})
58
+ },
59
+
50
60
  uploadLabel: {
51
61
  default: 'Assinatura digital',
52
62
  type: String
@@ -93,6 +103,33 @@ export default {
93
103
 
94
104
  headerClasses () {
95
105
  return `q-pa-${this.readonly ? 'md' : 'sm'}`
106
+ },
107
+
108
+ defaultDialogProps () {
109
+ return {
110
+ maxWidth: '620px',
111
+ ...this.dialogProps
112
+ }
113
+ },
114
+
115
+ signaturePadWidth () {
116
+ const sizes = {
117
+ [this.$_isSmall]: { width: '100%' },
118
+ [this.$_isMedium]: { width: '570px' },
119
+ [this.$_isLarge]: { width: '350px' }
120
+ }
121
+
122
+ return sizes.true
123
+ },
124
+
125
+ signaturePadHeight () {
126
+ const sizes = {
127
+ [this.$_isSmall]: '250',
128
+ [this.$_isMedium]: '400',
129
+ [this.$_isLarge]: '250'
130
+ }
131
+
132
+ return sizes.true
96
133
  }
97
134
  },
98
135
 
@@ -52,7 +52,7 @@ export default {
52
52
  NotifyError('Ops! Erro ao obter os dados.', exception)
53
53
 
54
54
  const status = get(response, 'status')
55
- const redirect = ({ 403: 'Forbidden', 404: 'NotFound' })[status]
55
+ const redirect = status >= 500 ? 'ServerError' : ({ 403: 'Forbidden', 404: 'NotFound' })[status]
56
56
 
57
57
  if (redirect) {
58
58
  this.$router.replace({ name: redirect })
@@ -0,0 +1,60 @@
1
+ <template>
2
+ <div class="column error-component items-center justify-around q-px-xl">
3
+ <div class="column full-width items-center justify-center q-gutter-md q-py-md row">
4
+ <q-img src="../assets/gear.svg" :width="gearSize" />
5
+ <div class="text-bold text-h1 text-primary">{{ code }}</div>
6
+ <div class="text-bold text-center text-grey-9 text-h6">{{ title }}</div>
7
+ <div v-if="subtitle" class="text-bold text-center text-grey-9 text-subtitle2">{{ subtitle }}</div>
8
+ <qas-btn v-if="hasButtonProps" class="text-bold text-primary" v-bind="buttonProps" />
9
+ </div>
10
+ </div>
11
+ </template>
12
+
13
+ <script>
14
+ import screenMixin from '../mixins/screen'
15
+
16
+ export default {
17
+ name: 'ErrorComponent',
18
+
19
+ mixins: [screenMixin],
20
+
21
+ props: {
22
+ buttonProps: {
23
+ type: Object,
24
+ default: () => ({})
25
+ },
26
+
27
+ code: {
28
+ type: String,
29
+ required: true
30
+ },
31
+
32
+ subtitle: {
33
+ type: String,
34
+ default: ''
35
+ },
36
+
37
+ title: {
38
+ type: String,
39
+ required: true
40
+ }
41
+ },
42
+
43
+ computed: {
44
+ gearSize () {
45
+ return this.$_isSmall ? '90px' : '160px'
46
+ },
47
+
48
+ hasButtonProps () {
49
+ return !!Object.keys(this.buttonProps).length
50
+ }
51
+ }
52
+ }
53
+ </script>
54
+
55
+ <style lang="scss">
56
+ .error-component {
57
+ min-height: 100vh;
58
+ background-color: var(--qas-background-color);
59
+ }
60
+ </style>
@@ -1,6 +1,26 @@
1
1
  <template>
2
- <div class="fixed-center text-center">
3
- <p class="q-my-lg text-faded">Ops, você não tem permissão para acessar esta página <strong>(403).</strong></p>
4
- <q-btn color="primary" flat @click="$router.push('/')">Voltar</q-btn>
5
- </div>
6
- </template>
2
+ <error-component v-bind="errorProps" />
3
+ </template>
4
+
5
+ <script>
6
+ import ErrorComponent from './ErrorComponent'
7
+
8
+ export default {
9
+ components: {
10
+ ErrorComponent
11
+ },
12
+
13
+ computed: {
14
+ errorProps () {
15
+ return {
16
+ code: '403',
17
+ title: 'Ops, parece que você não tem acesso para este recurso!',
18
+ buttonProps: {
19
+ to: { path: '/' },
20
+ label: 'Voltar ao início'
21
+ }
22
+ }
23
+ }
24
+ }
25
+ }
26
+ </script>
@@ -1,6 +1,26 @@
1
1
  <template>
2
- <div class="fixed-center text-center">
3
- <p class="q-my-lg text-faded">Ops, nada aqui... <strong>(404)</strong></p>
4
- <q-btn color="primary" flat @click="$router.push('/')">Voltar</q-btn>
5
- </div>
2
+ <error-component v-bind="errorProps" />
6
3
  </template>
4
+
5
+ <script>
6
+ import ErrorComponent from './ErrorComponent'
7
+
8
+ export default {
9
+ components: {
10
+ ErrorComponent
11
+ },
12
+
13
+ computed: {
14
+ errorProps () {
15
+ return {
16
+ code: '404',
17
+ title: 'Ops! Parece que a página que está tentando acessar não existe!',
18
+ buttonProps: {
19
+ to: { path: '/' },
20
+ label: 'Voltar ao início'
21
+ }
22
+ }
23
+ }
24
+ }
25
+ }
26
+ </script>
@@ -0,0 +1,23 @@
1
+ <template>
2
+ <error-component v-bind="errorProps" />
3
+ </template>
4
+
5
+ <script>
6
+ import ErrorComponent from './ErrorComponent'
7
+
8
+ export default {
9
+ components: {
10
+ ErrorComponent
11
+ },
12
+
13
+ computed: {
14
+ errorProps () {
15
+ return {
16
+ code: '500',
17
+ title: 'Ops, ocorreu um erro interno no nosso servidor!',
18
+ subtitle: 'Tente novamente em alguns instantes.'
19
+ }
20
+ }
21
+ }
22
+ }
23
+ </script>