@bildvitta/quasar-ui-asteroid 3.3.1-beta.0 → 3.4.0-beta.1
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 +1 -1
- package/src/components/app-bar/QasAppBar.vue +1 -2
- package/src/components/copy/QasCopy.vue +5 -12
- package/src/components/field/QasField.vue +3 -2
- package/src/components/password-input/QasPasswordInput.vue +12 -2
- package/src/components/search-box/QasSearchBox.vue +2 -2
- package/src/helpers/copy-to-clipboard.js +15 -0
- package/src/helpers/index.js +2 -1
- package/src/mixins/view.js +6 -2
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
</template>
|
|
10
10
|
|
|
11
11
|
<script>
|
|
12
|
-
import { copyToClipboard } from '
|
|
12
|
+
import { copyToClipboard } from '../../helpers'
|
|
13
13
|
|
|
14
14
|
export default {
|
|
15
15
|
name: 'QasCopy',
|
|
@@ -38,17 +38,10 @@ export default {
|
|
|
38
38
|
},
|
|
39
39
|
|
|
40
40
|
methods: {
|
|
41
|
-
|
|
42
|
-
this.isLoading
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
await copyToClipboard(this.text)
|
|
46
|
-
this.$qas.success('Copiado!', this.text)
|
|
47
|
-
} catch (error) {
|
|
48
|
-
this.$qas.error('Não foi possível copiar.', this.text)
|
|
49
|
-
} finally {
|
|
50
|
-
setTimeout(() => { this.isLoading = false }, 500)
|
|
51
|
-
}
|
|
41
|
+
copy () {
|
|
42
|
+
copyToClipboard(this.text, isLoading => {
|
|
43
|
+
this.isLoading = isLoading
|
|
44
|
+
})
|
|
52
45
|
}
|
|
53
46
|
}
|
|
54
47
|
}
|
|
@@ -76,8 +76,9 @@ export default {
|
|
|
76
76
|
mask,
|
|
77
77
|
maxFiles,
|
|
78
78
|
useIso,
|
|
79
|
+
useLazyLoading,
|
|
79
80
|
useSearch,
|
|
80
|
-
|
|
81
|
+
useStrengthChecker
|
|
81
82
|
} = this.formattedField
|
|
82
83
|
|
|
83
84
|
// Default error attributes for Quasar.
|
|
@@ -125,7 +126,7 @@ export default {
|
|
|
125
126
|
number: { is: 'qas-input', type: 'number', ...input },
|
|
126
127
|
hidden: { is: 'input', name, type },
|
|
127
128
|
email: { is: 'qas-input', type, ...input },
|
|
128
|
-
password: { is: 'qas-password-input', ...input },
|
|
129
|
+
password: { is: 'qas-password-input', ...input, useStrengthChecker },
|
|
129
130
|
|
|
130
131
|
decimal: { ...numericInput, mode: 'decimal' },
|
|
131
132
|
money: { ...numericInput, mode: 'money' },
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<qas-input v-model="model" :bottom-slots="
|
|
2
|
+
<qas-input v-model="model" :bottom-slots="hasBottomSlots" v-bind="$attrs" :type="type" use-remove-error-on-type>
|
|
3
3
|
<template #append>
|
|
4
4
|
<q-icon class="cursor-pointer" :color="iconColor" :name="icon" @click="toggle" />
|
|
5
5
|
</template>
|
|
@@ -8,13 +8,14 @@
|
|
|
8
8
|
<slot :name="name" v-bind="context || {}" />
|
|
9
9
|
</template>
|
|
10
10
|
|
|
11
|
-
<template v-if="
|
|
11
|
+
<template v-if="hasStrengthChecker" #hint>
|
|
12
12
|
<qas-password-strength-checker v-bind="strengthCheckerProps" :password="model" />
|
|
13
13
|
</template>
|
|
14
14
|
</qas-input>
|
|
15
15
|
</template>
|
|
16
16
|
|
|
17
17
|
<script>
|
|
18
|
+
import QasInput from '../input/QasInput.vue'
|
|
18
19
|
import passwordMixin from '../../mixins/password.js'
|
|
19
20
|
import QasPasswordStrengthChecker from '../password-strength-checker/QasPasswordStrengthChecker.vue'
|
|
20
21
|
|
|
@@ -22,6 +23,7 @@ export default {
|
|
|
22
23
|
name: 'QasPasswordInput',
|
|
23
24
|
|
|
24
25
|
components: {
|
|
26
|
+
QasInput,
|
|
25
27
|
QasPasswordStrengthChecker
|
|
26
28
|
},
|
|
27
29
|
|
|
@@ -76,6 +78,14 @@ export default {
|
|
|
76
78
|
|
|
77
79
|
type () {
|
|
78
80
|
return this.toggleType ? 'password' : 'text'
|
|
81
|
+
},
|
|
82
|
+
|
|
83
|
+
hasBottomSlots () {
|
|
84
|
+
return !!this.model.length
|
|
85
|
+
},
|
|
86
|
+
|
|
87
|
+
hasStrengthChecker () {
|
|
88
|
+
return this.useStrengthChecker && this.hasBottomSlots
|
|
79
89
|
}
|
|
80
90
|
},
|
|
81
91
|
|
|
@@ -112,7 +112,7 @@ export default {
|
|
|
112
112
|
return {
|
|
113
113
|
clearable: true,
|
|
114
114
|
disable: this.isDisabled,
|
|
115
|
-
debounce: this.useLazyLoading ?
|
|
115
|
+
debounce: this.useLazyLoading ? 800 : 0,
|
|
116
116
|
outlined: true,
|
|
117
117
|
placeholder: this.placeholder,
|
|
118
118
|
hideBottomSpace: true,
|
|
@@ -161,7 +161,7 @@ export default {
|
|
|
161
161
|
},
|
|
162
162
|
|
|
163
163
|
isDisabled () {
|
|
164
|
-
return (!this.useLazyLoading && !this.list.length) || this.
|
|
164
|
+
return (!this.useLazyLoading && !this.list.length) || this.hasNoOptionsOnFirstFetch
|
|
165
165
|
},
|
|
166
166
|
|
|
167
167
|
showEmptyResult () {
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { copyToClipboard } from 'quasar'
|
|
2
|
+
import { NotifySuccess, NotifyError } from '../plugins'
|
|
3
|
+
|
|
4
|
+
export default async (text, onLoading = () => {}) => {
|
|
5
|
+
onLoading(true)
|
|
6
|
+
|
|
7
|
+
try {
|
|
8
|
+
await copyToClipboard(text)
|
|
9
|
+
NotifySuccess('Copiado!', text)
|
|
10
|
+
} catch {
|
|
11
|
+
NotifyError('Não foi possível copiar.', text)
|
|
12
|
+
} finally {
|
|
13
|
+
setTimeout(() => { onLoading(false) }, 500)
|
|
14
|
+
}
|
|
15
|
+
}
|
package/src/helpers/index.js
CHANGED
|
@@ -13,7 +13,8 @@ export { default as getNormalizedOptions } from './get-normalized-options.js'
|
|
|
13
13
|
export { default as handleProcess } from './handle-process.js'
|
|
14
14
|
export { default as destroyNestedChildrenByKey } from './destroy-nested-children-by-key.js'
|
|
15
15
|
export { default as promiseHandler } from './promise-handler.js'
|
|
16
|
-
export { default as findChildrenByKey } from './find-children-by-key'
|
|
16
|
+
export { default as findChildrenByKey } from './find-children-by-key.js'
|
|
17
|
+
export { default as copyToClipboard } from './copy-to-clipboard.js'
|
|
17
18
|
|
|
18
19
|
export * from './filters.js'
|
|
19
20
|
export * from './images.js'
|
package/src/mixins/view.js
CHANGED
|
@@ -89,16 +89,20 @@ export default {
|
|
|
89
89
|
const { response } = error
|
|
90
90
|
const exception = response?.data?.exception || error.message
|
|
91
91
|
|
|
92
|
-
this.$qas.error('Ops! Erro ao obter os dados.', exception)
|
|
93
|
-
|
|
94
92
|
const status = response?.status
|
|
93
|
+
|
|
95
94
|
const redirect = status >= 500
|
|
96
95
|
? 'ServerError'
|
|
97
96
|
: ({ 401: 'Unauthorized', 403: 'Forbidden', 404: 'NotFound' })[status]
|
|
98
97
|
|
|
98
|
+
// caso exista um desses status será redirecionado sem aparecer o "notify"
|
|
99
99
|
if (redirect) {
|
|
100
100
|
this.$router.replace({ name: redirect })
|
|
101
|
+
|
|
102
|
+
return
|
|
101
103
|
}
|
|
104
|
+
|
|
105
|
+
this.$qas.error('Ops! Erro ao obter os dados.', exception)
|
|
102
106
|
},
|
|
103
107
|
|
|
104
108
|
mx_setErrors (errors = {}) {
|