@bildvitta/quasar-ui-asteroid 3.20.0-beta.2 → 3.20.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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bildvitta/quasar-ui-asteroid",
3
3
  "description": "Asteroid",
4
- "version": "3.20.0-beta.2",
4
+ "version": "3.20.0-beta.3",
5
5
  "author": "Bild & Vitta <systemteam@bild.com.br>",
6
6
  "license": "MIT",
7
7
  "main": "./src/asteroid.js",
@@ -81,6 +81,13 @@ export default {
81
81
  */
82
82
  btnPropsDefaults: {
83
83
  size: 'sm'
84
+ },
85
+
86
+ /**
87
+ * @see QasTextTruncate.vue - Injetando os valores padrões para o QasTextTruncate.
88
+ */
89
+ textTruncatePropsDefaults: {
90
+ typography: 'body2'
84
91
  }
85
92
  }
86
93
  },
@@ -577,10 +584,11 @@ export default {
577
584
  }
578
585
  }
579
586
 
587
+ line-height: 100% !important;
580
588
  padding-bottom: var(--qas-spacing-sm);;
581
589
  padding-left: 0;
582
- padding-top: 0;
583
590
  padding-right: var(--qas-spacing-md);
591
+ padding-top: 0;
584
592
  }
585
593
 
586
594
  td,
@@ -601,6 +609,10 @@ export default {
601
609
  z-index: 0;
602
610
  padding-right: var(--qas-spacing-md);
603
611
 
612
+ * {
613
+ line-height: 100% !important;
614
+ }
615
+
604
616
  &::before {
605
617
  position: absolute;
606
618
  content: '';
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <div ref="parent" :class="classes">
3
- <div class="no-wrap row text-no-wrap">
3
+ <div class="items-center no-wrap row text-no-wrap">
4
4
  <!-- "data-table-hover" habilita o hover no texto dentro do QasTableGenerator -->
5
5
  <div ref="truncate" class="ellipsis" data-table-hover>
6
6
  <slot>
@@ -51,6 +51,8 @@ import {
51
51
  onMounted,
52
52
  onUnmounted,
53
53
  ref,
54
+ inject,
55
+ isRef,
54
56
  watch
55
57
  } from 'vue'
56
58
 
@@ -100,7 +102,7 @@ const props = defineProps({
100
102
 
101
103
  typography: {
102
104
  type: String,
103
- default: 'body1'
105
+ default: undefined
104
106
  },
105
107
 
106
108
  list: {
@@ -121,6 +123,9 @@ const props = defineProps({
121
123
  }
122
124
  })
123
125
 
126
+ // globals
127
+ const injectedDefaults = inject('textTruncatePropsDefaults', {}) // Inject reativo ou não reativo com fallback vazio
128
+
124
129
  // template refs
125
130
  const truncate = ref(null)
126
131
  const parent = ref(null)
@@ -158,7 +163,25 @@ const {
158
163
  useMutationObserver({ truncate, callbackFn: truncateText })
159
164
 
160
165
  // computeds
161
- const classes = computed(() => [`text-${props.color}`, `text-${props.typography}`])
166
+ /**
167
+ * Seta os valores padrões, dando prioridade:
168
+ * 1. Props
169
+ * 2. Injetado (pode ser reativo ou não reativo)
170
+ * 3. Caso esteja dentro do QasBox, seta o size para 'sm' se for primary ou secondary.
171
+ * 4. Hardcoded (tertiary, md, primary)
172
+ */
173
+ const textTruncatePropsDefaults = computed(() => {
174
+ const defaultProps = isRef(injectedDefaults) ? injectedDefaults.value : injectedDefaults
175
+
176
+ return {
177
+ typography: 'body1',
178
+ ...defaultProps
179
+ }
180
+ })
181
+
182
+ const defaultTypography = computed(() => props.typography || textTruncatePropsDefaults.value.typography)
183
+
184
+ const classes = computed(() => [`text-${props.color}`, `text-${defaultTypography.value}`])
162
185
 
163
186
  const formattedText = computed(() => props.list.length || props.text ? displayText.value : props.emptyText)
164
187
 
@@ -1,5 +1,6 @@
1
1
  <template>
2
- <div class="qas-toggle-visibility">
2
+ <!-- "data-no-grab" para prevenir o click drag -->
3
+ <div class="qas-toggle-visibility" data-no-grab>
3
4
  <!-- "data-table-ignore-tr-hover" é para desabilitar o hover do tr no QasTableGenerator -->
4
5
  <div :aria-expanded="isVisible" aria-label="Alternar visibilidade do conteúdo" class="cursor-pointer items-center no-wrap qas-toggle-visibility__container row" data-table-ignore-tr-hover role="button" :style @click.prevent.stop="toggleVisibility">
5
6
  <div class="ellipsis qas-toggle-visibility__content">
@@ -14,7 +14,7 @@
14
14
  padding: var(--qas-spacing-xs) var(--qas-spacing-md) !important;
15
15
 
16
16
  .q-icon {
17
- font-size: 18fpx !important;
17
+ font-size: 18px !important;
18
18
  }
19
19
 
20
20
  &.qas-btn--icon-only.qas-btn--primary,
@@ -24,8 +24,8 @@
24
24
  }
25
25
 
26
26
  &.qas-btn--icon-only.qas-btn--tertiary {
27
- height: 16px !important;
28
- width: 16px !important;
27
+ height: 18px !important;
28
+ width: 18px !important;
29
29
  }
30
30
  }
31
31
 
@@ -49,10 +49,13 @@ export default function (element, options = {}, cancelMouseDownTarget) {
49
49
  function onMouseEnter (event) {
50
50
  /**
51
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
52
+ */
54
53
 
55
- if (!!cancelMouseDownTarget && !!targetElement) return null
54
+ const elementListToCancel = ['button', `.${cancelMouseDownTarget}`, '[data-no-grab]']
55
+
56
+ const canCancelMouseDownTarget = elementListToCancel.some(tag => event.target.closest(tag))
57
+
58
+ if (canCancelMouseDownTarget) return
56
59
 
57
60
  onEnter()
58
61