@bildvitta/quasar-ui-asteroid 3.0.0-beta.10 → 3.0.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/dist/api/QasAppBar.json +0 -4
- package/dist/api/QasCard.json +13 -9
- package/dist/asteroid.cjs.css +1 -1
- package/dist/asteroid.cjs.js +292 -57
- package/dist/asteroid.cjs.min.js +2 -2
- package/dist/asteroid.esm.css +1 -1
- package/dist/asteroid.esm.js +294 -59
- package/dist/asteroid.esm.min.js +2 -2
- package/dist/asteroid.umd.css +1 -1
- package/dist/asteroid.umd.js +292 -57
- package/dist/asteroid.umd.min.js +2 -2
- package/dist/vetur/asteroid-attributes.json +12 -12
- package/dist/vetur/asteroid-tags.json +3 -3
- package/package.json +1 -1
- package/src/components/app-bar/QasAppBar.yml +0 -4
- package/src/components/card/QasCard.yml +13 -9
- package/src/components/date-time-input/QasDateTimeInput.vue +1 -1
- package/src/components/delete/QasDelete.vue +15 -1
- package/src/components/filters/QasFilters.vue +19 -4
- package/src/components/form-view/QasFormView.vue +51 -8
- package/src/components/grid-generator/QasGridGenerator.vue +17 -2
- package/src/components/input/QasInput.vue +20 -2
- package/src/components/list-view/QasListView.vue +20 -7
- package/src/components/nested-fields/QasNestedFields.vue +8 -9
- package/src/components/page-header/QasPageHeader.vue +9 -6
- package/src/components/search-box/QasSearchBox.vue +2 -2
- package/src/components/single-view/QasSingleView.vue +17 -3
- package/src/components/table-generator/QasTableGenerator.vue +11 -1
- package/src/components/uploader/QasUploader.vue +28 -3
- package/src/helpers/camelize-fields-name.js +15 -0
- package/src/helpers/index.js +1 -0
- package/src/mixins/view.js +3 -5
- package/src/plugins/index.js +4 -2
- package/src/plugins/logger/Logger.js +44 -0
- package/src/plugins/logger/Logger.yml +9 -0
- package/src/vue-plugin.js +6 -3
|
@@ -250,6 +250,8 @@ export default {
|
|
|
250
250
|
)
|
|
251
251
|
|
|
252
252
|
this.updateUploading(false)
|
|
253
|
+
|
|
254
|
+
this.$qas.logger.group('QasUploader - uploaded', [this.modelValue])
|
|
253
255
|
},
|
|
254
256
|
|
|
255
257
|
async fetchCredentials (filename) {
|
|
@@ -260,6 +262,12 @@ export default {
|
|
|
260
262
|
entity: this.entity,
|
|
261
263
|
filename
|
|
262
264
|
})
|
|
265
|
+
|
|
266
|
+
this.$qas.logger.group(
|
|
267
|
+
'QasUploader - fetchCredentials -> resposta de /upload-credentials/',
|
|
268
|
+
[data]
|
|
269
|
+
)
|
|
270
|
+
|
|
263
271
|
return data
|
|
264
272
|
} finally {
|
|
265
273
|
this.isFetching = false
|
|
@@ -279,7 +287,9 @@ export default {
|
|
|
279
287
|
|
|
280
288
|
const clonedValue = extend(true, [], this.modelValue)
|
|
281
289
|
const numberIndex = this.modelValue.findIndex(file => this.getFileName(file) === index)
|
|
290
|
+
|
|
282
291
|
clonedValue.splice(numberIndex, 1)
|
|
292
|
+
|
|
283
293
|
this.$emit('update:modelValue', clonedValue)
|
|
284
294
|
},
|
|
285
295
|
|
|
@@ -288,7 +298,9 @@ export default {
|
|
|
288
298
|
},
|
|
289
299
|
|
|
290
300
|
getFilesList (uploadedFiles) {
|
|
291
|
-
const pathsList = Array.isArray(this.modelValue)
|
|
301
|
+
const pathsList = Array.isArray(this.modelValue)
|
|
302
|
+
? this.modelValue
|
|
303
|
+
: (this.modelValue ? [this.modelValue] : [])
|
|
292
304
|
|
|
293
305
|
uploadedFiles = uploadedFiles.map((file, indexToDelete) => {
|
|
294
306
|
return {
|
|
@@ -324,6 +336,8 @@ export default {
|
|
|
324
336
|
}
|
|
325
337
|
})
|
|
326
338
|
|
|
339
|
+
this.$qas.logger.group('QasUploader - getFilesList', [files])
|
|
340
|
+
|
|
327
341
|
return files
|
|
328
342
|
},
|
|
329
343
|
|
|
@@ -362,7 +376,14 @@ export default {
|
|
|
362
376
|
// Retorna largura e altura da original da imagem
|
|
363
377
|
const { width, height } = await getImageSize(image)
|
|
364
378
|
|
|
365
|
-
if (width <= this.sizeLimit)
|
|
379
|
+
if (width <= this.sizeLimit) {
|
|
380
|
+
this.$qas.logger.info(`
|
|
381
|
+
QasUploader - resizeImage -> Tamanho da imagem menor que o tamanho limite,
|
|
382
|
+
sendo assim, não faz o resize
|
|
383
|
+
`)
|
|
384
|
+
|
|
385
|
+
return file
|
|
386
|
+
}
|
|
366
387
|
|
|
367
388
|
// Retorna os novos tamanhos redimensionados
|
|
368
389
|
const resizedDimensions = getResizeDimensions(this.sizeLimit, width, height)
|
|
@@ -380,7 +401,11 @@ export default {
|
|
|
380
401
|
const resizedImage = await pica.resize(image, canvas, this.defaultPicaResizeOptions)
|
|
381
402
|
const blob = await pica.toBlob(resizedImage, type, 0.90)
|
|
382
403
|
|
|
383
|
-
|
|
404
|
+
const newFile = new File([blob], file.name, { type })
|
|
405
|
+
|
|
406
|
+
this.$qas.logger.group('QasUploader - resizeImage -> nova imagem', [newFile])
|
|
407
|
+
|
|
408
|
+
return newFile
|
|
384
409
|
} catch {
|
|
385
410
|
// Caso não consiga redimensionar retorna o arquivo original
|
|
386
411
|
return file
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { camelize } from 'humps'
|
|
2
|
+
|
|
3
|
+
export default function camelizeFieldsName (fields) {
|
|
4
|
+
for (const field in fields) {
|
|
5
|
+
const currentField = fields[field]
|
|
6
|
+
|
|
7
|
+
currentField.name = camelize(currentField.name)
|
|
8
|
+
|
|
9
|
+
if (Object.keys(currentField.children || {}).length) {
|
|
10
|
+
camelizeFieldsName(currentField.children)
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
return fields
|
|
15
|
+
}
|
package/src/helpers/index.js
CHANGED
|
@@ -8,6 +8,7 @@ export { default as filterObject } from './filter-object.js'
|
|
|
8
8
|
export { default as getGreatestCommonDivisor } from './get-greatest-common-divisor.js'
|
|
9
9
|
export { default as filterObjectToArray } from './filter-object-to-array.js'
|
|
10
10
|
export { default as filterListByHandle } from './filter-list-by-handle.js'
|
|
11
|
+
export { default as camelizeFieldsName } from './camelize-fields-name.js'
|
|
11
12
|
|
|
12
13
|
export * from './filters.js'
|
|
13
14
|
export * from './images.js'
|
package/src/mixins/view.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { camelizeFieldsName } from '../helpers'
|
|
2
2
|
import { markRaw } from 'vue'
|
|
3
3
|
|
|
4
4
|
export default {
|
|
@@ -101,11 +101,9 @@ export default {
|
|
|
101
101
|
},
|
|
102
102
|
|
|
103
103
|
mx_setFields (fields = {}) {
|
|
104
|
-
|
|
105
|
-
fields[field].name = camelize(fields[field].name)
|
|
106
|
-
}
|
|
104
|
+
const camelizedFields = camelizeFieldsName(fields)
|
|
107
105
|
|
|
108
|
-
this.mx_fields = markRaw(
|
|
106
|
+
this.mx_fields = markRaw(camelizedFields)
|
|
109
107
|
},
|
|
110
108
|
|
|
111
109
|
mx_setMetadata (metadata = {}) {
|
package/src/plugins/index.js
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import Dialog from './dialog/Dialog.js'
|
|
2
|
+
import Logger from './logger/Logger.js'
|
|
2
3
|
import NotifyError from './notify-error/NotifyError.js'
|
|
3
4
|
import NotifySuccess from './notify-success/NotifySuccess.js'
|
|
4
5
|
import Screen from './screen/Screen.js'
|
|
5
6
|
|
|
6
7
|
export {
|
|
7
8
|
Dialog,
|
|
9
|
+
Logger,
|
|
8
10
|
NotifyError,
|
|
9
|
-
|
|
10
|
-
|
|
11
|
+
NotifySuccess,
|
|
12
|
+
Screen
|
|
11
13
|
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export default () => {
|
|
2
|
+
const isDebugEnabled = process.env.DEBUGGING
|
|
3
|
+
|
|
4
|
+
const normalizeMessage = msg => `%c ${msg}`
|
|
5
|
+
const getStyle = isError => (
|
|
6
|
+
`
|
|
7
|
+
background: ${isError ? '#C10015 ' : '#1976d2'};
|
|
8
|
+
font-weight: bold;
|
|
9
|
+
color: white;
|
|
10
|
+
padding: 6px 20px;
|
|
11
|
+
border-radius: 4px;
|
|
12
|
+
display: block;
|
|
13
|
+
width: 100%;
|
|
14
|
+
font-size: 12px;
|
|
15
|
+
`
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
return {
|
|
19
|
+
group (message, payload = [], { error } = {}) {
|
|
20
|
+
if (!isDebugEnabled) return
|
|
21
|
+
|
|
22
|
+
console.groupCollapsed(normalizeMessage(message), getStyle(error))
|
|
23
|
+
|
|
24
|
+
for (const item of payload) {
|
|
25
|
+
if (typeof item === 'string') {
|
|
26
|
+
console.info(normalizeMessage(item), getStyle(error))
|
|
27
|
+
continue
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
console.table(item)
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
console.groupEnd()
|
|
34
|
+
},
|
|
35
|
+
|
|
36
|
+
info (message) {
|
|
37
|
+
isDebugEnabled && console.info(normalizeMessage(message), getStyle())
|
|
38
|
+
},
|
|
39
|
+
|
|
40
|
+
error (message) {
|
|
41
|
+
isDebugEnabled && console.info(normalizeMessage(message), getStyle(true))
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
package/src/vue-plugin.js
CHANGED
|
@@ -55,7 +55,8 @@ import {
|
|
|
55
55
|
Dialog,
|
|
56
56
|
NotifyError,
|
|
57
57
|
NotifySuccess,
|
|
58
|
-
Screen
|
|
58
|
+
Screen,
|
|
59
|
+
Logger
|
|
59
60
|
} from './plugins'
|
|
60
61
|
|
|
61
62
|
import packageInfo from '../package.json'
|
|
@@ -124,8 +125,9 @@ function install (app) {
|
|
|
124
125
|
app.config.globalProperties.$qas = {
|
|
125
126
|
dialog: Dialog,
|
|
126
127
|
error: NotifyError,
|
|
127
|
-
|
|
128
|
-
screen: Screen()
|
|
128
|
+
logger: Logger(),
|
|
129
|
+
screen: Screen(),
|
|
130
|
+
success: NotifySuccess
|
|
129
131
|
}
|
|
130
132
|
|
|
131
133
|
app.directive(Test.name, Test)
|
|
@@ -186,6 +188,7 @@ export {
|
|
|
186
188
|
|
|
187
189
|
// plugins
|
|
188
190
|
Dialog,
|
|
191
|
+
Logger,
|
|
189
192
|
NotifyError,
|
|
190
193
|
NotifySuccess,
|
|
191
194
|
Screen,
|