@usssa/component-library 1.0.0-alpha.191 → 1.0.0-alpha.193

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.191
1
+ # Component Library v1.0.0-alpha.193
2
2
 
3
3
  **This library provides custom UI components for USSSA applications**
4
4
 
@@ -33,3 +33,4 @@ When done:
33
33
 
34
34
  1. In Nuxt or Quasar project directory run to unlink `yarn unlink @usssa/component-library`
35
35
  2. In component-library directory run `yarn unlink`
36
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@usssa/component-library",
3
- "version": "1.0.0-alpha.191",
3
+ "version": "1.0.0-alpha.193",
4
4
  "description": "A Quasar component library project",
5
5
  "productName": "Quasar component library App",
6
6
  "author": "Engineering Team <engineering@usssa.com>",
@@ -1,8 +1,8 @@
1
1
  <script setup>
2
2
  import { computed, onMounted, onUnmounted, ref, useSlots, watch } from 'vue'
3
3
  import { useQuasar } from 'quasar'
4
- import { useScreenType } from '../../composables/useScreenType'
5
4
  import UBtnStd from './UBtnStd.vue'
5
+ import { useScreenType } from '../../composables/useScreenType'
6
6
 
7
7
  const emit = defineEmits(['onBackIconClick', 'hideDialog'])
8
8
  const model = defineModel()
@@ -133,19 +133,6 @@ const getDialogHeaderheight = () => {
133
133
  if (headingWrapper) {
134
134
  scrollableMarginHeight.value = headingWrapper.clientHeight
135
135
  }
136
-
137
- // dynamically adding height by removing toolbar height of 50px
138
- const dialogWrapper = document.getElementsByClassName('dialog-wrapper')[0]
139
- if (dialogWrapper) {
140
- dialogWrapper?.setAttribute(
141
- 'style',
142
- `max-height: ${
143
- !isTablet.value
144
- ? $q.screen.height - 80 + 'px !important'
145
- : $q.screen.height / 2 - 50 + 'px !important'
146
- }`
147
- )
148
- }
149
136
  },50)
150
137
 
151
138
  setTimeout(() => {
@@ -211,7 +198,7 @@ const onMouseDown = (event) => {
211
198
 
212
199
  const onTouchStart = (event) => {
213
200
  isDragging = true
214
- event.preventDefault()
201
+ if (event.cancelable) event.preventDefault()
215
202
  startY = event.touches[0].clientY
216
203
  startHeight = currentDialogHeight.value
217
204
  window.addEventListener('touchmove', (e) => onDragMove(e))
@@ -269,10 +256,12 @@ watch(
269
256
  :style="dialogStyle"
270
257
  >
271
258
  <q-card
272
- :class="`dialog-wrapper${!isMobile ? ' full-height' : ''}`"
259
+ :class="`dialog-wrapper`"
273
260
  :style="{
274
- height: isMobile ? currentDialogHeight + 'px !important' : 'auto',
275
- overflow: 'auto',
261
+ display: 'flex',
262
+ flexDirection: 'column',
263
+ maxHeight: currentDialogHeight + 'px !important',
264
+ overflow: 'hidden',
276
265
  }"
277
266
  >
278
267
  <div
@@ -359,13 +348,16 @@ watch(
359
348
  isMobile ? scrollableMarginHeight + (isMobile ? 16 : 0) : 0
360
349
  }px`,
361
350
  'margin-bottom': `${getContentBottomSpace()}rem !important`,
362
- height:
363
- isTablet || isDesktop || isMobile
364
- ? 'auto'
365
- : currentDialogHeight -
351
+ flex: isMobile ? 'none' : 1,
352
+ overflowY: 'auto',
353
+ ...(isMobile && {
354
+ height:
355
+ currentDialogHeight -
366
356
  (scrollableMarginHeight +
367
- (hasSlots() && slotsLength >= 3 ? 125 : 88)) +
368
- 'px !important',
357
+ (hasSlots() && slotsLength >= 3 ? 144 : 88)) +
358
+ 'px',
359
+ })
360
+
369
361
  }"
370
362
  tabindex="-1"
371
363
  >
@@ -1,5 +1,5 @@
1
1
  <script setup>
2
- import { computed, ref, nextTick, watch } from 'vue'
2
+ import { computed, nextTick, ref, watch } from 'vue'
3
3
  import UBtnStd from './UBtnStd.vue'
4
4
  import UBtnToggle from './UBtnToggle.vue'
5
5
  import UChip from './UChip.vue'
@@ -92,6 +92,10 @@ const props = defineProps({
92
92
  type: String,
93
93
  default: '',
94
94
  },
95
+ showSheetInput: {
96
+ type: Boolean,
97
+ default: true,
98
+ },
95
99
  size: {
96
100
  type: String,
97
101
  default: 'md',
@@ -454,6 +458,7 @@ watch(selectedTab, () => {
454
458
  <slot v-else name="before-options" />
455
459
  </div>
456
460
  <q-select
461
+ v-if="showSheetInput"
457
462
  :model-value="selectedItems"
458
463
  :class="`u-multi-select field-md q-mt-ba`"
459
464
  behavior="menu"
@@ -617,4 +622,17 @@ watch(selectedTab, () => {
617
622
  .no-result-container
618
623
  display: block
619
624
  padding: 0px
625
+
626
+ .options-dialog
627
+ .sheet-card-wrapper .q-card__section .q-item
628
+ padding:$ba $ba !important
629
+ margin-bottom: $xs !important
630
+ border-radius: $sm !important
631
+ align-items: flex-start !important
632
+ .label
633
+ line-height: $ms !important
634
+ .q-icon
635
+ font-size: $ms !important
636
+ .q-focus-helper
637
+ display: none
620
638
  </style>
@@ -1,6 +1,6 @@
1
1
  <script setup>
2
2
  import { useQuasar } from 'quasar'
3
- import { computed, nextTick, onBeforeUnmount, onMounted , ref, watch } from 'vue'
3
+ import { computed, nextTick, onBeforeUnmount, onMounted, ref, watch } from 'vue'
4
4
  import { useScreenType } from '../../../composables/useScreenType'
5
5
  import UAvatar from '../UAvatar.vue'
6
6
  import UBtnStd from '../UBtnStd.vue'
@@ -69,17 +69,21 @@ const props = defineProps({
69
69
  type: Boolean,
70
70
  default: false,
71
71
  },
72
- infiniteScrollProperty:{
72
+ infiniteScrollProperty: {
73
73
  type: Object,
74
74
  default: () => {
75
75
  return {
76
- loading: false,
77
- image:'',
78
- type:'default',
79
- size:'1rem',
80
- color:'primary'
76
+ color: 'primary',
77
+ height: '55rem',
78
+ image: '',
79
+ loading: false,
80
+ noMoreData: false,
81
+ noMoreDataText: 'No more data',
82
+ padding: true,
83
+ size: '1rem',
84
+ type: 'default',
81
85
  }
82
- }
86
+ },
83
87
  },
84
88
  rowCardHeight: {
85
89
  type: Number,
@@ -123,8 +127,10 @@ const $q = useQuasar()
123
127
  const $screen = useScreenType()
124
128
 
125
129
  const infiniteScrollProp = ref(props.infiniteScrollProperty)
130
+ const isScrollActionActive = ref(false)
126
131
  const mobileActionsDialog = ref({})
127
132
  const moreActionsDialogs = ref({})
133
+ const infiniteNoMoreShow = ref(false)
128
134
  const tableContainer = ref(null)
129
135
  const tableDataChip = ref(true) // this is required to show chip
130
136
  const tailClass = ref(null)
@@ -251,7 +257,12 @@ const handleOpenMobileMoreActions = (id) => {
251
257
  }
252
258
 
253
259
  const handleScroll = async () => {
254
- if (!props.infiniteScroll || infiniteScrollProp.value.loading) return
260
+ if (
261
+ !props.infiniteScroll ||
262
+ infiniteScrollProp.value.loading ||
263
+ infiniteScrollProp.value.noMoreData
264
+ )
265
+ return
255
266
  const el = tableContainer.value
256
267
 
257
268
  if (!el) return
@@ -273,7 +284,7 @@ const handleScroll = async () => {
273
284
  if (distanceFromBottom <= 10) {
274
285
  const lastRow = rows.value[rows.value.length - 1]
275
286
  if (lastRow) {
276
- emit('onLoadMore', lastRow)
287
+ emit('onLoadMore', lastRow)
277
288
  }
278
289
  }
279
290
  }
@@ -284,8 +295,11 @@ const isContentVisible = (field, id, type) => {
284
295
  }
285
296
 
286
297
  onMounted(() => {
298
+ infiniteNoMoreShow.value = false
287
299
  nextTick(() => {
288
- attachScroll()
300
+ if (!infiniteScrollProp.value.noMoreData) {
301
+ attachScroll()
302
+ }
289
303
  })
290
304
  })
291
305
 
@@ -305,6 +319,41 @@ watch(
305
319
  }
306
320
  )
307
321
 
322
+ // detach the scrollbar action(onLoadMore) when noMoreData occur
323
+ watch(
324
+ () => infiniteScrollProp.value,
325
+ (newValue) => {
326
+ // Reset state when conditions change
327
+ if (!newValue) {
328
+ isScrollActionActive.value = false;
329
+ return;
330
+ }
331
+
332
+ // Handle active states
333
+ if (newValue.loading || newValue.noMoreData) {
334
+ isScrollActionActive.value = true;
335
+
336
+ if (newValue.noMoreData) {
337
+ infiniteNoMoreShow.value = true;
338
+ setTimeout(() => {
339
+ infiniteNoMoreShow.value = false;
340
+ detachScroll();
341
+
342
+ // Reset scroll active state after timeout
343
+ if (!infiniteScrollProp.value?.loading) {
344
+ isScrollActionActive.value = false;
345
+ }
346
+ }, 5000);
347
+ }
348
+ }
349
+ // Reset when neither loading nor noMoreData
350
+ else {
351
+ isScrollActionActive.value = false;
352
+ }
353
+ },
354
+ { immediate: true, deep: true }
355
+ );
356
+
308
357
  watch(
309
358
  moreActionDialogData,
310
359
  (newData) => {
@@ -327,16 +376,21 @@ watch(
327
376
  },
328
377
  { immediate: true }
329
378
  )
330
-
331
379
  </script>
332
380
 
333
381
  <template>
334
382
  <component
335
383
  v-bind="
336
384
  infiniteScroll
337
- ? { style: 'overflow-y: auto;height: 55rem;' }
338
- : {}"
339
- :class="[infiniteScroll && 'u-table-infinite-scroll-container ' , (grid && infiniteScroll ) ? 'q-pa-ba': '']"
385
+ ? {
386
+ style: `overflow-y: auto; height: ${infiniteScrollProperty.height};`,
387
+ }
388
+ : {}
389
+ "
390
+ :class="[
391
+ infiniteScroll && 'u-table-infinite-scroll-container ',
392
+ grid && infiniteScroll && infiniteScrollProperty.padding ? 'q-pa-ba' : '',
393
+ ]"
340
394
  :is="infiniteScroll ? 'div' : 'fragment'"
341
395
  ref="tableContainer"
342
396
  >
@@ -1830,26 +1884,36 @@ watch(
1830
1884
  </UExpansionStd>
1831
1885
  </template>
1832
1886
 
1833
- <template v-if="infiniteScroll" #bottom>
1834
- <div v-if="infiniteScrollProp.loading" :class="`relative-position full-width row justify-center ${grid ? `q-mt-ms q-mb-xs`:`q-py-lg`}`">
1835
- <UInnerLoader
1836
- v-if="infiniteScrollProp.type == 'default'"
1837
- image="/images/logo.svg"
1838
- :loading="infiniteScrollProp.loading"
1839
- loading-message="Loading data"
1840
- :spinner-color="infiniteScrollProp.color"
1841
- :spinner-size="infiniteScrollProp.size"
1842
- />
1843
- <q-spinner
1844
- v-if="infiniteScrollProp.type == 'spinner'"
1845
- :color="infiniteScrollProp.color"
1846
- :size="infiniteScrollProp.size"
1847
- />
1848
- </div>
1849
- <div v-if="infiniteScrollProp?.noMoreData" :class="`row full-width justify-center text-accent q-gutter-sm ${grid ? `q-mt-ms q-mb-xs`:`q-py-lg`}`">
1850
- <span>No more data</span>
1851
- </div>
1852
- </template>
1887
+ <template v-if="(infiniteScroll && isScrollActionActive)" #bottom>
1888
+ <div
1889
+ v-if="infiniteScrollProp.loading"
1890
+ :class="`relative-position full-width row justify-center ${
1891
+ grid ? `q-mt-ms q-mb-xs` : `q-py-lg`
1892
+ }`"
1893
+ >
1894
+ <UInnerLoader
1895
+ v-if="infiniteScrollProp.type == 'default'"
1896
+ image="/images/logo.svg"
1897
+ :loading="infiniteScrollProp.loading"
1898
+ :loading-message="infiniteScrollProp.loadingMessage"
1899
+ :spinner-color="infiniteScrollProp.color"
1900
+ :spinner-size="infiniteScrollProp.size"
1901
+ />
1902
+ <q-spinner
1903
+ v-if="infiniteScrollProp.type == 'spinner'"
1904
+ :color="infiniteScrollProp.color"
1905
+ :size="infiniteScrollProp.size"
1906
+ />
1907
+ </div>
1908
+ <div
1909
+ v-if="infiniteScrollProp?.noMoreData && infiniteNoMoreShow"
1910
+ :class="`row full-width justify-center text-accent q-gutter-sm ${
1911
+ grid ? `q-mt-xs q-mb-ba` : `q-py-lg`
1912
+ }`"
1913
+ >
1914
+ <span>{{ infiniteScrollProp.noMoreDataText }}</span>
1915
+ </div>
1916
+ </template>
1853
1917
  </q-table>
1854
1918
  </component>
1855
1919
  </template>
@@ -99,11 +99,16 @@ const props = defineProps({
99
99
  type: Object,
100
100
  default: () => {
101
101
  return {
102
- loading: false,
102
+ color: 'primary',
103
+ height: '55rem',
103
104
  image: '',
104
- type: 'default',
105
+ loading: false,
106
+ loadingMessage: 'Loading data',
107
+ noMoreData: false,
108
+ noMoreDataText: 'No more data',
109
+ padding: true,
105
110
  size: '1rem',
106
- color: 'primary',
111
+ type: 'default'
107
112
  }
108
113
  },
109
114
  },