@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
@@ -123,6 +123,10 @@
123
123
  "description": "Esconde o rótulo (label) do botão quando o tamanho da tela for pequeno.",
124
124
  "type": "boolean"
125
125
  },
126
+ "qas-btn/label": {
127
+ "description": "Rótulo do botão.",
128
+ "type": "string"
129
+ },
126
130
  "qas-card/bg-image-position": {
127
131
  "description": "Posição da imagem \"background-position\".",
128
132
  "type": "string"
@@ -71,7 +71,8 @@
71
71
  },
72
72
  "qas-btn": {
73
73
  "attributes": [
74
- "hide-label-on-small-screen"
74
+ "hide-label-on-small-screen",
75
+ "label"
75
76
  ],
76
77
  "description": "O mesmo botão do Quasar (QBtn), mas com o nosso estilo, tem acesso a todas propriedades do componente do quasar. Tem a função de criar gatilhos para ações. Eles podem ser utilizados isoladamente ou ​​como parte de outros componentes de padrões maiores, como formulários, caixas de diálogo e feedbacks."
77
78
  },
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bildvitta/quasar-ui-asteroid",
3
3
  "description": "Asteroid",
4
- "version": "3.0.0-beta.2",
4
+ "version": "3.0.0-beta.3",
5
5
  "author": "Bild & Vitta <systemteam@bild.com.br>",
6
6
  "license": "MIT",
7
7
  "main": "dist/asteroid.cjs.min.js",
@@ -11,13 +11,9 @@
11
11
  </template>
12
12
 
13
13
  <script>
14
- import { screenMixin } from '../../mixins'
15
-
16
14
  export default {
17
15
  name: 'QasActions',
18
16
 
19
- mixins: [screenMixin],
20
-
21
17
  props: {
22
18
  align: {
23
19
  default: 'end',
@@ -37,7 +33,7 @@ export default {
37
33
  return [
38
34
  `justify-${this.align}`,
39
35
  `q-col-gutter-${this.gutter}`,
40
- this.mx_isSmall ? 'column reverse' : 'row'
36
+ this.$qas.screen.isSmall ? 'column reverse' : 'row'
41
37
  ]
42
38
  }
43
39
  }
@@ -44,14 +44,11 @@
44
44
  </template>
45
45
 
46
46
  <script>
47
- import { screenMixin } from '../../mixins'
48
47
  import { isLocalDevelopment } from '../../helpers'
49
48
 
50
49
  export default {
51
50
  name: 'QasAppMenu',
52
51
 
53
- mixins: [screenMixin],
54
-
55
52
  props: {
56
53
  items: {
57
54
  default: () => [],
@@ -153,7 +150,7 @@ export default {
153
150
  },
154
151
 
155
152
  beforeHide () {
156
- if (this.mx_isLarge) {
153
+ if (this.$qas.screen.isLarge) {
157
154
  this.model = true
158
155
  this.miniMode = !this.miniMode
159
156
  }
@@ -9,35 +9,34 @@
9
9
  </template>
10
10
 
11
11
  <script>
12
- import { screenMixin } from '../../mixins'
13
-
14
12
  export default {
15
13
  name: 'QasBtn',
16
14
 
17
- mixins: [screenMixin],
18
-
19
15
  props: {
20
16
  hideLabelOnSmallScreen: {
21
17
  type: Boolean
18
+ },
19
+
20
+ label: {
21
+ type: String,
22
+ default: ''
22
23
  }
23
24
  },
24
25
 
25
26
  computed: {
26
27
  attributes () {
27
- const { label, ...attributes } = this.$attrs
28
-
29
28
  return {
30
- ...(this.showLabel && { label }),
31
- ...attributes
29
+ ...(this.showLabel && { label: this.label }),
30
+ ...this.$attrs
32
31
  }
33
32
  },
34
33
 
35
34
  hasLabel () {
36
- return !!(this.$attrs.label || this.$slots.default)
35
+ return !!(this.label || this.$slots.default)
37
36
  },
38
37
 
39
38
  showLabel () {
40
- return this.hasLabel && !(this.hideLabelOnSmallScreen && this.mx_isSmall)
39
+ return this.hasLabel && !(this.hideLabelOnSmallScreen && this.$qas.screen.isSmall)
41
40
  },
42
41
 
43
42
  slots () {
@@ -10,4 +10,7 @@ props:
10
10
  hide-label-on-small-screen:
11
11
  desc: Esconde o rótulo (label) do botão quando o tamanho da tela for pequeno.
12
12
  type: Boolean
13
- default: 'false'
13
+
14
+ label:
15
+ desc: Rótulo do botão.
16
+ type: String
@@ -39,8 +39,6 @@
39
39
  import QasBtn from '../btn/QasBtn.vue'
40
40
  import QasActions from '../actions/QasActions.vue'
41
41
 
42
- import screenMixin from '../../mixins/screen'
43
-
44
42
  export default {
45
43
  name: 'QasDialog',
46
44
 
@@ -49,8 +47,6 @@ export default {
49
47
  QasActions
50
48
  },
51
49
 
52
- mixins: [screenMixin],
53
-
54
50
  props: {
55
51
  actionsProps: {
56
52
  default: () => ({}),
@@ -133,8 +129,8 @@ export default {
133
129
 
134
130
  style () {
135
131
  return {
136
- maxWidth: this.maxWidth || (this.mx_isSmall ? '' : '600px'),
137
- minWidth: this.minWidth || (this.mx_isSmall ? '' : '400px')
132
+ maxWidth: this.maxWidth || (this.$qas.screen.isSmall ? '' : '600px'),
133
+ minWidth: this.minWidth || (this.$qas.screen.isSmall ? '' : '400px')
138
134
  }
139
135
  },
140
136
 
@@ -42,7 +42,7 @@ import { NotifyError, NotifySuccess } from '../../plugins'
42
42
  import QasBtn from '../btn/QasBtn.vue'
43
43
  import QasDialog from '../dialog/QasDialog.vue'
44
44
 
45
- import { viewMixin, screenMixin } from '../../mixins'
45
+ import { viewMixin } from '../../mixins'
46
46
 
47
47
  export default {
48
48
  name: 'QasFormView',
@@ -52,7 +52,7 @@ export default {
52
52
  QasDialog
53
53
  },
54
54
 
55
- mixins: [viewMixin, screenMixin],
55
+ mixins: [viewMixin],
56
56
 
57
57
  props: {
58
58
  cancelButton: {
@@ -146,7 +146,7 @@ export default {
146
146
 
147
147
  computed: {
148
148
  cancelButtonClass () {
149
- return this.mx_isSmall && 'order-last'
149
+ return this.$qas.screen.isSmall && 'order-last'
150
150
  },
151
151
 
152
152
  fetchURL () {
@@ -174,7 +174,7 @@ export default {
174
174
  },
175
175
 
176
176
  saveButtonClass () {
177
- return this.mx_isSmall && 'order-first'
177
+ return this.$qas.screen.isSmall && 'order-first'
178
178
  },
179
179
 
180
180
  isCancelButtonDisabled () {
@@ -17,9 +17,9 @@
17
17
  </div>
18
18
  </template>
19
19
  <template #description>
20
- <q-carousel v-model="imageIndex" animated :arrows="!mx_isSmall" control-text-color="primary" :fullscreen="mx_isSmall" :height="carouselImageHeight" :next-icon="carouselNextIcon" :prev-icon="carouselPreviousIcon" swipeable :thumbnails="showThumbnails">
20
+ <q-carousel v-model="imageIndex" animated :arrows="!$qas.screen.isSmall" control-text-color="primary" :fullscreen="$qas.screen.isSmall" :height="carouselImageHeight" :next-icon="carouselNextIcon" :prev-icon="carouselPreviousIcon" swipeable :thumbnails="showThumbnails">
21
21
  <q-carousel-slide v-for="(image, index) in clonedImages" :key="index" class="bg-no-repeat bg-size-contain" :img-src="image" :name="index">
22
- <div v-if="mx_isSmall" class="full-width justify-end row">
22
+ <div v-if="$qas.screen.isSmall" class="full-width justify-end row">
23
23
  <qas-btn dense flat icon="o_close" @click="toggleCarouselDialog" />
24
24
  </div>
25
25
  </q-carousel-slide>
@@ -31,13 +31,9 @@
31
31
  </template>
32
32
 
33
33
  <script>
34
- import screenMixin from '../../mixins/screen'
35
-
36
34
  export default {
37
35
  name: 'QasGallery',
38
36
 
39
- mixins: [screenMixin],
40
-
41
37
  props: {
42
38
  carouselNextIcon: {
43
39
  type: String,
@@ -94,13 +90,13 @@ export default {
94
90
  return this.height || 'auto'
95
91
  }
96
92
 
97
- return this.mx_isSmall ? '90px' : '120px'
93
+ return this.$qas.screen.isSmall ? '90px' : '120px'
98
94
  },
99
95
 
100
96
  galleryColumnsClasses () {
101
97
  if (this.isSingleImage) return 'col-12'
102
98
 
103
- return this.mx_isSmall ? 'col-6' : 'col-2'
99
+ return this.$qas.screen.isSmall ? 'col-6' : 'col-2'
104
100
  },
105
101
 
106
102
  hideShowMore () {
@@ -25,7 +25,6 @@
25
25
 
26
26
  <script>
27
27
  import filterObject from '../../helpers/filter-object'
28
- import screenMixin from '../../mixins/screen'
29
28
 
30
29
  import QasAvatar from '../avatar/QasAvatar.vue'
31
30
  import QasBox from '../box/QasBox.vue'
@@ -40,8 +39,6 @@ export default {
40
39
  QasGridGenerator
41
40
  },
42
41
 
43
- mixins: [screenMixin],
44
-
45
42
  props: {
46
43
  columns: {
47
44
  type: Object,
@@ -82,7 +79,7 @@ export default {
82
79
 
83
80
  computed: {
84
81
  directionClasses () {
85
- return this.mx_untilMedium ? 'col' : 'row items-center'
82
+ return this.$qas.screen.untilMedium ? 'col' : 'row items-center'
86
83
  },
87
84
 
88
85
  userAvatarImage () {
@@ -90,7 +87,7 @@ export default {
90
87
  },
91
88
 
92
89
  avatarSize () {
93
- return this.mx_isSmall ? '145px' : '188px'
90
+ return this.$qas.screen.isSmall ? '145px' : '188px'
94
91
  }
95
92
  },
96
93
 
@@ -24,7 +24,6 @@
24
24
 
25
25
  <script>
26
26
  import { sortBy } from 'lodash-es'
27
- import { screenMixin } from '../../mixins'
28
27
 
29
28
  import QasBtn from '../btn/QasBtn.vue'
30
29
  import QasSearchBox from '../search-box/QasSearchBox.vue'
@@ -37,8 +36,6 @@ export default {
37
36
  QasSearchBox
38
37
  },
39
38
 
40
- mixins: [screenMixin],
41
-
42
39
  props: {
43
40
  deleteOnly: {
44
41
  type: Boolean
@@ -144,9 +141,9 @@ export default {
144
141
  const isSelected = this.values.includes(value)
145
142
 
146
143
  return {
147
- dense: this.mx_isSmall,
144
+ dense: this.$qas.screen.isSmall,
148
145
  hideLabelOnSmallScreen: true,
149
- icon: !this.mx_isSmall ? undefined : isSelected ? 'o_close' : 'o_add',
146
+ icon: !this.$qas.screen.isSmall ? undefined : isSelected ? 'o_close' : 'o_add',
150
147
  label: isSelected ? 'Remover' : 'Adicionar',
151
148
  outline: isSelected,
152
149
  size: 'sm'
@@ -38,7 +38,6 @@
38
38
  import QasDialog from '../dialog/QasDialog.vue'
39
39
  import QasUploader from '../uploader/QasUploader.vue'
40
40
  import QasSignaturePad from '../signature-pad/QasSignaturePad.vue'
41
- import { screenMixin } from '../../mixins'
42
41
  import { base64ToBlob } from '../../helpers'
43
42
  import { NotifyError } from '../../plugins'
44
43
 
@@ -51,8 +50,6 @@ export default {
51
50
  QasSignaturePad
52
51
  },
53
52
 
54
- mixins: [screenMixin],
55
-
56
53
  props: {
57
54
  dialogProps: {
58
55
  type: Object,
@@ -118,18 +115,18 @@ export default {
118
115
 
119
116
  signaturePadWidth () {
120
117
  const sizes = {
121
- [this.mx_isSmall]: { width: '100%' },
122
- [this.mx_isMedium]: { width: '570px' },
123
- [this.mx_isLarge]: { width: '350px' }
118
+ [this.$qas.screen.isSmall]: { width: '100%' },
119
+ [this.$qas.screen.isMedium]: { width: '570px' },
120
+ [this.$qas.screen.isLarge]: { width: '350px' }
124
121
  }
125
122
  return sizes.true
126
123
  },
127
124
 
128
125
  signaturePadHeight () {
129
126
  const sizes = {
130
- [this.mx_isSmall]: '250',
131
- [this.mx_isMedium]: '400',
132
- [this.mx_isLarge]: '250'
127
+ [this.$qas.screen.isSmall]: '250',
128
+ [this.$qas.screen.isMedium]: '400',
129
+ [this.$qas.screen.isLarge]: '250'
133
130
  }
134
131
 
135
132
  return sizes.true
@@ -16,13 +16,10 @@
16
16
  import { extend } from 'quasar'
17
17
  import { humanize } from '../../helpers/filters'
18
18
  import { setScrollOnGrab } from '../../helpers'
19
- import screenMixin from '../../mixins/screen'
20
19
 
21
20
  export default {
22
21
  name: 'QasTableGenerator',
23
22
 
24
- mixins: [screenMixin],
25
-
26
23
  props: {
27
24
  columns: {
28
25
  default: () => [],
@@ -149,7 +146,7 @@ export default {
149
146
  },
150
147
 
151
148
  tableClass () {
152
- return this.mx_isSmall && 'qas-table-generator--mobile'
149
+ return this.$qas.screen.isSmall && 'qas-table-generator--mobile'
153
150
  },
154
151
 
155
152
  hasScrollOnGrab () {
@@ -18,7 +18,6 @@
18
18
  </template>
19
19
 
20
20
  <script>
21
- import screenMixin from '../../mixins/screen'
22
21
  import QasDialog from '../dialog/QasDialog.vue'
23
22
 
24
23
  export default {
@@ -28,8 +27,6 @@ export default {
28
27
  QasDialog
29
28
  },
30
29
 
31
- mixins: [screenMixin],
32
-
33
30
  props: {
34
31
  dialogProps: {
35
32
  type: Object,
@@ -69,7 +66,7 @@ export default {
69
66
 
70
67
  computed: {
71
68
  truncateTextClass () {
72
- return (this.isTruncated || this.mx_isSmall) && 'ellipsis q-pr-sm'
69
+ return (this.isTruncated || this.$qas.screen.isSmall) && 'ellipsis q-pr-sm'
73
70
  },
74
71
 
75
72
  isTruncated () {
@@ -49,7 +49,6 @@
49
49
  </template>
50
50
 
51
51
  <script>
52
- import { screenMixin } from '../../mixins'
53
52
  import { extend } from 'quasar'
54
53
 
55
54
  import QasBtn from '../btn/QasBtn.vue'
@@ -65,8 +64,6 @@ export default {
65
64
  QasSearchBox
66
65
  },
67
66
 
68
- mixins: [screenMixin],
69
-
70
67
  props: {
71
68
  emitValue: {
72
69
  type: Boolean
@@ -124,15 +121,15 @@ export default {
124
121
 
125
122
  computed: {
126
123
  actionsClass () {
127
- return !this.mx_isSmall && 'column'
124
+ return !this.$qas.screen.isSmall && 'column'
128
125
  },
129
126
 
130
127
  gutterClass () {
131
- return `q-col-gutter-${this.mx_untilLarge ? 'md' : 'xl'}`
128
+ return `q-col-gutter-${this.$qas.screen.untilLarge ? 'md' : 'xl'}`
132
129
  },
133
130
 
134
131
  iconClass () {
135
- return !this.mx_isSmall && 'qas-transfer__icon'
132
+ return !this.$qas.screen.isSmall && 'qas-transfer__icon'
136
133
  },
137
134
 
138
135
  searchBoxProps () {
@@ -0,0 +1,3 @@
1
+ import { useRoute } from 'vue-router'
2
+
3
+ console.log(useRoute(), '>>>')
@@ -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
+ );
package/src/index.scss CHANGED
@@ -28,3 +28,4 @@ $generic-border-radius: var(--qas-generic-border-radius);
28
28
 
29
29
  // Design System
30
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
  }
@@ -2,10 +2,15 @@ import { Screen, Platform } from 'quasar'
2
2
 
3
3
  export default () => {
4
4
  const screensModel = {
5
+ // até 599px
5
6
  isSmall: () => Screen.xs,
7
+ // de 600 até 1023px
6
8
  isMedium: () => Screen.sm,
9
+ // de 600 até 1023px
7
10
  isLarge: () => Screen.gt.sm,
11
+ // de 0 até 599px
8
12
  untilMedium: () => Screen.lt.sm,
13
+ // de 0 ate 1023px
9
14
  untilLarge: () => Screen.lt.md,
10
15
 
11
16
  // Plataforma
@@ -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
- }