@usssa/component-library 1.0.0-beta.13 → 1.0.0-beta.14

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/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Component Library v1.0.0-alpha.267
1
+ # Component Library v1.0.0-alpha.273
2
2
 
3
3
  **This library provides custom UI components for USSSA applications**
4
4
 
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@usssa/component-library",
3
- "version": "1.0.0-beta.13",
3
+ "version": "1.0.0-beta.14",
4
4
  "description": "A Quasar component library project",
5
- "productName": "Quasar component library App",
5
+ "productName": "Quasar component library app",
6
6
  "author": "Engineering Team <engineering@usssa.com>",
7
7
  "main": "src/components/index.js",
8
8
  "files": [
@@ -4,6 +4,7 @@ import { useScreenType } from '../../composables/useScreenType'
4
4
  import UBtnStd from './UBtnStd.vue'
5
5
  import UInputTextStd from './UInputTextStd.vue'
6
6
  import USheet from './USheet.vue'
7
+ import { debounce } from 'quasar'
7
8
 
8
9
  const date = defineModel('date', { default: null })
9
10
 
@@ -63,6 +64,10 @@ const props = defineProps({
63
64
  toolTipText: {
64
65
  type: String,
65
66
  },
67
+ useDebounce: {
68
+ type: Boolean,
69
+ default: false,
70
+ },
66
71
  validationRules: { type: Array, default: () => [] },
67
72
  })
68
73
 
@@ -115,7 +120,7 @@ const onUpdateSheet = (value) => {
115
120
  }
116
121
  }
117
122
 
118
- const onUpdateValue = (value) => {
123
+ const updateValue = (value) => {
119
124
  if (value.search('-') > -1) {
120
125
  date.value = { from: value.split('-')[0], to: value.split('-')[1] }
121
126
  } else {
@@ -123,6 +128,16 @@ const onUpdateValue = (value) => {
123
128
  }
124
129
  }
125
130
 
131
+ const debouncedUpdateValue = debounce(updateValue, 1000)
132
+
133
+ const onUpdateValue = (value) => {
134
+ if (props.useDebounce) {
135
+ debouncedUpdateValue(value)
136
+ } else {
137
+ updateValue(value)
138
+ }
139
+ }
140
+
126
141
  const openDatePicker = () => {
127
142
  if ($screen.value.isMobile) {
128
143
  openDialogs()
@@ -183,6 +198,7 @@ watch(
183
198
  <UInputTextStd
184
199
  v-model="selectedDate"
185
200
  :class="inputClass ? inputClass : ''"
201
+ autocomplete="off"
186
202
  :borderless="borderless"
187
203
  :dataTestId="dataTestId"
188
204
  :disable="disable"
@@ -205,7 +221,7 @@ watch(
205
221
  aria-label="open date picker"
206
222
  :flat="true"
207
223
  :size="size"
208
- :tabindex="disable ? -1 : 0"
224
+ :tabindex="-1"
209
225
  @mousedown.prevent
210
226
  @touchstart.prevent="openDatePicker"
211
227
  @on-click="openDatePicker"
@@ -214,7 +230,7 @@ watch(
214
230
  class="cursor-pointer date-picker-icon fa-kit-duotone fa-calendar-event"
215
231
  alt="open date picker"
216
232
  size="1rem"
217
- tabindex="-1"
233
+ tabindex="0"
218
234
  >
219
235
  <q-popup-proxy
220
236
  v-if="!$screen.isMobile"
@@ -260,7 +276,7 @@ watch(
260
276
  :dataTestId="dataTestId"
261
277
  :hint-icon="hintIcon"
262
278
  :mask="`${range ? '##/##/####-##/##/####' : '##/##/####'}`"
263
- tabindex="-1"
279
+ tabindex="0"
264
280
  @update:modelValue="onUpdateSheet"
265
281
  >
266
282
  <template #append>
@@ -269,13 +285,13 @@ watch(
269
285
  aria-label="open date picker"
270
286
  :flat="true"
271
287
  :size="size"
272
- :tabindex="disable ? -1 : 0"
288
+ :tabindex="-1"
273
289
  >
274
290
  <q-icon
275
291
  class="cursor-pointer date-picker-icon fa-kit-duotone fa-calendar-event"
276
292
  alt="open date picker"
277
293
  size="1rem"
278
- tabindex="-1"
294
+ tabindex="0"
279
295
  >
280
296
  </q-icon>
281
297
  </UBtnStd>
@@ -565,18 +581,36 @@ watch(
565
581
  padding: 0px !important
566
582
  min-width: 0px !important
567
583
 
584
+ // remove hover background
585
+ &:hover
586
+ background: transparent !important
587
+ box-shadow: none !important
588
+
589
+ // disable ripple effect
590
+ .q-ripple
591
+ display: none !important
592
+
593
+
568
594
  &.q-hoverable:hover > .q-focus-helper
569
595
  opacity: 0
570
596
 
571
597
  &:focus-visible
572
- outline: auto !important
598
+ background: transparent !important
599
+ box-shadow: none !important
600
+ outline: none !important
601
+
602
+ .q-focus-helper
603
+ display: none !important
604
+ background: transparent !important
573
605
 
574
- .q-focus-helper
575
- display: none
576
606
 
577
607
  .date-picker-icon
578
608
  color: $description
579
609
 
610
+ &:focus-visible
611
+ outline: auto !important
612
+
613
+
580
614
  .selected-month-year
581
615
  color: #12316C
582
616
  background: #234ba926
@@ -1,5 +1,5 @@
1
1
  <script setup>
2
- import { computed, ref } from 'vue'
2
+ import { computed, onMounted, ref } from 'vue'
3
3
 
4
4
  import defaultImage from '../../assets/no-result.svg'
5
5
  import { useScreenType } from '../../composables/useScreenType'
@@ -48,13 +48,27 @@ const props = defineProps({
48
48
  eventViewText: {
49
49
  type: String,
50
50
  },
51
+ isRegisterEventActionDisabled: {
52
+ type: Boolean,
53
+ default: false,
54
+ },
55
+ isViewEventActionDisabled: {
56
+ type: Boolean,
57
+ default: false,
58
+ },
59
+ registerEventTooltip: {
60
+ type: String,
61
+ default: '',
62
+ },
51
63
  })
52
64
 
65
+ const VERTICAL_TEXT_LIMIT = 13
66
+
53
67
  const $screen = useScreenType()
68
+
54
69
  const eventChip = ref(true) // this is required to show chip
55
70
  const isCategoryOverflowing = ref(false)
56
71
  const isNameOverflowing = ref(false)
57
- const textECategory = ref(null)
58
72
  const textEName = ref(null)
59
73
 
60
74
  const eventAgeGroup = computed(() => trimmedLabel(props.eventAgeGroup, 30))
@@ -75,10 +89,8 @@ const eventViewText = computed(() =>
75
89
  const isMobile = computed(() => $screen.value.isMobile)
76
90
 
77
91
  const checkOverflow = () => {
78
- if (textECategory.value) {
79
- isCategoryOverflowing.value =
80
- textECategory.value.scrollWidth > textECategory.value.clientWidth ||
81
- textECategory.value.scrollHeight > textECategory.value.clientHeight
92
+ if (props.eventCategory.length > VERTICAL_TEXT_LIMIT) {
93
+ isCategoryOverflowing.value = true
82
94
  }
83
95
 
84
96
  if (textEName.value) {
@@ -95,6 +107,16 @@ const registerClick = () => {
95
107
  const viewClick = () => {
96
108
  emit('onView')
97
109
  }
110
+
111
+ onMounted(() => {
112
+ const verticalTextEle = document.getElementsByClassName('event-vertical-text')
113
+ Array.from(verticalTextEle).forEach((el) => {
114
+ const originalText = el.innerText.trim()
115
+ if (originalText.length > VERTICAL_TEXT_LIMIT) {
116
+ el.innerText = originalText.slice(0, VERTICAL_TEXT_LIMIT) + '...'
117
+ }
118
+ })
119
+ })
98
120
  </script>
99
121
 
100
122
  <template>
@@ -109,9 +131,8 @@ const viewClick = () => {
109
131
  >
110
132
  <!-- Column 1: Rotated Text -->
111
133
  <div
112
- class="flex items-center justify-center q-py-sm q-px-xs rotated-text text-dark text-italic text-display-xxxs text-center cornero-font-family ellipsis"
134
+ class="flex items-center justify-center q-py-sm q-px-xs rotated-text event-vertical-text text-dark text-italic text-display-xxxs text-center cornero-font-family ellipsis"
113
135
  data-testid="eventCategory"
114
- ref="textECategory"
115
136
  @mouseenter="checkOverflow"
116
137
  >
117
138
  {{ props.eventCategory }}
@@ -219,6 +240,7 @@ const viewClick = () => {
219
240
  :aria-label="props.eventRegisterText || 'Register Event'"
220
241
  color="primary"
221
242
  data-testid="eventRegisterBtn"
243
+ :disable="isRegisterEventActionDisabled"
222
244
  size="md"
223
245
  @click="registerClick"
224
246
  >
@@ -233,6 +255,7 @@ const viewClick = () => {
233
255
  :aria-label="props.eventViewText || 'View Event'"
234
256
  color="primary"
235
257
  data-testid="eventViewBtn"
258
+ :disable="isViewEventActionDisabled"
236
259
  flat
237
260
  size="md"
238
261
  @click="viewClick"
@@ -259,7 +282,6 @@ const viewClick = () => {
259
282
  <div
260
283
  class="text-dark text-display-xxxs text-italic cornero-font-family text-no-wrap ellipsis"
261
284
  data-testid="eventCategory"
262
- ref="textECategory"
263
285
  @mouseenter="checkOverflow"
264
286
  >
265
287
  {{ props.eventCategory }}
@@ -351,6 +373,7 @@ const viewClick = () => {
351
373
  :aria-label="props.eventViewText || 'View Event'"
352
374
  color="primary"
353
375
  data-testid="eventViewBtn"
376
+ :disable="isViewEventActionDisabled"
354
377
  flat
355
378
  :label="eventViewText.text"
356
379
  size="md"
@@ -361,6 +384,7 @@ const viewClick = () => {
361
384
  :aria-label="props.eventRegisterText || 'Register Event'"
362
385
  color="primary"
363
386
  data-testid="eventRegisterBtn"
387
+ :disable="isRegisterEventActionDisabled"
364
388
  :label="eventRegisterText.text"
365
389
  size="md"
366
390
  @click="registerClick"
@@ -91,9 +91,9 @@ const menuWidth = ref(0)
91
91
  const predictions = ref([])
92
92
  const resultItem = ref(
93
93
  props.selectedAddress?.length
94
- ? { formattedAddress: props.selectedAddress }
94
+ ? { displayName: props.selectedAddress }
95
95
  : modelValue.value?.length
96
- ? { formattedAddress: modelValue.value }
96
+ ? { displayName: modelValue.value }
97
97
  : {}
98
98
  )
99
99
  const resultsMenuRef = ref(null)
@@ -420,7 +420,7 @@ watch(
420
420
 
421
421
  <UInputTextStd
422
422
  v-if="JSON.stringify(resultItem) !== '{}'"
423
- v-model="resultItem.formattedAddress"
423
+ v-model="resultItem.displayName"
424
424
  :dataTestId="dataTestId"
425
425
  :label="label"
426
426
  :size="size"
@@ -139,6 +139,11 @@ const toLowerCase = (str) => str?.toLowerCase()
139
139
  v-for="country in options"
140
140
  v-ripple
141
141
  class="q-my-xxs"
142
+ :class="{
143
+ 'selected-item':
144
+ selectedCountry?.code === country?.code &&
145
+ selectedCountry?.label === country?.label,
146
+ }"
142
147
  clickable
143
148
  :key="country?.code"
144
149
  @click="selectCountry(country)"
@@ -165,8 +170,10 @@ const toLowerCase = (str) => str?.toLowerCase()
165
170
 
166
171
  <style lang="sass">
167
172
  .selected-code
168
- width: 1.5rem
173
+ width: auto
169
174
  color: $dark
175
+ .selected-item
176
+ background-color: $blue-1
170
177
  .u-dropdown-list
171
178
  .q-item__section--main
172
179
  margin-left: 0px
@@ -19,6 +19,10 @@ defineOptions({
19
19
  inheritAttrs: false,
20
20
  })
21
21
  const props = defineProps({
22
+ autocomplete: {
23
+ type: String,
24
+ default: 'on',
25
+ },
22
26
  borderless: {
23
27
  type: Boolean,
24
28
  default: false,
@@ -146,6 +150,7 @@ const handleRightIconClick = () => {
146
150
  v-model="modelValue"
147
151
  :class="`u-input field-${size} ${leftBorderRadius}`"
148
152
  :aria-describedby="hintText"
153
+ :autocomplete="autocomplete"
149
154
  :borderless="borderless"
150
155
  :bottom-slots="!!hintText"
151
156
  :disable="disable"
@@ -280,6 +280,14 @@ watch(
280
280
  }
281
281
  }
282
282
  )
283
+
284
+ watch(
285
+ () => props.options,
286
+ (newOptions) => {
287
+ initialOptions.value = [...newOptions]
288
+ },
289
+ { immediate: true }
290
+ )
283
291
  </script>
284
292
 
285
293
  <template>