@usssa/component-library 1.0.0-alpha.267 → 1.0.0-alpha.269

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.269
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-alpha.267",
3
+ "version": "1.0.0-alpha.269",
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"
@@ -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"
@@ -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>