@usssa/component-library 1.0.0-alpha.147 → 1.0.0-alpha.149

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.147
1
+ # Component Library v1.0.0-alpha.149
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.147",
3
+ "version": "1.0.0-alpha.149",
4
4
  "description": "A Quasar component library project",
5
5
  "productName": "Quasar component library App",
6
6
  "author": "Troy Moreland <troy.moreland@usssa.com>",
@@ -0,0 +1,25 @@
1
+ <svg width="125" height="124" viewBox="0 0 125 124" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <g clip-path="url(#clip0_11793_42180)">
3
+ <path d="M62.5 124C96.7417 124 124.5 96.2417 124.5 62C124.5 27.7583 96.7417 0 62.5 0C28.2583 0 0.5 27.7583 0.5 62C0.5 96.2417 28.2583 124 62.5 124Z" fill="#12316C"/>
4
+ <mask id="mask0_11793_42180" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="125" height="124">
5
+ <path d="M62.5 124C96.7417 124 124.5 96.2417 124.5 62C124.5 27.7583 96.7417 0 62.5 0C28.2583 0 0.5 27.7583 0.5 62C0.5 96.2417 28.2583 124 62.5 124Z" fill="#1048BD"/>
6
+ </mask>
7
+ <g mask="url(#mask0_11793_42180)">
8
+ <path d="M-41.5147 19.8398C-78.3898 19.8398 -119.384 46.858 -133.078 80.1865C-146.773 113.515 -127.981 140.533 -91.1059 140.533H68.2098C78.0276 116.747 60.037 90.8359 33.7036 90.8359H-20.6698V126.334L-45.3014 105.035L-86.2352 126.334L-61.0733 90.8359L-86.3264 69.5371H-45.9396L-20.6745 34.0391V69.5371H42.4827C75.6912 69.5371 105.554 49.8552 117.887 19.8398H-41.5147Z" fill="#1048BD"/>
9
+ <rect x="21.9932" y="30.5864" width="80.1867" height="107.467" rx="8" fill="white"/>
10
+ <rect x="30.2598" y="89.2798" width="63.6533" height="23" rx="3" fill="#B9E0FF"/>
11
+ <ellipse cx="39.7664" cy="100.78" rx="4.54667" ry="5.5" fill="white"/>
12
+ <rect x="47.6196" y="98.2798" width="26.4533" height="3" rx="1.5" fill="white"/>
13
+ <rect x="47.6196" y="102.28" width="9.92" height="2" rx="1" fill="white"/>
14
+ <rect x="30.2598" y="115.28" width="63.6533" height="23" rx="3" fill="#B9E0FF"/>
15
+ <ellipse cx="39.7664" cy="126.78" rx="4.54667" ry="5.5" fill="white"/>
16
+ </g>
17
+ <circle opacity="0.2" cx="62.5003" cy="62.0003" r="19.2889" fill="#CB2A3D"/>
18
+ <path d="M69.8603 56.3566C70.3343 55.8826 70.3343 55.1141 69.8603 54.6401C69.3863 54.1662 68.6179 54.1662 68.1439 54.6401L62.5002 60.2838L56.8566 54.6401C56.3826 54.1662 55.6141 54.1662 55.1401 54.6401C54.6662 55.1141 54.6662 55.8826 55.1401 56.3566L60.7838 62.0002L55.1401 67.6439C54.6662 68.1179 54.6662 68.8863 55.1401 69.3603C55.6141 69.8343 56.3826 69.8343 56.8566 69.3603L62.5002 63.7166L68.1439 69.3603C68.6179 69.8343 69.3863 69.8343 69.8603 69.3603C70.3343 68.8863 70.3343 68.1179 69.8603 67.6439L64.2166 62.0002L69.8603 56.3566Z" fill="#CB2A3D"/>
19
+ </g>
20
+ <defs>
21
+ <clipPath id="clip0_11793_42180">
22
+ <rect width="124" height="124" fill="white" transform="translate(0.5)"/>
23
+ </clipPath>
24
+ </defs>
25
+ </svg>
@@ -1,5 +1,8 @@
1
1
  <script setup>
2
- import { computed } from 'vue'
2
+ import { ref, computed } from 'vue'
3
+ import { useRouter } from 'vue-router'
4
+ import { useScreenType } from '../../composables/useScreenType'
5
+ import UTooltip from './UTooltip.vue'
3
6
 
4
7
  const props = defineProps({
5
8
  activeColor: {
@@ -10,17 +13,13 @@ const props = defineProps({
10
13
  type: String,
11
14
  default: 'left',
12
15
  },
13
- clickable: {
14
- type: Boolean,
15
- default: true,
16
- },
17
16
  dataTestId: {
18
17
  type: String,
19
18
  default: 'breadcrumbs-std',
20
19
  },
21
20
  fontTypo: {
22
21
  type: String,
23
- default: 'text-body-lg',
22
+ default: 'text-caption-sm',
24
23
  },
25
24
  links: {
26
25
  type: Array,
@@ -32,62 +31,141 @@ const props = defineProps({
32
31
  },
33
32
  })
34
33
 
35
- const ariaLabelDisabled = computed(() => {
36
- if (!props.clickable) {
37
- return `disabled`
34
+ const router = useRouter()
35
+ const $screen = useScreenType()
36
+
37
+ const isOverflowing = ref(false)
38
+ const textEl = ref(null)
39
+
40
+ const currentLink = computed(() => {
41
+ return props.links[props.links.length - 1]
42
+ })
43
+
44
+ const lastTwoLinks = computed(() => {
45
+ return props.links.slice(-2)
46
+ })
47
+
48
+ const previousLinks = computed(() => {
49
+ if (props.links.length < 2) return []
50
+ return props.links.slice(0, -1).reverse()
51
+ })
52
+
53
+ const previousLinksForDesktop = computed(() => {
54
+ if (props.links.length <= 2) return []
55
+ return props.links.slice(0, -2).reverse()
56
+ })
57
+
58
+ const showMenuDropdown = computed(() => {
59
+ if ($screen.value.isMobile) {
60
+ if (previousLinks.value.length) {
61
+ return true
62
+ }
63
+ } else {
64
+ if (previousLinksForDesktop.value.length) {
65
+ return true
66
+ }
38
67
  }
39
- return ''
68
+ return false
40
69
  })
41
70
 
42
- const onClick = (event) => {
43
- if (!props.clickable) {
44
- event.preventDefault()
71
+ const checkOverflow = () => {
72
+ if (textEl.value) {
73
+ isOverflowing.value = textEl.value.scrollWidth > textEl.value.clientWidth
45
74
  }
46
75
  }
76
+
77
+ const onClick = (link) => {
78
+ if (link.to) router.push(link.to)
79
+ }
47
80
  </script>
81
+
48
82
  <template>
49
83
  <q-breadcrumbs
50
84
  v-bind="$attrs"
51
85
  class="u-breadcrumb"
52
- :active-color="activeColor"
86
+ :active-color="showActiveRoute ? activeColor : 'text-dark'"
53
87
  :align="align"
54
88
  :dataTestId="dataTestId"
55
89
  gutter="none"
90
+ separator-color="text-dark"
56
91
  >
92
+ <template v-slot:separator>
93
+ <span :class="fontTypo">/</span>
94
+ </template>
95
+
96
+ <!-- Dropdown for previous links -->
97
+ <q-breadcrumbs-el v-if="showMenuDropdown">
98
+ <span :class="`${fontTypo} cursor-pointer`">...</span>
99
+ <q-menu class="breadcrumb-menu">
100
+ <q-list class="u-menu-dropdown">
101
+ <q-item
102
+ v-for="(link, i) in $screen.isMobile
103
+ ? previousLinks
104
+ : previousLinksForDesktop"
105
+ class="u-menu-link"
106
+ clickable
107
+ :key="i"
108
+ @click="onClick(link)"
109
+ >
110
+ <q-item-section
111
+ :class="`text-body-sm text-${
112
+ showActiveRoute ? activeColor : 'dark'
113
+ }`"
114
+ >
115
+ {{ link.label }}
116
+ </q-item-section>
117
+ </q-item>
118
+ </q-list>
119
+ </q-menu>
120
+ </q-breadcrumbs-el>
121
+
122
+ <!-- For mobile -->
123
+
57
124
  <q-breadcrumbs-el
58
- v-for="(link, index) of links"
59
- :class="`breadcrumb-label ${fontTypo} ${
60
- index === 0
61
- ? 'q-mr-xs'
62
- : index === links.length - 1
63
- ? 'q-ml-xs'
64
- : 'q-mx-xs'
65
- } ${!showActiveRoute ? 'hide-active-route' : null} ${
66
- !clickable ? 'non-clickable-route' : null
67
- }`"
68
- :aria-label="`${ariaLabelDisabled} ${link.label}`"
69
- :key="index"
70
- :label="link.label"
71
- :to="link.to"
125
+ v-if="currentLink && $screen.isMobile"
126
+ :class="fontTypo"
127
+ :aria-label="currentLink.label"
72
128
  @click="onClick"
73
- />
129
+ >
130
+ <div class="ellipsis-label" ref="textEl" @mouseenter="checkOverflow">
131
+ {{ currentLink?.label }}
132
+ </div>
133
+ <UTooltip v-if="isOverflowing" :description="currentLink?.label" />
134
+ </q-breadcrumbs-el>
135
+
136
+ <!-- For Desktop and Tablet -->
137
+
138
+ <template v-if="lastTwoLinks && !$screen.isMobile">
139
+ <q-breadcrumbs-el
140
+ v-for="(link, index) in lastTwoLinks"
141
+ :class="`${fontTypo}`"
142
+ :aria-label="link.label"
143
+ :key="index"
144
+ :to="link.to"
145
+ @click="onClick"
146
+ >
147
+ <div class="ellipsis-label" ref="textEl" @mouseenter="checkOverflow">
148
+ {{ link.label }}
149
+ </div>
150
+ <UTooltip v-if="isOverflowing" :description="link.label" />
151
+ </q-breadcrumbs-el>
152
+ </template>
74
153
  </q-breadcrumbs>
75
154
  </template>
155
+
76
156
  <style lang="sass">
77
157
  .u-breadcrumb
78
158
  .q-breadcrumbs__separator
79
- font-size: 1rem
80
- font-weight: 500
81
- line-height: 1.25rem
82
- letter-spacing: 0.03333rem
83
-
84
- .q-router-link--active
85
- cursor: default
86
-
87
- .hide-active-route
88
- color: $dark !important
89
-
90
- .non-clickable-route
91
- cursor: default !important
92
- pointer-events: none
159
+ margin-left: $xs
160
+ margin-right: $xs
161
+ .ellipsis-label
162
+ max-width: 80vw
163
+ white-space: nowrap
164
+ overflow: hidden
165
+ text-overflow: ellipsis
166
+ .breadcrumb-menu
167
+ .u-menu-dropdown
168
+ .u-menu-link.q-item
169
+ padding: $xxs $xs
170
+ gap: 0px
93
171
  </style>
@@ -193,6 +193,7 @@ const handleRightIconClick = () => {
193
193
  </div>
194
194
  </div>
195
195
  </template>
196
+ <slot name="menu"/>
196
197
  </q-input>
197
198
  </div>
198
199
  </template>
@@ -0,0 +1,44 @@
1
+ <script setup>
2
+ import UInputTextStd from './UInputTextStd.vue'
3
+ import { useScreenType } from '../../composables/useScreenType'
4
+
5
+ const emit = defineEmits(['updateInputVal'])
6
+
7
+ const props = defineProps({
8
+ label: {
9
+ type: String,
10
+ },
11
+ loading: {
12
+ type: Boolean,
13
+ },
14
+ searchText: {
15
+ type: String,
16
+ },
17
+ })
18
+
19
+ const $screen = useScreenType()
20
+
21
+ const updateInputVal = (event) => {
22
+ emit('updateInputVal', event)
23
+ }
24
+ </script>
25
+
26
+ <template>
27
+ <UInputTextStd
28
+ v-bind="$attrs"
29
+ :aria-label="label"
30
+ autocapitalize="off"
31
+ autocomplete="off"
32
+ autocorrect="off"
33
+ :debounce="500"
34
+ :label="label"
35
+ :loading="loading"
36
+ :modelValue="searchText"
37
+ spellcheck="false"
38
+ @update:modelValue="updateInputVal($event)"
39
+ >
40
+ <template v-if="!$screen.isMobile" v-slot:menu>
41
+ <slot name="menu" />
42
+ </template>
43
+ </UInputTextStd>
44
+ </template>
@@ -1,11 +1,26 @@
1
1
  <script setup>
2
2
  import { ref } from 'vue'
3
3
  import UInputTextStd from './UInputTextStd.vue'
4
+ import UInputTypeahead from './UInputTypeahead.vue'
5
+ import USheet from './USheet.vue'
6
+ import { useScreenType } from '../../composables/useScreenType'
7
+
8
+ const emit = defineEmits([
9
+ 'addDialog',
10
+ 'onCloseDialog',
11
+ 'onInputFocus',
12
+ 'updateInputVal',
13
+ ])
14
+
15
+ const dialogs = defineModel('dialogs', { default: () => [], type: Array })
4
16
 
5
17
  const props = defineProps({
6
18
  label: {
7
19
  type: String,
8
20
  },
21
+ loading: {
22
+ type: Boolean,
23
+ },
9
24
  searchText: {
10
25
  type: String,
11
26
  },
@@ -13,17 +28,23 @@ const props = defineProps({
13
28
  type: String,
14
29
  default: 'md',
15
30
  },
16
- loading: {
17
- type: Boolean,
18
- },
19
31
  })
20
32
 
21
- const emit = defineEmits(['updateInputVal', 'onInputBlur'])
33
+ const $screen = useScreenType()
22
34
 
23
35
  const searchInputRef = ref(null)
24
36
 
25
- const onInputBlur = () => {
26
- emit('onInputBlur')
37
+ const onCloseDialog = () => {
38
+ emit('onCloseDialog')
39
+ }
40
+
41
+ const onInputFocus = (event) => {
42
+ setTimeout(() => {
43
+ emit('addDialog')
44
+ if (event.target === document.activeElement) {
45
+ event.target.blur()
46
+ }
47
+ }, 300)
27
48
  }
28
49
 
29
50
  const updateInputVal = (event) => {
@@ -32,24 +53,54 @@ const updateInputVal = (event) => {
32
53
  </script>
33
54
 
34
55
  <template>
35
- <div :class="`input-search size-${size}`">
36
- <UInputTextStd
37
- v-bind="$attrs"
38
- autocorrect="off"
39
- autocapitalize="off"
40
- autocomplete="off"
41
- :aria-label="label"
42
- :debounce="500"
43
- :label="label"
44
- :loading="loading"
45
- :modelValue="searchText"
46
- ref="searchInputRef"
47
- spellcheck="false"
48
- @blur="onInputBlur"
49
- @update:modelValue="updateInputVal($event)"
50
- />
56
+ <div class="typeahead-advance-search">
57
+ <div v-if="$screen.isMobile">
58
+ <UInputTextStd
59
+ v-bind="$attrs"
60
+ :aria-label="label"
61
+ autocapitalize="off"
62
+ autocomplete="off"
63
+ autocorrect="off"
64
+ :label="label"
65
+ readonly
66
+ ref="searchInputRef"
67
+ @click="onInputFocus"
68
+ @update:modelValue="updateInputVal($event)"
69
+ />
70
+ <USheet
71
+ v-model:dialogs="dialogs"
72
+ dialogClass="typeahead-sheet"
73
+ @onCloseDialog="onCloseDialog"
74
+ >
75
+ <template #content>
76
+ <div class="q-mx-ba">
77
+ <UInputTypeahead
78
+ v-bind="$attrs"
79
+ :aria-label="label"
80
+ :label="label"
81
+ :loading="loading"
82
+ :modelValue="searchText"
83
+ @update:modelValue="updateInputVal($event)"
84
+ />
85
+ </div>
51
86
 
52
- <slot name="menu"></slot>
87
+ <slot name="menuContent" />
88
+ </template>
89
+ </USheet>
90
+ </div>
91
+ <div v-else>
92
+ <div :class="`input-search size-${size}`">
93
+ <UInputTypeahead
94
+ v-bind="$attrs"
95
+ :aria-label="label"
96
+ :label="label"
97
+ :loading="loading"
98
+ :modelValue="searchText"
99
+ @update:modelValue="updateInputVal($event)"
100
+ />
101
+ <slot name="menu" />
102
+ </div>
103
+ </div>
53
104
  </div>
54
105
  </template>
55
106
 
@@ -61,4 +112,15 @@ const updateInputVal = (event) => {
61
112
  width: 24.5625rem
62
113
  &.size-md
63
114
  width: 26.5rem
115
+ .typeahead-sheet
116
+ .sheet-card-wrapper
117
+ .q-card__section--vert
118
+ padding:0px
119
+ .heading-row
120
+ padding: 0.125rem $ba $xs $ba
121
+ .q-card__section .q-item
122
+ padding: $xs $xs $xs $ba !important
123
+ align-items: center !important
124
+ border-radius: $xs !important
125
+ margin-bottom: 0px !important
64
126
  </style>
@@ -1,10 +1,10 @@
1
1
  <script setup>
2
- import { computed } from 'vue'
3
2
  import UBtnStd from './UBtnStd.vue'
4
3
  import UInputPhoneStd from './UInputPhoneStd.vue'
5
4
  import UInputTextStd from './UInputTextStd.vue'
6
5
  import UMultiSelectStd from './UMultiSelectStd.vue'
7
6
  import USelectStd from './USelectStd.vue'
7
+ import { useScreenType } from '../../composables/useScreenType'
8
8
 
9
9
  const props = defineProps({
10
10
  disbaleApplyFilter: {
@@ -48,6 +48,8 @@ const emit = defineEmits([
48
48
  'updateAdvanceSearchToggle',
49
49
  ])
50
50
 
51
+ const $screen = useScreenType()
52
+
51
53
  const clearFields = () => {
52
54
  emit('onClearAdvancedSearchFilter')
53
55
  }
@@ -118,7 +120,7 @@ const updateToggle = (val) => {
118
120
  <slot name="custom-menu" />
119
121
  </template>
120
122
 
121
- <section v-else class="bg-neutral-2 q-px-ba q-pb-ba">
123
+ <section v-else class="q-px-ba q-pb-ba bg-neutral-2">
122
124
  <div class="row items-container">
123
125
  <div
124
126
  v-for="(item, index) in fields && fields.length ? fields : []"
@@ -277,6 +279,9 @@ const updateToggle = (val) => {
277
279
  .action-wrapper
278
280
  display: flex
279
281
  gap: $xs
282
+ background: $neutral-2 !important
283
+ .button-label
284
+ word-break: break-word
280
285
  .q-card__actions
281
286
  padding: 0px
282
287
  margin: $ba 0px $ba 0px