@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
@@ -62,7 +62,6 @@ import { NotifyError } from '../../plugins'
62
62
  import { getImageSize, getResizeDimensions } from '../../helpers/images'
63
63
 
64
64
  import Pica from 'pica'
65
- import api from 'axios'
66
65
 
67
66
  export default {
68
67
  name: 'QasUploader',
@@ -257,7 +256,7 @@ export default {
257
256
  this.isFetching = true
258
257
 
259
258
  try {
260
- const { data } = await api.post('/upload-credentials/', {
259
+ const { data } = await this.$axios.post('/upload-credentials/', {
261
260
  entity: this.entity,
262
261
  filename
263
262
  })
@@ -0,0 +1 @@
1
+ export { default as useHistory } from './useHistory.js'
@@ -0,0 +1,3 @@
1
+ import { useRoute } from 'vue-router'
2
+
3
+ console.log(useRoute(), '>>>')
@@ -0,0 +1,46 @@
1
+ import { reactive, computed } from 'vue'
2
+ import { findLastIndex } from 'lodash-es'
3
+
4
+ const history = reactive({ list: [] })
5
+
6
+ export default function () {
7
+ const hasPreviousRoute = computed(() => history.list.length > 1)
8
+
9
+ function getPreviousRoute (currentRoute) {
10
+ const index = findLastIndex(history.list, item => item.name === currentRoute.name)
11
+
12
+ if (~index) {
13
+ history.list.splice(index, 1)
14
+ }
15
+
16
+ return history.list[history.list.length - 1]
17
+ }
18
+
19
+ function addRoute (route) {
20
+ const routeExistsInList = history.list?.[history.list?.length - 1]?.name === route.name
21
+
22
+ if (routeExistsInList) return
23
+
24
+ history.list.push(route)
25
+ }
26
+
27
+ function destroyRoutes (routes) {
28
+ if (!history.list.length) return null
29
+
30
+ routes.forEach(route => {
31
+ const index = history.list.findIndex(item => item.name === route.name)
32
+
33
+ if (~index) {
34
+ history.list.splice(index, 1)
35
+ }
36
+ })
37
+ }
38
+
39
+ return {
40
+ history,
41
+ hasPreviousRoute,
42
+ getPreviousRoute,
43
+ addRoute,
44
+ destroyRoutes
45
+ }
46
+ }
@@ -0,0 +1,6 @@
1
+ // Definições seguindo:
2
+ // https://www.figma.com/file/JfDthOZoULYMlRJM2IQ8Oi/Design-System?node-id=665%3A163
3
+
4
+ $button-font-size: 0.875rem;
5
+ $button-line-height: 1.5rem;
6
+ $button-font-weight: 500;
@@ -0,0 +1,2 @@
1
+ @import './button';
2
+ @import 'typography';
@@ -0,0 +1,91 @@
1
+ // Definições seguindo:
2
+ // https://www.figma.com/file/JfDthOZoULYMlRJM2IQ8Oi/Design-System?node-id=665%3A163
3
+
4
+ // headings
5
+ $h1: (
6
+ size: 6rem,
7
+ line-height: 6rem,
8
+ letter-spacing: 0,
9
+ weight: 800
10
+ );
11
+
12
+ $h2: (
13
+ size: 3.75rem,
14
+ line-height: 3.75rem,
15
+ letter-spacing: 0,
16
+ weight: 700
17
+ );
18
+
19
+ $h3: (
20
+ size: 3rem,
21
+ line-height: 3.125rem,
22
+ letter-spacing: 0,
23
+ weight: 600
24
+ );
25
+
26
+ $h4: (
27
+ size: 2.125rem,
28
+ line-height: 2.5rem,
29
+ letter-spacing: 0,
30
+ weight: 800
31
+ );
32
+
33
+ $h5: (
34
+ size: 2rem,
35
+ line-height: 2.5rem,
36
+ letter-spacing: 0,
37
+ weight: 700
38
+ );
39
+
40
+ $h6: (
41
+ size: 1.25rem,
42
+ line-height: 2rem,
43
+ letter-spacing: 0,
44
+ weight: 600
45
+ );
46
+
47
+ // subtitles
48
+ $subtitle1: (
49
+ size: 1rem,
50
+ line-height: 1.75rem,
51
+ letter-spacing: 0,
52
+ weight: 700
53
+ );
54
+
55
+ $subtitle2: (
56
+ size: 0.875rem,
57
+ line-height: 1.375rem,
58
+ letter-spacing: 0,
59
+ weight: 600
60
+ );
61
+
62
+ // body
63
+ $body1: (
64
+ size: 1rem,
65
+ line-height: 1.5rem,
66
+ letter-spacing: 0,
67
+ weight: 500
68
+ );
69
+
70
+ $body2: (
71
+ size: 0.875rem,
72
+ line-height: 1.25rem,
73
+ letter-spacing: 0,
74
+ weight: 400
75
+ );
76
+
77
+ // overline
78
+ $overline: (
79
+ size: 0.75rem,
80
+ line-height: 2rem,
81
+ letter-spacing: 0.25rem,
82
+ weight: 600
83
+ );
84
+
85
+ // caption
86
+ $caption: (
87
+ size: 0.75rem,
88
+ line-height: 1.25rem,
89
+ letter-spacing: 0,
90
+ weight: 700
91
+ );
@@ -0,0 +1,13 @@
1
+ export default {
2
+ name: 'test',
3
+
4
+ bind (element, { arg: argument, value }) {
5
+ if (element && argument) {
6
+ element.dataset.test = argument
7
+ }
8
+
9
+ if (element && value) {
10
+ element.dataset.testKey = value
11
+ }
12
+ }
13
+ }
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Função para filtrar um array de objeto, usando a logica na propriedade `handle
3
+ * e adicionando o que tem dentro da propriedade `item`.
4
+ *
5
+ * @param {Object[]} list Array de objetos, contendo `handle` e `item`.
6
+ * @returns {Array}
7
+ *
8
+ * @example
9
+ * filterListByHandle(
10
+ * [
11
+ * {
12
+ * handle: true,
13
+ * item: 'item 1'
14
+ * },
15
+ * {
16
+ * handle: false,
17
+ * item: 'item 2'
18
+ * }
19
+ * ) // retorna ['item 1']
20
+ */
21
+ export default function (list = []) {
22
+ const formattedList = []
23
+
24
+ list.forEach(itemList => {
25
+ if (itemList.handle) {
26
+ formattedList.push(itemList.item)
27
+ }
28
+ })
29
+
30
+ return formattedList
31
+ }
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Função para filtrar um objeto, transformando cada chave em um item do array caso
3
+ * o valor referente a chave seja true.
4
+ *
5
+ * @param {Object} object Objeto contendo propriedades a serem adicionadas.
6
+ * @returns {string[]}
7
+ *
8
+ * @example
9
+ * filterObjectToArray(
10
+ * {
11
+ * item1: true,
12
+ * item2: false,
13
+ * item3: '',
14
+ * item4: 'str',
15
+ * }
16
+ * ) // retorna: ['item1', 'item4']
17
+ */
18
+
19
+ export default function (object = {}) {
20
+ const list = []
21
+
22
+ for (const key in object) {
23
+ if (object[key]) {
24
+ list.push(key)
25
+ }
26
+ }
27
+
28
+ return list
29
+ }
@@ -1,9 +1,8 @@
1
1
  /**
2
- * Function to filter specific field inside a fields
3
- * Função para filtrar propriedades espessificas dentro de um objeto
2
+ * Função para filtrar propriedades especificas dentro de um objeto
4
3
  *
5
4
  * @param {object} fields objeto com propriedades
6
- * @param {array} models array de string com nomes das proproiedades que serão filtradas
5
+ * @param {array} models array de string com nomes das propriedades que serão filtradas
7
6
  * @returns {object} objeto com propriedades filtradas
8
7
  *
9
8
  * @example
@@ -6,6 +6,8 @@ export { default as base64ToBlob } from './base-64-to-blob.js'
6
6
  export { default as constructObject } from './construct-object.js'
7
7
  export { default as filterObject } from './filter-object.js'
8
8
  export { default as getGreatestCommonDivisor } from './get-greatest-common-divisor.js'
9
+ export { default as filterObjectToArray } from './filter-object-to-array.js'
10
+ export { default as filterListByHandle } from './filter-list-by-handle.js'
9
11
 
10
12
  export * from './filters.js'
11
13
  export * from './images.js'
package/src/index.scss CHANGED
@@ -8,10 +8,12 @@ $secondary-contrast: var(--q-secondary-contrast);
8
8
 
9
9
  // Asteroid variables
10
10
  :root {
11
- --qas-background-color: #fcfcff;
11
+ --qas-background-color: #f5f5f5;
12
+ --qas-generic-border-radius: 8px;
12
13
  }
13
14
 
14
15
  $background-color: var(--qas-background-color);
16
+ $generic-border-radius: var(--qas-generic-border-radius);
15
17
 
16
18
  @import './css/background';
17
19
  @import './css/border';
@@ -22,8 +24,8 @@ $background-color: var(--qas-background-color);
22
24
  @import './css/opacity';
23
25
  @import './css/shadow';
24
26
  @import './css/text';
25
- @import './css/transitions';
26
27
  @import './css/unset';
27
28
 
28
29
  // Design System
29
30
  @import './css/design-system';
31
+ @import './css/design-system/index';
@@ -2,7 +2,6 @@ import contextMixin from './context.js'
2
2
  import formMixin from './form.js'
3
3
  import generatorMixin from './generator.js'
4
4
  import passwordMixin from './password.js'
5
- import screenMixin from './screen.js'
6
5
  import viewMixin from './view.js'
7
6
 
8
7
  export {
@@ -10,6 +9,5 @@ export {
10
9
  formMixin,
11
10
  generatorMixin,
12
11
  passwordMixin,
13
- viewMixin,
14
- screenMixin
12
+ viewMixin
15
13
  }
@@ -111,6 +111,8 @@ export default {
111
111
 
112
112
  mx_updateModels (models) {
113
113
  for (const key in models) {
114
+ if (!models[key]) continue
115
+
114
116
  this.$emit(`update:${key}`, models[key])
115
117
  }
116
118
  }
@@ -0,0 +1,12 @@
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>
7
+
8
+ <script>
9
+ export default {
10
+ name: 'Forbidden'
11
+ }
12
+ </script>
@@ -0,0 +1,12 @@
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>
6
+ </template>
7
+
8
+ <script>
9
+ export default {
10
+ name: 'NotFound'
11
+ }
12
+ </script>
@@ -1,9 +1,11 @@
1
1
  import Dialog from './dialog/Dialog.js'
2
2
  import NotifyError from './notify-error/NotifyError.js'
3
3
  import NotifySuccess from './notify-success/NotifySuccess.js'
4
+ import Screen from './screen/Screen.js'
4
5
 
5
6
  export {
6
7
  Dialog,
7
8
  NotifyError,
9
+ Screen,
8
10
  NotifySuccess
9
11
  }
@@ -0,0 +1,35 @@
1
+ import { Screen, Platform } from 'quasar'
2
+
3
+ export default () => {
4
+ const screensModel = {
5
+ // até 599px
6
+ isSmall: () => Screen.xs,
7
+ // de 600 até 1023px
8
+ isMedium: () => Screen.sm,
9
+ // de 600 até 1023px
10
+ isLarge: () => Screen.gt.sm,
11
+ // de 0 até 599px
12
+ untilMedium: () => Screen.lt.sm,
13
+ // de 0 ate 1023px
14
+ untilLarge: () => Screen.lt.md,
15
+
16
+ // Plataforma
17
+ isMobile: () => Platform.is.mobile || false
18
+ }
19
+
20
+ const screens = {}
21
+
22
+ for (const key in screensModel) {
23
+ // infelizmente esta é a única forma que conseguimos para que nossa função se tornasse reativa na view
24
+ // é como o próprio quasar implementa
25
+ Object.defineProperty(screens, key, {
26
+ get () {
27
+ return screensModel[key]()
28
+ },
29
+
30
+ enumerable: true
31
+ })
32
+ }
33
+
34
+ return screens
35
+ }
@@ -0,0 +1,16 @@
1
+ type: component
2
+
3
+ meta:
4
+ desc: Plugin que implementa o "Screen" do quasar.
5
+
6
+ inject:
7
+ 'this.$qas.screen':
8
+ type: Object
9
+ debugger: true
10
+ default:
11
+ isSmall: false
12
+ isMedium: false
13
+ isLarge: false
14
+ untilMedium: false
15
+ untilLarge: false
16
+ isMobile: false
package/src/vue-plugin.js CHANGED
@@ -50,14 +50,19 @@ import QasUploader from './components/uploader/QasUploader.vue'
50
50
  import VueGoogleMaps from '@fawmi/vue-google-maps'
51
51
  import { Notify, Quasar, Dialog as QuasarDialog } from 'quasar'
52
52
 
53
+ // Plugins
53
54
  import {
54
55
  Dialog,
55
56
  NotifyError,
56
- NotifySuccess
57
+ NotifySuccess,
58
+ Screen
57
59
  } from './plugins'
58
60
 
59
61
  import packageInfo from '../package.json'
60
62
 
63
+ // Directives
64
+ import Test from './directives/Test.js'
65
+
61
66
  const version = packageInfo.version
62
67
 
63
68
  function install (app) {
@@ -119,8 +124,11 @@ function install (app) {
119
124
  app.config.globalProperties.$qas = {
120
125
  dialog: Dialog,
121
126
  error: NotifyError,
122
- success: NotifySuccess
127
+ success: NotifySuccess,
128
+ screen: Screen()
123
129
  }
130
+
131
+ app.directive(Test.name, Test)
124
132
  }
125
133
 
126
134
  export {
@@ -176,10 +184,11 @@ export {
176
184
  QasTransfer,
177
185
  QasUploader,
178
186
 
179
- // plugin
187
+ // plugins
180
188
  Dialog,
181
189
  NotifyError,
182
190
  NotifySuccess,
191
+ Screen,
183
192
 
184
193
  install
185
194
  }
@@ -1,12 +0,0 @@
1
- // Fade
2
- .fade-enter-active,
3
- .fade-leave-active {
4
- transform: translateY(0);
5
- transition: opacity 0.3s, transform 0.3s;
6
- }
7
-
8
- .fade-enter,
9
- .fade-leave-to {
10
- opacity: 0;
11
- transform: translateY(-100%);
12
- }
@@ -1,34 +0,0 @@
1
- export default {
2
- // TODO: Esses nomes precisam ser alterados para algo mais inteligente.
3
-
4
- computed: {
5
- mx_isSmall () {
6
- // until 599
7
- return this.$q.screen.xs
8
- },
9
-
10
- mx_isMedium () {
11
- // from 600 until 1023
12
- return this.$q.screen.sm
13
- },
14
-
15
- mx_isLarge () {
16
- // from 1024 until the limit
17
- return this.$q.screen.gt.sm
18
- },
19
-
20
- mx_untilMedium () {
21
- // from 0 until 599
22
- return this.$q.screen.lt.sm
23
- },
24
-
25
- mx_untilLarge () {
26
- // from 0 until 1023
27
- return this.$q.screen.lt.md
28
- },
29
-
30
- mx_isMobile () {
31
- return this.$q.platform.is.mobile
32
- }
33
- }
34
- }
@@ -1,43 +0,0 @@
1
- import { reactive } from 'vue'
2
- import { findLastIndex } from 'lodash-es'
3
-
4
- const history = reactive({ hasPreviousRoute: false, list: [] })
5
-
6
- function getPreviousRoute (currentRoute) {
7
- const index = findLastIndex(history.list, item => item.name === currentRoute.name)
8
-
9
- if (~index) {
10
- history.list.splice(index, 1)
11
- }
12
-
13
- history.hasPreviousRoute = history.list.length > 1
14
- return history.list[history.list.length - 1]
15
- }
16
-
17
- function addRoute (route) {
18
- const routeExistsInList = history.list?.[history.list?.length - 1]?.name === route.name
19
-
20
- if (routeExistsInList) return
21
-
22
- history.list.push(route)
23
- history.hasPreviousRoute = history.list.length > 1
24
- }
25
-
26
- function destroyRoutes (routes) {
27
- if (!history.list.length) return null
28
-
29
- routes.forEach(route => {
30
- const index = history.list.findIndex(item => item.name === route)
31
-
32
- if (~index) {
33
- history.list.splice(index, 1)
34
- }
35
- })
36
- }
37
-
38
- export {
39
- history,
40
- getPreviousRoute,
41
- addRoute,
42
- destroyRoutes
43
- }
@@ -1 +0,0 @@
1
- export * from './history.js'