@usssa/component-library 1.0.0-alpha.120 → 1.0.0-alpha.121

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.120
1
+ # Component Library v1.0.0-alpha.121
2
2
 
3
3
  **This library provides custom UI components for USSSA applications.**
4
4
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@usssa/component-library",
3
- "version": "1.0.0-alpha.120",
3
+ "version": "1.0.0-alpha.121",
4
4
  "description": "A Quasar component library project",
5
5
  "productName": "Quasar component library App",
6
6
  "author": "Troy Moreland <troy.moreland@usssa.com>",
@@ -12,6 +12,10 @@ const props = defineProps({
12
12
  type: Boolean,
13
13
  default: false,
14
14
  },
15
+ dataTestId: {
16
+ type: String,
17
+ default: 'input-phone-std',
18
+ },
15
19
  disable: {
16
20
  type: Boolean,
17
21
  default: false,
@@ -78,7 +82,7 @@ const props = defineProps({
78
82
  const selectCountry = (country) => {
79
83
  emit('update-country', country)
80
84
  }
81
- const toLowerCase = (str) => str.toLowerCase()
85
+ const toLowerCase = (str) => str?.toLowerCase()
82
86
  </script>
83
87
 
84
88
  <template>
@@ -86,6 +90,7 @@ const toLowerCase = (str) => str.toLowerCase()
86
90
  v-model="modelValue"
87
91
  class="phone-input"
88
92
  :borderless="borderless"
93
+ :dataTestId="'input-text-std'"
89
94
  :disable="disable"
90
95
  :error="error"
91
96
  :error-message="errorMessage"
@@ -108,6 +113,7 @@ const toLowerCase = (str) => str.toLowerCase()
108
113
  :class="['u-phone-dropdown', 'text-body-sm', 'btn-field-' + size]"
109
114
  content-class="u-dropdown-list"
110
115
  :aria-label="ariaLabel"
116
+ :dataTestId="dataTestId"
111
117
  :disable="disable"
112
118
  flat
113
119
  menu-anchor="top right"
@@ -118,12 +124,12 @@ const toLowerCase = (str) => str.toLowerCase()
118
124
  <template #label>
119
125
  <q-icon
120
126
  :class="`fi fi-${toLowerCase(
121
- selectedCountry.flag
127
+ selectedCountry?.flag
122
128
  )} flag-icon q-mr-xs`"
123
- :aria-label="selectedCountry.name"
129
+ :aria-label="selectedCountry?.name"
124
130
  left
125
131
  />
126
- <label class="selected-code">{{ selectedCountry.code }}</label>
132
+ <label class="selected-code">{{ selectedCountry?.code }}</label>
127
133
  </template>
128
134
 
129
135
  <q-list class="u-list">
@@ -133,20 +139,20 @@ const toLowerCase = (str) => str.toLowerCase()
133
139
  v-ripple
134
140
  class="q-my-xxs"
135
141
  clickable
136
- :key="country.code"
142
+ :key="country?.code"
137
143
  @click="selectCountry(country)"
138
144
  >
139
145
  <q-item-section class="flag-section">
140
146
  <q-icon
141
- :class="`fi fi-${toLowerCase(country.flag)} flag-icon q-mr-xs`"
142
- :aria-label="country.name"
147
+ :class="`fi fi-${toLowerCase(country?.flag)} flag-icon q-mr-xs`"
148
+ :aria-label="country?.name"
143
149
  left
144
150
  size="1.25rem"
145
151
  />
146
152
  </q-item-section>
147
153
  <q-item-section>
148
154
  <q-item-label class="text-body-sm">
149
- {{ country.name }}
155
+ {{ country?.name }}
150
156
  </q-item-label>
151
157
  </q-item-section>
152
158
  </q-item>
@@ -13,6 +13,10 @@ const props = defineProps({
13
13
  type: Boolean,
14
14
  default: false,
15
15
  },
16
+ dataTestId: {
17
+ type: String,
18
+ default: 'input-text-std',
19
+ },
16
20
  disable: {
17
21
  type: Boolean,
18
22
  default: false,
@@ -93,7 +97,7 @@ const handleRightIconClick = () => {
93
97
  </script>
94
98
 
95
99
  <template>
96
- <div :class="`q-gutter-xs ${parentClass}`">
100
+ <div :class="`q-gutter-xs ${parentClass}`" :dataTestId="dataTestId">
97
101
  <label
98
102
  v-if="label"
99
103
  class="row items-center q-mb-xxs"
@@ -125,6 +129,7 @@ const handleRightIconClick = () => {
125
129
  v-bind="$attrs"
126
130
  v-model="modelValue"
127
131
  :class="`u-input field-${size} ${leftBorderRadius}`"
132
+ :aria-describedby="hintText"
128
133
  :borderless="borderless"
129
134
  :bottom-slots="!!hintText"
130
135
  :disable="disable"
@@ -49,6 +49,10 @@ const props = defineProps({
49
49
  type: String,
50
50
  default: '',
51
51
  },
52
+ dataTestId: {
53
+ type: String,
54
+ default: 'table-std',
55
+ },
52
56
  filter: {
53
57
  type: String,
54
58
  default: '',
@@ -314,11 +318,9 @@ const onRowPerPageChange = (value) => {
314
318
  const updatedRows = computed(() => {
315
319
  if (props.filter.length && filteredRows.value?.length)
316
320
  return filteredRows.value
317
- else if(props.filter.length)
318
- return []
321
+ else if (props.filter.length) return []
319
322
  return rows.value
320
323
  })
321
-
322
324
  </script>
323
325
 
324
326
  <template>
@@ -329,6 +331,7 @@ const updatedRows = computed(() => {
329
331
  v-model:rows="rows"
330
332
  :class="customClass"
331
333
  :bordered="bordered"
334
+ :dataTestId="dataTestId"
332
335
  :filter="filter"
333
336
  :flat="flat"
334
337
  :grid="grid"
@@ -793,12 +796,15 @@ const updatedRows = computed(() => {
793
796
  <div
794
797
  v-if="showPagination"
795
798
  class="row justify-end items-center pagination-wrapper"
799
+ dataTestId="table-pagination"
796
800
  >
797
801
  <UPagination
798
802
  v-if="updatedRows.length >= 6"
799
803
  v-model="pagination.page"
800
804
  :maxPageLink="
801
- Number(Math.ceil(updatedRows.length / pagination.rowsPerPage > 10 ? 6 : 3))
805
+ Number(
806
+ Math.ceil(updatedRows.length / pagination.rowsPerPage > 10 ? 6 : 3)
807
+ )
802
808
  "
803
809
  :maxPages="Number(Math.ceil(updatedRows.length / pagination.rowsPerPage))"
804
810
  :perPageOptions="getRowsPerPageOptions"