@bildvitta/quasar-ui-asteroid 3.17.0-beta.8 → 3.17.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.
Files changed (59) hide show
  1. package/package.json +3 -2
  2. package/src/assets/sounds/nave-notification.mp3 +0 -0
  3. package/src/components/app-menu/QasAppMenu.vue +73 -15
  4. package/src/components/app-menu/QasAppMenu.yml +5 -5
  5. package/src/components/app-user/QasAppUser.vue +49 -40
  6. package/src/components/avatar/QasAvatar.vue +7 -8
  7. package/src/components/badge/QasBadge.vue +3 -29
  8. package/src/components/board-generator/QasBoardGenerator.vue +442 -40
  9. package/src/components/board-generator/QasBoardGenerator.yml +107 -12
  10. package/src/components/card/QasCard.vue +13 -4
  11. package/src/components/chart-view/QasChartView.vue +56 -3
  12. package/src/components/chart-view/QasChartView.yml +6 -0
  13. package/src/components/checkbox/QasCheckbox.vue +67 -11
  14. package/src/components/checkbox/QasCheckbox.yml +18 -0
  15. package/src/components/copy/QasCopy.vue +12 -2
  16. package/src/components/copy/QasCopy.yml +8 -0
  17. package/src/components/expansion-item/QasExpansionItem.vue +108 -76
  18. package/src/components/expansion-item/QasExpansionItem.yml +38 -10
  19. package/src/components/field/QasField.vue +1 -1
  20. package/src/components/form-generator/QasFormGenerator.vue +23 -10
  21. package/src/components/form-generator/QasFormGenerator.yml +2 -2
  22. package/src/components/grabbable/QasGrabbable.vue +14 -6
  23. package/src/components/grabbable/QasGrabbable.yml +4 -0
  24. package/src/components/grid-generator/QasGridGenerator.vue +3 -3
  25. package/src/components/grid-generator/QasGridGenerator.yml +2 -2
  26. package/src/components/grid-item/QasGridItem.vue +1 -1
  27. package/src/components/header/QasHeader.vue +11 -9
  28. package/src/components/infinite-scroll/QasInfiniteScroll.vue +16 -17
  29. package/src/components/infinite-scroll/QasInfiniteScroll.yml +7 -0
  30. package/src/components/list-view/QasListView.vue +16 -2
  31. package/src/components/list-view/QasListView.yml +9 -0
  32. package/src/components/radio/QasRadio.vue +24 -5
  33. package/src/components/radio/QasRadio.yml +6 -0
  34. package/src/components/select/QasSelect.vue +54 -7
  35. package/src/components/select/QasSelect.yml +6 -1
  36. package/src/components/select-filter/QasSelectFilter.vue +65 -0
  37. package/src/components/select-filter/QasSelectFilter.yml +36 -0
  38. package/src/components/stepper/QasStepper.vue +50 -3
  39. package/src/components/stepper-form-view/QasStepperFormView.vue +6 -4
  40. package/src/components/stepper-form-view/QasStepperFormView.yml +1 -1
  41. package/src/components/table-generator/QasTableGenerator.vue +3 -0
  42. package/src/components/text-truncate/QasTextTruncate.vue +77 -14
  43. package/src/components/text-truncate/QasTextTruncate.yml +14 -3
  44. package/src/components/uploader/QasUploader.vue +70 -24
  45. package/src/components/uploader/QasUploader.yml +15 -1
  46. package/src/components/welcome/QasWelcome.vue +8 -0
  47. package/src/components/welcome/QasWelcome.yml +3 -0
  48. package/src/composables/index.js +3 -1
  49. package/src/composables/private/index.js +1 -0
  50. package/src/composables/private/use-auth-user.js +20 -0
  51. package/src/composables/private/use-generator.js +20 -5
  52. package/src/composables/use-default-filters.js +106 -0
  53. package/src/composables/use-notifications.js +14 -0
  54. package/src/composables/use-query-cache.js +1 -1
  55. package/src/css/components/field.scss +13 -6
  56. package/src/helpers/set-scroll-on-grab.js +9 -1
  57. package/src/shared/badge-config.js +29 -0
  58. package/src/vue-plugin.js +3 -0
  59. package/src/components/app-menu/private/PvAppMenuHelpChat.vue +0 -222
@@ -44,15 +44,15 @@
44
44
  &--focused.q-field--labeled {
45
45
  transition: transform var(--qas-generic-transition), font-size var(--qas-generic-transition);
46
46
 
47
- .q-field__label {
47
+ &:not(&.qas-select--filter):not(&.qas-select--has-icon) .q-field__label {
48
48
  transform: translateY(-10px) scale(0.85) !important;
49
49
  }
50
50
 
51
- .q-field__prepend {
52
- transition: transform var(--qas-generic-transition);
53
- transform: translateY(6px) !important;
51
+ &.qas-select--filter:not(&.qas-select--has-icon) .q-field__label {
52
+ transform: translateY(-8px) scale(0.85) !important;
54
53
  }
55
54
 
55
+ .q-field__prepend,
56
56
  .q-field__append {
57
57
  transition: transform var(--qas-generic-transition);
58
58
  transform: translateY(6px) !important;
@@ -65,8 +65,8 @@
65
65
 
66
66
  &--float.qas-numeric-input--has-icon,
67
67
  &--focused.qas-numeric-input--has-icon,
68
- &--float.qas-select--has-icon,
69
- &--focused.qas-select--has-icon,
68
+ &--float.qas-select--has-icon:not(.qas-select--filter),
69
+ &--focused.qas-select--has-icon:not(.qas-select--filter),
70
70
  &--float.qas-input--has-icon,
71
71
  &--focused.qas-input--has-icon {
72
72
  .q-field__label {
@@ -74,6 +74,13 @@
74
74
  }
75
75
  }
76
76
 
77
+ &--float.qas-select--has-icon.qas-select--filter,
78
+ &--focused.qas-select--has-icon.qas-select--filter {
79
+ .q-field__label {
80
+ transform: translate(-24px, -8px) scale(0.85) !important;
81
+ }
82
+ }
83
+
77
84
  &--outlined .q-field__control {
78
85
  background-color: white;
79
86
  border-radius: $generic-border-radius;
@@ -7,10 +7,11 @@
7
7
  * onMoveFn: function({ element: HTMLElement, event: MouseEvent | TouchEvent }),
8
8
  * onScrollFn: function({ element: HTMLElement, event: Event })
9
9
  * }} options
10
+ * @param {String} cancelMouseDownTarget
10
11
  *
11
12
  * @returns {{ element: HTMLElement, destroyEvents: function }}
12
13
  */
13
- export default function (element, options = {}) {
14
+ export default function (element, options = {}, cancelMouseDownTarget) {
14
15
  let isDown = false
15
16
  let startX
16
17
  let scrollLeft
@@ -46,6 +47,13 @@ export default function (element, options = {}) {
46
47
  }
47
48
 
48
49
  function onMouseEnter (event) {
50
+ /**
51
+ * closest busca ancestral mais próximo de um elemento, ou seja, verifica se no event que recebo, tenho a classe no qual nao se deve aplicar o grab.
52
+ */
53
+ const targetElement = cancelMouseDownTarget ? event.target.closest(`.${cancelMouseDownTarget}`) : null
54
+
55
+ if (!!cancelMouseDownTarget && !!targetElement) return null
56
+
49
57
  onEnter()
50
58
 
51
59
  startX = event.pageX - element.offsetLeft
@@ -0,0 +1,29 @@
1
+ export const baseProps = {
2
+ color: {
3
+ type: String,
4
+ default: 'light-blue-2'
5
+ },
6
+
7
+ label: {
8
+ type: String,
9
+ default: ''
10
+ },
11
+
12
+ multiLine: {
13
+ type: Boolean
14
+ },
15
+
16
+ textColor: {
17
+ type: String,
18
+ default: 'black'
19
+ },
20
+
21
+ removable: {
22
+ type: Boolean
23
+ },
24
+
25
+ tabindex: {
26
+ type: [String, Number],
27
+ default: undefined
28
+ }
29
+ }
package/src/vue-plugin.js CHANGED
@@ -14,6 +14,7 @@ import QasBtnDropdown from './components/btn-dropdown/QasBtnDropdown.vue'
14
14
  import QasCard from './components/card/QasCard.vue'
15
15
  import QasCardImage from './components/card-image/QasCardImage.vue'
16
16
  import QasCheckbox from './components/checkbox/QasCheckbox.vue'
17
+ import QasSelectFilter from './components/select-filter/QasSelectFilter.vue'
17
18
  import QasCopy from './components/copy/QasCopy.vue'
18
19
  import QasDate from './components/date/QasDate.vue'
19
20
  import QasDateTimeInput from './components/date-time-input/QasDateTimeInput.vue'
@@ -112,6 +113,7 @@ async function install (app) {
112
113
  app.component('QasCard', QasCard)
113
114
  app.component('QasCardImage', QasCardImage)
114
115
  app.component('QasCheckbox', QasCheckbox)
116
+ app.component('QasSelectFilter', QasSelectFilter)
115
117
  app.component('QasCopy', QasCopy)
116
118
  app.component('QasDate', QasDate)
117
119
  app.component('QasDateTimeInput', QasDateTimeInput)
@@ -213,6 +215,7 @@ export {
213
215
  QasCard,
214
216
  QasCheckbox,
215
217
  QasCopy,
218
+ QasSelectFilter,
216
219
  QasDate,
217
220
  QasDateTimeInput,
218
221
  QasDebugger,
@@ -1,222 +0,0 @@
1
- <!-- O chat em si é renderizado em um iframe, o que QMenu, toda vez que fecha se auto destroy, então não podemos usar o
2
- iframe dentro do QMenu, pois toda vez que um iframe é destruído ele perde o seu estado, e teria que iniciar um novo chat,
3
- pra isto é criado um iframe no body, e posicionado com JS + CSS para ficar sobre o QMenu. -->
4
-
5
- <template>
6
- <q-menu class="pv-app-menu-help-chat shadow-2" v-bind="menuProps">
7
- <header class="q-pa-md">
8
- <q-img class="q-mb-md" :src="props.miniBrand" width="36px" />
9
-
10
- <h3 class="text-h3">
11
- Bem-vindo!
12
- </h3>
13
-
14
- <div class="text-body1">
15
- Deixe a sua mensagem para o suporte técnico da Nave.
16
- </div>
17
- </header>
18
-
19
- <qas-box class="full-width pv-app-menu-help-chat__content relative-position" :class="boxClasses">
20
- <div v-if="showIframe" ref="chatContent" class="full-width" />
21
-
22
- <div v-else class="full-width self-end">
23
- <div class="q-mb-sm text-subtitle2">
24
- Estamos conectados
25
- </div>
26
-
27
- <div class="text-body2">
28
- Normalmente responde em alguns minutos
29
- </div>
30
-
31
- <qas-btn class="full-width q-mt-lg" label="Iniciar conversa" variant="primary" @click="initializeChat" />
32
- </div>
33
-
34
- <q-inner-loading :showing="showInnerLoading">
35
- <q-spinner color="grey" size="2rem" />
36
- </q-inner-loading>
37
- </qas-box>
38
- </q-menu>
39
- </template>
40
-
41
- <script setup>
42
- import { useScreen } from '../../../composables'
43
-
44
- import { onMounted, onUnmounted, ref, nextTick, computed } from 'vue'
45
-
46
- defineOptions({ name: 'PvAppMenuHelpChat' })
47
-
48
- const props = defineProps({
49
- link: {
50
- type: String,
51
- default: ''
52
- },
53
-
54
- miniBrand: {
55
- type: String,
56
- default: ''
57
- }
58
- })
59
-
60
- const screen = useScreen()
61
-
62
- // refs
63
- const chatContent = ref(null)
64
- const isOpened = ref(false)
65
- const showIframe = ref(false)
66
- const showInnerLoading = ref(false)
67
-
68
- // computed
69
- const boxClasses = computed(() => {
70
- return {
71
- flex: !showIframe.value,
72
- 'pv-app-menu-help-chat__content--is-opened': showIframe.value
73
- }
74
- })
75
-
76
- const menuProps = computed(() => {
77
- return {
78
- anchor: screen.isSmall ? 'top middle' : 'top right',
79
- maxWidth: screen.isSmall ? '300px' : '400px',
80
- self: screen.isSmall ? 'bottom middle' : 'top left',
81
- touchPosition: !screen.isSmall,
82
-
83
- onBeforeHide: hideIframe,
84
- onShow
85
- }
86
- })
87
-
88
- // hooks
89
-
90
- /**
91
- * Toda vez que a prop "behavior" do componente "QasAppMenu" é alterada, este componente
92
- * é renderizado novamente, então é necessário esconder o iframe caso ele ja esteja aberto.
93
- */
94
- onMounted(hideIframe)
95
-
96
- onUnmounted(() => {
97
- if (showIframe.value) {
98
- window.removeEventListener('scroll', onScroll)
99
- window.removeEventListener('resize', onScroll)
100
- }
101
- })
102
-
103
- // functions
104
-
105
- /**
106
- * Define o estilo do iframe de acordo com a posição do "chatContent" dentro
107
- * do QMenu.
108
- */
109
- async function setIframeStyle () {
110
- await nextTick()
111
-
112
- const iframe = getIframe()
113
-
114
- if (!iframe || !chatContent.value) return
115
-
116
- const { bottom, left, top } = chatContent.value.getBoundingClientRect()
117
-
118
- const width = chatContent.value.offsetWidth
119
-
120
- const styles = {
121
- display: 'block',
122
- top: `${bottom + window.scrollY}px`,
123
- left: `${left + window.scrollX}px`,
124
- bottom: `${top}px`,
125
- width: `${width}px`
126
- }
127
-
128
- Object.assign(iframe.style, styles)
129
- }
130
-
131
- function onShow () {
132
- isOpened.value = true
133
-
134
- if (showIframe.value) setIframeStyle()
135
- }
136
-
137
- function hideIframe () {
138
- isOpened.value = false
139
-
140
- const iframe = getIframe()
141
-
142
- if (!iframe) return
143
-
144
- iframe.style.display = 'none'
145
- }
146
-
147
- function onScroll () {
148
- if (isOpened.value) setIframeStyle()
149
- }
150
-
151
- function createIframe () {
152
- const iframe = document.createElement('iframe')
153
-
154
- iframe.id = 'chat-iframe'
155
- iframe.className = 'pv-app-menu-help-chat__iframe'
156
- iframe.style.display = 'none'
157
- iframe.src = props.link
158
-
159
- document.body.appendChild(iframe)
160
- }
161
-
162
- function getIframe () {
163
- return document.getElementById('chat-iframe')
164
- }
165
-
166
- function initializeChat () {
167
- createIframe()
168
-
169
- window.addEventListener('scroll', onScroll)
170
- window.addEventListener('resize', onScroll)
171
-
172
- toggleIframe()
173
- }
174
-
175
- function toggleIframe () {
176
- showIframe.value = !showIframe.value
177
-
178
- showInnerLoading.value = true
179
-
180
- /**
181
- * É adicionado um loading por 3 motivos:
182
- * - o iframe demora um pouco para ser carregado
183
- * - o loading é um feedback visual para o usuário enquanto o iframe é carregado
184
- * - não é possível adicionar uma animação aparecendo o iframe, então desta
185
- * forma fica suavizado
186
- */
187
- setTimeout(async () => {
188
- showInnerLoading.value = false
189
-
190
- await nextTick()
191
-
192
- onShow()
193
- }, 2000)
194
- }
195
- </script>
196
-
197
- <style lang="scss">
198
- .pv-app-menu-help-chat {
199
- overflow-y: hidden;
200
-
201
- &__content {
202
- height: 260px;
203
- background-color: var(--qas-background-color) !important;
204
- }
205
-
206
- &__iframe {
207
- border: 0;
208
- border-radius: var(--qas-generic-border-radius);
209
- outline: none;
210
- position: absolute;
211
- height: calc(260px - calc(var(--qas-spacing-md) * 2));
212
- z-index: 9999;
213
- }
214
-
215
- // Media: isSmall
216
- @media (max-width: $breakpoint-sm-min) {
217
- &__content--is-opened {
218
- padding: var(--qas-spacing-sm) !important;
219
- }
220
- }
221
- }
222
- </style>