@bildvitta/quasar-ui-asteroid 3.17.0-beta.9 → 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 (58) 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 +11 -2
  35. package/src/components/select/QasSelect.yml +1 -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/helpers/set-scroll-on-grab.js +9 -1
  56. package/src/shared/badge-config.js +29 -0
  57. package/src/vue-plugin.js +3 -0
  58. package/src/components/app-menu/private/PvAppMenuHelpChat.vue +0 -222
@@ -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>