@usssa/component-library 1.0.0-beta.12 → 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.262
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.12",
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
@@ -340,6 +340,12 @@ watch(
340
340
  .q-focus-helper
341
341
  display: none
342
342
 
343
+ .u-menu-link
344
+ .q-badge
345
+ position: absolute
346
+ right: 0
347
+ margin-right: $xs
348
+
343
349
  .q-list--padding
344
350
  padding: 0 !important
345
351
  .drawer-menu-list
@@ -71,22 +71,13 @@ const handleMenuClick = (menu) => {
71
71
  @on-click="handleMenuClick(menuItem)"
72
72
  >
73
73
  <template v-if="!miniState" #trailing_slot>
74
- <UBadgeStd
75
- v-if="menuItem.badgeInfo"
76
- :class="{
77
- 'nested-badge-margin': multiLevel,
78
- }"
79
- :label="menuItem.badgeInfo"
80
- size="lg"
81
- tabindex="-1"
82
- />
83
74
  <q-icon
84
75
  v-if="menuItem.rightIcon && !multiLevel"
85
76
  :class="`${menuItem.rightIcon} ${
86
77
  currentPath === menuItem.to.replaceAll('/', '')
87
78
  ? ''
88
79
  : 'non-active-right-icon'
89
- }`"
80
+ } q-ml-xs`"
90
81
  :aria-label="menuItem.badgeInfo"
91
82
  size="1rem"
92
83
  tabindex="-1"
@@ -101,6 +92,19 @@ const handleMenuClick = (menu) => {
101
92
  size="1.5rem"
102
93
  tabindex="-1"
103
94
  />
95
+ <UBadgeStd
96
+ v-if="menuItem.badgeInfo"
97
+ :class="{
98
+ 'badge-with-navigation-icon':
99
+ (menuItem.children && menuItem.children.length && multiLevel) ||
100
+ (menuItem.slot && menuItem.slot.hasSlot && multiLevel),
101
+ }"
102
+ class="default-badge-position"
103
+ :color="menuItem.badgeStyle?.color ?? 'primary'"
104
+ :label="menuItem.badgeInfo"
105
+ :size="menuItem.badgeStyle?.size ?? 'lg'"
106
+ tabindex="-1"
107
+ />
104
108
  </template>
105
109
  </UMenuItem>
106
110
  </transition>
@@ -118,7 +122,9 @@ const handleMenuClick = (menu) => {
118
122
  .drawer-menu-list .q-icon.navigation-right-icon
119
123
  margin-left: $xs
120
124
  color: $dark !important
125
+ position: absolute
126
+ right: 0
121
127
 
122
- .nested-badge-margin
123
- margin-right: 0px !important
128
+ .badge-with-navigation-icon
129
+ margin-right: $ms !important
124
130
  </style>
@@ -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 }}
@@ -185,7 +206,7 @@ const viewClick = () => {
185
206
  :description="props.eventAgeGroup"
186
207
  />
187
208
  </span>
188
- |
209
+ <span v-if="props.eventAgeGroup && props.eventLocation">|</span>
189
210
  <span v-if="props.eventLocation" class="q-px-xxs">
190
211
  {{ eventLocation.text }}
191
212
  <UTooltip
@@ -193,7 +214,13 @@ const viewClick = () => {
193
214
  :description="props.eventLocation"
194
215
  />
195
216
  </span>
196
- |
217
+ <span
218
+ v-if="
219
+ (props.eventAgeGroup || props.eventLocation) && props.eventHost
220
+ "
221
+ >
222
+ |
223
+ </span>
197
224
  <span v-if="props.eventHost" class="q-ml-xxs">
198
225
  {{ eventHost.text }}
199
226
  <UTooltip
@@ -213,6 +240,7 @@ const viewClick = () => {
213
240
  :aria-label="props.eventRegisterText || 'Register Event'"
214
241
  color="primary"
215
242
  data-testid="eventRegisterBtn"
243
+ :disable="isRegisterEventActionDisabled"
216
244
  size="md"
217
245
  @click="registerClick"
218
246
  >
@@ -227,6 +255,7 @@ const viewClick = () => {
227
255
  :aria-label="props.eventViewText || 'View Event'"
228
256
  color="primary"
229
257
  data-testid="eventViewBtn"
258
+ :disable="isViewEventActionDisabled"
230
259
  flat
231
260
  size="md"
232
261
  @click="viewClick"
@@ -253,7 +282,6 @@ const viewClick = () => {
253
282
  <div
254
283
  class="text-dark text-display-xxxs text-italic cornero-font-family text-no-wrap ellipsis"
255
284
  data-testid="eventCategory"
256
- ref="textECategory"
257
285
  @mouseenter="checkOverflow"
258
286
  >
259
287
  {{ props.eventCategory }}
@@ -310,14 +338,14 @@ const viewClick = () => {
310
338
  </div>
311
339
 
312
340
  <div class="event-item-mobile text-body-md text-description q-mt-ba">
313
- <span v-if="props.eventAgeGroup" class="q-ml-xxs">
341
+ <span v-if="props.eventAgeGroup" class="q-mx-xxs">
314
342
  {{ eventAgeGroup.text }}
315
343
  <UTooltip
316
344
  v-if="eventAgeGroup.isTrimmed"
317
345
  :description="props.eventAgeGroup"
318
346
  />
319
347
  </span>
320
- |
348
+ <span v-if="props.eventAgeGroup && props.eventLocation">|</span>
321
349
  <span v-if="props.eventLocation" class="q-px-xxs">
322
350
  {{ eventLocation.text }}
323
351
  <UTooltip
@@ -325,7 +353,10 @@ const viewClick = () => {
325
353
  :description="props.eventLocation"
326
354
  />
327
355
  </span>
328
- |
356
+ <span
357
+ v-if="(props.eventAgeGroup || props.eventLocation) && props.eventHost"
358
+ >|</span
359
+ >
329
360
  <span v-if="props.eventHost" class="q-ml-xxs">
330
361
  {{ eventHost.text }}
331
362
  <UTooltip v-if="eventHost.isTrimmed" :description="props.eventHost" />
@@ -342,6 +373,7 @@ const viewClick = () => {
342
373
  :aria-label="props.eventViewText || 'View Event'"
343
374
  color="primary"
344
375
  data-testid="eventViewBtn"
376
+ :disable="isViewEventActionDisabled"
345
377
  flat
346
378
  :label="eventViewText.text"
347
379
  size="md"
@@ -352,6 +384,7 @@ const viewClick = () => {
352
384
  :aria-label="props.eventRegisterText || 'Register Event'"
353
385
  color="primary"
354
386
  data-testid="eventRegisterBtn"
387
+ :disable="isRegisterEventActionDisabled"
355
388
  :label="eventRegisterText.text"
356
389
  size="md"
357
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"
@@ -479,10 +479,7 @@ watch(selectedTab, () => {
479
479
  <q-item-label class="text-body-sm">
480
480
  {{ scope.opt.label }}
481
481
  </q-item-label>
482
- <q-item-label
483
- v-if="scope.opt.description"
484
- caption
485
- >
482
+ <q-item-label v-if="scope.opt.description" caption>
486
483
  {{ scope.opt.description }}
487
484
  </q-item-label>
488
485
  </div>
@@ -624,6 +621,7 @@ watch(selectedTab, () => {
624
621
  min-height: $md
625
622
  align-items: center
626
623
  padding: 0px
624
+ gap: $xxs
627
625
 
628
626
  &.q-field--outlined .q-field__control
629
627
  border-radius: $xs
@@ -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>