@usssa/component-library 1.0.0-alpha.217 → 1.0.0-alpha.219

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.217
1
+ # Component Library v1.0.0-alpha.219
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.217",
3
+ "version": "1.0.0-alpha.219",
4
4
  "description": "A Quasar component library project",
5
5
  "productName": "Quasar component library App",
6
6
  "author": "Engineering Team <engineering@usssa.com>",
@@ -91,6 +91,10 @@ const props = defineProps({
91
91
  type: String,
92
92
  default: '',
93
93
  },
94
+ closeIconLabel: {
95
+ default: '',
96
+ type: String,
97
+ },
94
98
  collapsedAriaLabel: {
95
99
  type: String,
96
100
  default: 'Collapsed',
@@ -139,6 +143,10 @@ const props = defineProps({
139
143
  default: null,
140
144
  type: Object,
141
145
  },
146
+ selectMoreOptions: {
147
+ default: '',
148
+ type: String,
149
+ },
142
150
  showAvatar: {
143
151
  type: Boolean,
144
152
  default: false,
@@ -201,6 +209,7 @@ const virtualScroll = ref(false)
201
209
  v-model:rows="rows"
202
210
  :customClass="tableCustomClass"
203
211
  :bordered="bordered"
212
+ :close-icon-label="closeIconLabel"
204
213
  :enable-grid-on="enableGridOn"
205
214
  :expansion="expansion"
206
215
  :flat="flat"
@@ -210,6 +219,7 @@ const virtualScroll = ref(false)
210
219
  :more-action-dialog-data="moreActionDialogData"
211
220
  :multiSelection="multiSelection"
212
221
  :row-card-height="rowCardHeight"
222
+ :select-more-options="selectMoreOptions"
213
223
  :separator="separator"
214
224
  :showPagination="showPagination"
215
225
  :stickyHeader="stickyHeader"
@@ -1,5 +1,5 @@
1
1
  <script setup>
2
- import { computed, onMounted, ref, watch } from 'vue'
2
+ import { computed, onMounted, onUnmounted, ref, watch } from 'vue'
3
3
  import UInputTextStd from './UInputTextStd.vue'
4
4
  import UTooltip from './UTooltip.vue'
5
5
 
@@ -177,13 +177,28 @@ const onClick = (item) => {
177
177
  }
178
178
 
179
179
  const onMenuShow = () => {
180
- const el =
181
- inputRef.value?.$el.querySelector('.q-field__control') ||
182
- inputRef.value?.$el
183
- menuWidth.value = `${el?.offsetWidth || 0}px`
180
+ updateMenuWidth()
184
181
  resultsMenuShowing.value = true
185
182
  }
186
183
 
184
+ onMounted(async () => {
185
+ const { AutocompleteSessionToken, AutocompleteSuggestion } =
186
+ await google.maps.importLibrary('places')
187
+
188
+ sessionToken = new AutocompleteSessionToken()
189
+ autocompleteSuggestion = AutocompleteSuggestion
190
+ window.addEventListener('resize', updateMenuWidth)
191
+ })
192
+
193
+ const onResize = ({ width }) => {
194
+ resultsMenuShowing.value = false
195
+ updateMenuWidth()
196
+ }
197
+
198
+ onUnmounted(() => {
199
+ window.removeEventListener('resize', updateMenuWidth)
200
+ })
201
+
187
202
  const parseAddressComponents = (addressComponents) => {
188
203
  const address = {}
189
204
  for (const component of addressComponents) {
@@ -205,13 +220,12 @@ const parseAddressComponents = (addressComponents) => {
205
220
  return address
206
221
  }
207
222
 
208
- onMounted(async () => {
209
- const { AutocompleteSessionToken, AutocompleteSuggestion } =
210
- await google.maps.importLibrary('places')
211
-
212
- sessionToken = new AutocompleteSessionToken()
213
- autocompleteSuggestion = AutocompleteSuggestion
214
- })
223
+ const updateMenuWidth = () => {
224
+ const el =
225
+ inputRef.value?.$el.querySelector('.q-field__control') ||
226
+ inputRef.value?.$el
227
+ menuWidth.value = `${el?.offsetWidth || 0}px`
228
+ }
215
229
 
216
230
  watch(modelValue, async (value) => {
217
231
  if (value) {
@@ -261,108 +275,115 @@ watch(modelValue, async (value) => {
261
275
  />
262
276
  </q-icon>
263
277
  </label>
264
- <q-input
265
- v-bind="$attrs"
266
- v-model="modelValue"
267
- :class="`u-input field-${size} ${leftBorderRadius}`"
268
- :borderless="borderless"
269
- :bottom-slots="!!hintText"
270
- :debounce="500"
271
- :disable="disable"
272
- :error="error"
273
- hide-bottom-space
274
- id="input"
275
- name="input"
276
- :outlined="outlined"
277
- :placeholder="placeholder"
278
- :readonly="readonly"
279
- ref="inputRef"
280
- :rules="validationRules"
281
- :standout="!outlined"
282
- type="text"
283
- >
284
- <!-- The 'fit' prop is used to ensure the menu matches the anchor's width for correct positioning,
285
- while the manual width styling enforces a specific width for visual consistency. -->
286
- <q-menu
287
- v-model="resultsMenuShowing"
288
- fit
289
- no-focus
290
- ref="resultsMenuRef"
291
- :style="{ width: menuWidth }"
292
- @hide="resultsMenuShowing = false"
293
- @show="onMenuShow"
278
+ <div ref="inputWrapper">
279
+ <q-input
280
+ v-bind="$attrs"
281
+ v-model="modelValue"
282
+ :class="`u-input field-${size} ${leftBorderRadius}`"
283
+ :borderless="borderless"
284
+ :bottom-slots="!!hintText"
285
+ :debounce="500"
286
+ :disable="disable"
287
+ :error="error"
288
+ hide-bottom-space
289
+ id="input"
290
+ name="input"
291
+ :outlined="outlined"
292
+ :placeholder="placeholder"
293
+ :readonly="readonly"
294
+ ref="inputRef"
295
+ :rules="validationRules"
296
+ :standout="!outlined"
297
+ type="text"
298
+ @focus="onMenuShow"
294
299
  >
295
- <q-list bordered>
296
- <q-item
297
- v-for="(p, i) of predictions"
298
- clickable
299
- :key="i"
300
- @click="onClick(p)"
301
- >
302
- <q-item-section avatar>
303
- <q-icon class="fa-kit-duotone fa-location-dot" color="primary" />
304
- </q-item-section>
305
- <q-item-section>
306
- <q-item-label>{{ p.displayName }}</q-item-label>
307
- <q-item-label caption>
308
- <span class="text-caption">
309
- {{ p.formattedAddress }}
310
- </span>
311
- </q-item-label>
312
- </q-item-section>
313
- </q-item>
314
- </q-list>
315
- </q-menu>
316
-
317
- <template v-if="leftIcon" #prepend>
318
- <slot name="prepend"></slot>
319
- <q-icon
320
- v-if="!$slots.prepend"
321
- :class="`slot-icon-size-${size} ${leftIcon}`"
322
- />
323
- </template>
324
-
325
- <template v-if="hintText" #hint>
326
- <div class="row items-center text-neutral-9 no-wrap">
327
- <q-icon
328
- v-if="hintIcon"
329
- :class="hintIcon"
330
- :aria-label="hintText"
331
- size="1rem"
332
- />
333
- <div class="q-ml-xxs text-body-xs">{{ hintText }}</div>
334
- </div>
335
- </template>
336
-
337
- <template #append>
338
- <slot name="append">
339
- <q-icon
340
- v-if="rightIcon"
341
- :class="`slot-icon-size-${size} ${rightIcon}`"
342
- :aria-label="
343
- rightIcon && rightIconAriaLabel
344
- ? rightIconAriaLabel
345
- : 'right input icon '
346
- "
347
- :tabindex="0"
348
- @click="handleRightIconClick"
349
- />
350
- </slot>
351
- </template>
352
-
353
- <template v-slot:error>
354
- <div v-if="errorMessage" class="row items-center no-wrap">
300
+ <!-- The 'fit' prop is used to ensure the menu matches the anchor's width for correct positioning,
301
+ while the manual width styling enforces a specific width for visual consistency. -->
302
+ <q-menu
303
+ v-model="resultsMenuShowing"
304
+ fit
305
+ no-focus
306
+ ref="resultsMenuRef"
307
+ :style="{ width: menuWidth }"
308
+ @hide="resultsMenuShowing = false"
309
+ @show="onMenuShow"
310
+ >
311
+ <q-list bordered>
312
+ <q-item
313
+ v-for="(p, i) of predictions"
314
+ clickable
315
+ :key="i"
316
+ @click="onClick(p)"
317
+ >
318
+ <q-item-section avatar>
319
+ <q-icon
320
+ class="fa-kit-duotone fa-location-dot"
321
+ color="primary"
322
+ />
323
+ </q-item-section>
324
+ <q-item-section>
325
+ <q-item-label>{{ p.displayName }}</q-item-label>
326
+ <q-item-label caption>
327
+ <span class="text-caption">
328
+ {{ p.formattedAddress }}
329
+ </span>
330
+ </q-item-label>
331
+ </q-item-section>
332
+ </q-item>
333
+ </q-list>
334
+ </q-menu>
335
+
336
+ <template v-if="leftIcon" #prepend>
337
+ <slot name="prepend"></slot>
355
338
  <q-icon
356
- class="fa-kit-duotone fa-warning-octagon"
357
- :aria-label="errorMessage"
358
- size="1rem"
339
+ v-if="!$slots.prepend"
340
+ :class="`slot-icon-size-${size} ${leftIcon}`"
359
341
  />
360
- <div class="q-ml-xxs text-body-xs" role="validation error">
361
- {{ errorMessage }}
342
+ </template>
343
+
344
+ <template v-if="hintText" #hint>
345
+ <div class="row items-center text-neutral-9 no-wrap">
346
+ <q-icon
347
+ v-if="hintIcon"
348
+ :class="hintIcon"
349
+ :aria-label="hintText"
350
+ size="1rem"
351
+ />
352
+ <div class="q-ml-xxs text-body-xs">{{ hintText }}</div>
353
+ </div>
354
+ </template>
355
+
356
+ <template #append>
357
+ <slot name="append">
358
+ <q-icon
359
+ v-if="rightIcon"
360
+ :class="`slot-icon-size-${size} ${rightIcon}`"
361
+ :aria-label="
362
+ rightIcon && rightIconAriaLabel
363
+ ? rightIconAriaLabel
364
+ : 'right input icon '
365
+ "
366
+ :tabindex="0"
367
+ @click="handleRightIconClick"
368
+ />
369
+ </slot>
370
+ </template>
371
+
372
+ <template v-slot:error>
373
+ <div v-if="errorMessage" class="row items-center no-wrap">
374
+ <q-icon
375
+ class="fa-kit-duotone fa-warning-octagon"
376
+ :aria-label="errorMessage"
377
+ size="1rem"
378
+ />
379
+ <div class="q-ml-xxs text-body-xs" role="validation error">
380
+ {{ errorMessage }}
381
+ </div>
362
382
  </div>
363
- </div>
364
- </template>
365
- </q-input>
383
+ </template>
384
+ </q-input>
385
+ <q-resize-observer @resize="onResize" />
386
+ </div>
366
387
  </div>
367
388
 
368
389
  <UInputTextStd