@usssa/component-library 1.0.0-alpha.15 → 1.0.0-alpha.151
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 +6 -3
- package/package.json +23 -5
- package/src/assets/logo.svg +19 -0
- package/src/assets/no-result.svg +25 -0
- package/src/assets/quasar-logo-vertical.svg +15 -0
- package/src/assets/upload-illustration.svg +48 -0
- package/src/components/core/UAvatar.vue +56 -24
- package/src/components/core/UAvatarGroup.vue +62 -52
- package/src/components/core/UBadgeStd.vue +6 -1
- package/src/components/core/UBannerStd.vue +100 -31
- package/src/components/core/UBreadCrumbs.vue +171 -0
- package/src/components/core/UBtnIcon.vue +58 -53
- package/src/components/core/UBtnStd.vue +39 -31
- package/src/components/core/UBtnToggle.vue +11 -6
- package/src/components/core/UCheckboxStd.vue +26 -20
- package/src/components/core/UChip.vue +76 -42
- package/src/components/core/UDate.vue +565 -0
- package/src/components/core/UDialogStd.vue +460 -53
- package/src/components/core/UDrawer.vue +321 -0
- package/src/components/core/UInnerLoader.vue +69 -0
- package/src/components/core/UInputAddressLookup.vue +471 -0
- package/src/components/core/UInputPhoneStd.vue +73 -68
- package/src/components/core/UInputTextStd.vue +133 -116
- package/src/components/core/UInputTypeahead.vue +44 -0
- package/src/components/core/UInputTypeaheadAdvanceSearch.vue +126 -0
- package/src/components/core/UMenuButtonStd.vue +280 -0
- package/src/components/core/UMenuDropdown.vue +80 -0
- package/src/components/core/UMenuDropdownAdvancedSearch.vue +293 -0
- package/src/components/core/UMenuItem.vue +161 -0
- package/src/components/core/UMenuSearch.vue +69 -0
- package/src/components/core/UMultiSelectStd.vue +258 -54
- package/src/components/core/UPagination.vue +67 -27
- package/src/components/core/URadioBtn.vue +66 -43
- package/src/components/core/URadioStd.vue +19 -12
- package/src/components/core/USelectStd.vue +360 -80
- package/src/components/core/USheet.vue +349 -0
- package/src/components/core/UTabBtnStd.vue +87 -59
- package/src/components/core/UTable/UTable.vue +811 -42
- package/src/components/core/UTableStd.vue +875 -275
- package/src/components/core/UTabsStd.vue +57 -16
- package/src/components/core/UToggleStd.vue +43 -29
- package/src/components/core/UToolbar/UCustomMenuIcon.vue +58 -0
- package/src/components/core/UToolbar/UToolbar.vue +210 -0
- package/src/components/core/UTooltip.vue +31 -10
- package/src/components/core/UTypeahead.vue +830 -0
- package/src/components/core/UUploader.vue +535 -0
- package/src/components/index.js +61 -21
- package/src/composables/useNotify.js +16 -16
- package/src/composables/useOverlayLoader.js +23 -0
- package/src/composables/useScreenType.js +30 -0
- package/src/css/app.sass +168 -0
- package/src/css/colors.sass +103 -0
- package/src/css/media.sass +1 -0
- package/src/css/quasar.variables.sass +121 -0
- package/src/css/typography.sass +0 -0
- package/src/css/vars/colors.variables.sass +127 -0
- package/src/utils/data.ts +146 -0
|
@@ -0,0 +1,321 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed, watch } from 'vue'
|
|
3
|
+
import { useRouter } from 'vue-router'
|
|
4
|
+
import UBadgeStd from './UBadgeStd.vue'
|
|
5
|
+
import UBtnIcon from './UBtnIcon.vue'
|
|
6
|
+
import UBtnStd from './UBtnStd.vue'
|
|
7
|
+
import UMenuItem from './UMenuItem.vue'
|
|
8
|
+
import UTooltip from './UTooltip.vue'
|
|
9
|
+
import { useScreenType } from '../../composables/useScreenType.js'
|
|
10
|
+
|
|
11
|
+
const emit = defineEmits(['menuItemClicked', 'closeDrawer'])
|
|
12
|
+
const miniState = defineModel('miniState', {
|
|
13
|
+
default: false,
|
|
14
|
+
type: Boolean,
|
|
15
|
+
})
|
|
16
|
+
const open = defineModel('open', {
|
|
17
|
+
default: false,
|
|
18
|
+
type: Boolean,
|
|
19
|
+
})
|
|
20
|
+
const props = defineProps({
|
|
21
|
+
brandLogo: {
|
|
22
|
+
default: '',
|
|
23
|
+
},
|
|
24
|
+
brandMiniLogo: {
|
|
25
|
+
default: '',
|
|
26
|
+
},
|
|
27
|
+
dataTestId: {
|
|
28
|
+
default: 'drawer-std',
|
|
29
|
+
type: String,
|
|
30
|
+
},
|
|
31
|
+
homeLink: {
|
|
32
|
+
default: '/home',
|
|
33
|
+
type: String,
|
|
34
|
+
},
|
|
35
|
+
menu: {
|
|
36
|
+
default: () => [],
|
|
37
|
+
type: Array,
|
|
38
|
+
},
|
|
39
|
+
showFooter: {
|
|
40
|
+
type: Boolean,
|
|
41
|
+
default: false,
|
|
42
|
+
},
|
|
43
|
+
side: {
|
|
44
|
+
type: String,
|
|
45
|
+
default: 'left',
|
|
46
|
+
},
|
|
47
|
+
})
|
|
48
|
+
|
|
49
|
+
const $screen = useScreenType()
|
|
50
|
+
const $router = useRouter()
|
|
51
|
+
|
|
52
|
+
const currentPath = computed(() => getCurrentPath())
|
|
53
|
+
const currentRoute = computed(() => $router.currentRoute.value.fullPath)
|
|
54
|
+
|
|
55
|
+
const getCurrentPath = (int = 1) => {
|
|
56
|
+
return currentRoute.value.split('/')[int]
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* returning x offset for tooltip for long text
|
|
61
|
+
* @param {*} label
|
|
62
|
+
*/
|
|
63
|
+
const getXOffset = (label) => {
|
|
64
|
+
let labelLength = label.trim().length
|
|
65
|
+
return labelLength <= 4 ? 65 : labelLength < 9 ? 85 : 145
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
const handleClick = (menu) => {
|
|
69
|
+
emit('menuItemClicked', menu)
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
const handleCloseDrawer = () => {
|
|
73
|
+
emit('closeDrawer')
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
watch($screen, () => {
|
|
77
|
+
if ($screen.value.isDesktop) {
|
|
78
|
+
open.value = true
|
|
79
|
+
}
|
|
80
|
+
})
|
|
81
|
+
</script>
|
|
82
|
+
<template>
|
|
83
|
+
<q-drawer
|
|
84
|
+
v-model="open"
|
|
85
|
+
:class="[
|
|
86
|
+
'u-drawer',
|
|
87
|
+
{ 'u-mini-drawer': miniState },
|
|
88
|
+
{ 'drawer-desktop': $screen.isDesktop },
|
|
89
|
+
{ 'drawer-open': open },
|
|
90
|
+
]"
|
|
91
|
+
:dataTestId="dataTestId"
|
|
92
|
+
:behavior="$screen.isMobile ? 'default' : 'desktop'"
|
|
93
|
+
:mini="miniState"
|
|
94
|
+
:mini-width="64"
|
|
95
|
+
:overlay="$screen.isDesktop ? false : true"
|
|
96
|
+
:show-if-above="$screen.isMobile || $screen.isTablet ? false : true"
|
|
97
|
+
:side="side"
|
|
98
|
+
:width="224"
|
|
99
|
+
>
|
|
100
|
+
<q-scroll-area class="u-drawer-scrollable-area">
|
|
101
|
+
<div
|
|
102
|
+
v-if="$screen.isDesktop"
|
|
103
|
+
:class="`flex items-center justify-${
|
|
104
|
+
miniState ? 'center q-py-ba' : 'between q-py-ba q-pl-xs q-pr-xxs'
|
|
105
|
+
} `"
|
|
106
|
+
>
|
|
107
|
+
<UBtnStd
|
|
108
|
+
class="flex items-center justify-center drawer-logo q-pa-none"
|
|
109
|
+
flat
|
|
110
|
+
:ripple="false"
|
|
111
|
+
size="sm"
|
|
112
|
+
:to="homeLink"
|
|
113
|
+
>
|
|
114
|
+
<q-img
|
|
115
|
+
v-if="!miniState"
|
|
116
|
+
class="full-logo"
|
|
117
|
+
alt="usssa-logo"
|
|
118
|
+
aria-label="usssa logo"
|
|
119
|
+
:src="`${brandLogo}`"
|
|
120
|
+
/>
|
|
121
|
+
<q-img
|
|
122
|
+
v-else
|
|
123
|
+
class="mini-state-logo"
|
|
124
|
+
alt="usssa-logo"
|
|
125
|
+
aria-label="usssa logo"
|
|
126
|
+
:src="brandMiniLogo"
|
|
127
|
+
/>
|
|
128
|
+
</UBtnStd>
|
|
129
|
+
<div
|
|
130
|
+
v-if="!miniState"
|
|
131
|
+
class="drawer-open-close-icon-wrapper flex items-center justify-center"
|
|
132
|
+
>
|
|
133
|
+
<UBtnIcon
|
|
134
|
+
v-if="$screen.isDesktop"
|
|
135
|
+
iconClass="fa-kit-duotone fa-sidebar-shrink"
|
|
136
|
+
ariaLabel="Sidebar shrink icon"
|
|
137
|
+
color="primary"
|
|
138
|
+
dense
|
|
139
|
+
ref="btn-icon"
|
|
140
|
+
size="sm"
|
|
141
|
+
@click="handleCloseDrawer"
|
|
142
|
+
/>
|
|
143
|
+
<UTooltip
|
|
144
|
+
anchor="center right"
|
|
145
|
+
description="Collapse Menu"
|
|
146
|
+
:offset="[4, 14]"
|
|
147
|
+
self="center start"
|
|
148
|
+
/>
|
|
149
|
+
</div>
|
|
150
|
+
</div>
|
|
151
|
+
<q-list
|
|
152
|
+
:class="`drawer-menu-list ${miniState ? 'drawer-menu-mini-list' : ''}`"
|
|
153
|
+
padding
|
|
154
|
+
>
|
|
155
|
+
<template v-for="(m, i) in menu" :key="i">
|
|
156
|
+
<UMenuItem
|
|
157
|
+
:class="`drawer-items ${miniState ? 'mini-menu-box' : ''} ${
|
|
158
|
+
!$screen.isDesktop ? 'mobile-menu' : ''
|
|
159
|
+
}`"
|
|
160
|
+
:icon-class="!$screen.isDesktop ? 'list-icons' : ''"
|
|
161
|
+
:id="`u-drawer-menu-${i}`"
|
|
162
|
+
:label="m.label"
|
|
163
|
+
:left-icon="m.leftIcon"
|
|
164
|
+
:selected="currentPath === m.to.replaceAll('/', '')"
|
|
165
|
+
@onClick="handleClick(m)"
|
|
166
|
+
>
|
|
167
|
+
<template v-if="!miniState" #trailing_slot>
|
|
168
|
+
<UBadgeStd v-if="m.badgeInfo" :label="m.badgeInfo" size="lg" />
|
|
169
|
+
<q-icon
|
|
170
|
+
v-if="m.rightIcon"
|
|
171
|
+
:class="`${m.rightIcon} ${
|
|
172
|
+
currentPath === m.to.replaceAll('/', '')
|
|
173
|
+
? ''
|
|
174
|
+
: 'non-active-right-icon'
|
|
175
|
+
}`"
|
|
176
|
+
:aria-label="m.badgeInfo"
|
|
177
|
+
size="1rem"
|
|
178
|
+
/>
|
|
179
|
+
</template>
|
|
180
|
+
</UMenuItem>
|
|
181
|
+
<UTooltip
|
|
182
|
+
v-if="miniState"
|
|
183
|
+
anchor="center right"
|
|
184
|
+
:description="m.label"
|
|
185
|
+
:offset="[getXOffset(m.label), 20]"
|
|
186
|
+
self="center right"
|
|
187
|
+
:target="`#u-drawer-menu-${i}`"
|
|
188
|
+
/>
|
|
189
|
+
</template>
|
|
190
|
+
</q-list>
|
|
191
|
+
<div
|
|
192
|
+
v-if="showFooter && !$screen.isDesktop"
|
|
193
|
+
class="drawer-footer q-mt-xs q-pb-ba full-width flex justify-center bg-neutral-1"
|
|
194
|
+
>
|
|
195
|
+
<slot name="footer" />
|
|
196
|
+
</div>
|
|
197
|
+
</q-scroll-area>
|
|
198
|
+
</q-drawer>
|
|
199
|
+
</template>
|
|
200
|
+
<style lang="sass">
|
|
201
|
+
.mini-state-logo
|
|
202
|
+
height: $ms
|
|
203
|
+
width: 2.022rem
|
|
204
|
+
|
|
205
|
+
.q-drawer:has(.u-drawer)
|
|
206
|
+
width: 14rem !important
|
|
207
|
+
padding: 0 $xs
|
|
208
|
+
|
|
209
|
+
.q-drawer:has(.u-mini-drawer)
|
|
210
|
+
width: 4rem !important
|
|
211
|
+
|
|
212
|
+
.u-drawer
|
|
213
|
+
background: $surface-bg-1
|
|
214
|
+
.q-scrollarea__content
|
|
215
|
+
width: 100%
|
|
216
|
+
.drawer-logo
|
|
217
|
+
padding: 0px !important
|
|
218
|
+
min-width: 0px !important
|
|
219
|
+
&.q-hoverable:hover > .q-focus-helper
|
|
220
|
+
opacity: 0
|
|
221
|
+
&:focus-visible
|
|
222
|
+
outline: auto !important
|
|
223
|
+
.q-focus-helper
|
|
224
|
+
display: none
|
|
225
|
+
|
|
226
|
+
.q-list--padding
|
|
227
|
+
padding: 0 !important
|
|
228
|
+
.drawer-menu-list
|
|
229
|
+
&:not(.drawer-menu-mini-list)
|
|
230
|
+
.u-menu-link
|
|
231
|
+
gap: 0 !important
|
|
232
|
+
.q-item__section--side
|
|
233
|
+
margin-right: $xs
|
|
234
|
+
.q-item__section--main
|
|
235
|
+
margin-right: $xs
|
|
236
|
+
.u-drawer-scrollable-area
|
|
237
|
+
height: calc(100% - 0px)
|
|
238
|
+
margin-top: 0px
|
|
239
|
+
|
|
240
|
+
.menu-icon-class
|
|
241
|
+
font-size: 1rem
|
|
242
|
+
|
|
243
|
+
.menu-icon-wrapper
|
|
244
|
+
min-width: auto !important
|
|
245
|
+
|
|
246
|
+
.full-logo
|
|
247
|
+
width: 5.918rem
|
|
248
|
+
height: $ms
|
|
249
|
+
|
|
250
|
+
.drawer-open-close-icon
|
|
251
|
+
font-size: 1rem
|
|
252
|
+
color: $primary
|
|
253
|
+
|
|
254
|
+
.drawer-open-close-icon-wrapper
|
|
255
|
+
height: $md
|
|
256
|
+
width: $md
|
|
257
|
+
|
|
258
|
+
.q-drawer:has(.mobile-menu)
|
|
259
|
+
padding: 0px $ba !important
|
|
260
|
+
|
|
261
|
+
.u-menu-link
|
|
262
|
+
.q-item
|
|
263
|
+
margin-bottom: 0
|
|
264
|
+
|
|
265
|
+
.drawer-menu-mini-list
|
|
266
|
+
display: grid
|
|
267
|
+
place-content: center
|
|
268
|
+
place-items: center
|
|
269
|
+
padding: 0 $xs
|
|
270
|
+
|
|
271
|
+
.u-drawer
|
|
272
|
+
.drawer-menu-list
|
|
273
|
+
.q-icon
|
|
274
|
+
color: $primary !important
|
|
275
|
+
|
|
276
|
+
.mini-menu-box
|
|
277
|
+
width: 3.5rem
|
|
278
|
+
gap: 0 !important
|
|
279
|
+
.u-drawer
|
|
280
|
+
.drawer-menu-list
|
|
281
|
+
.non-active-right-icon
|
|
282
|
+
color: $dark !important
|
|
283
|
+
.drawer-items
|
|
284
|
+
margin-bottom: $xs!important
|
|
285
|
+
|
|
286
|
+
.drawer-footer
|
|
287
|
+
bottom: 0
|
|
288
|
+
position: fixed
|
|
289
|
+
|
|
290
|
+
.list-icons
|
|
291
|
+
font-size : 1.5rem !important
|
|
292
|
+
|
|
293
|
+
.mobile-menu
|
|
294
|
+
.label
|
|
295
|
+
font-size: 1rem
|
|
296
|
+
line-height: 1.5rem
|
|
297
|
+
letter-spacing: .01786rem
|
|
298
|
+
font-weight: 400
|
|
299
|
+
@media (max-width: 600px)
|
|
300
|
+
.q-drawer__backdrop
|
|
301
|
+
top: 50px
|
|
302
|
+
.q-drawer:has(.drawer-open)
|
|
303
|
+
top: 50px
|
|
304
|
+
width: 100% !important
|
|
305
|
+
.q-drawer:has(.u-drawer)
|
|
306
|
+
top: 50px !important
|
|
307
|
+
.drawer-menu-list
|
|
308
|
+
margin-top: $ba
|
|
309
|
+
@media (min-width: 1024px)
|
|
310
|
+
.q-drawer__backdrop
|
|
311
|
+
top: 0px !important
|
|
312
|
+
.q-drawer--mini:has(.u-drawer)
|
|
313
|
+
top: 0px !important
|
|
314
|
+
.q-drawer:has(.u-drawer)
|
|
315
|
+
top: 0px !important
|
|
316
|
+
@media ( min-width: 601px ) and (max-width: 1023px)
|
|
317
|
+
.q-drawer:has(.drawer-open)
|
|
318
|
+
width: 100% !important
|
|
319
|
+
.drawer-menu-list
|
|
320
|
+
margin-top: $ba
|
|
321
|
+
</style>
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
defineProps({
|
|
3
|
+
dataTestId: {
|
|
4
|
+
type: String,
|
|
5
|
+
default: 'inner-loader',
|
|
6
|
+
},
|
|
7
|
+
image: {
|
|
8
|
+
type: String,
|
|
9
|
+
required: true,
|
|
10
|
+
},
|
|
11
|
+
imageHeight: {
|
|
12
|
+
type: String,
|
|
13
|
+
default: '24'
|
|
14
|
+
},
|
|
15
|
+
imageWidth: {
|
|
16
|
+
type: String,
|
|
17
|
+
default: '95'
|
|
18
|
+
},
|
|
19
|
+
loading: {
|
|
20
|
+
type: Boolean,
|
|
21
|
+
required: true,
|
|
22
|
+
},
|
|
23
|
+
loadingMessage: {
|
|
24
|
+
type: String,
|
|
25
|
+
required: true,
|
|
26
|
+
},
|
|
27
|
+
spinnerColor: {
|
|
28
|
+
type: String,
|
|
29
|
+
required: false,
|
|
30
|
+
},
|
|
31
|
+
spinnerSize: {
|
|
32
|
+
type: String,
|
|
33
|
+
requried: false,
|
|
34
|
+
default: '2rem',
|
|
35
|
+
},
|
|
36
|
+
})
|
|
37
|
+
</script>
|
|
38
|
+
<template>
|
|
39
|
+
<q-inner-loading
|
|
40
|
+
v-bind="$attrs"
|
|
41
|
+
color="primary"
|
|
42
|
+
:dataTestId="dataTestId"
|
|
43
|
+
:showing="loading"
|
|
44
|
+
>
|
|
45
|
+
<div class="column items-center q-gutter-y-sm">
|
|
46
|
+
<img
|
|
47
|
+
class="q-my-none"
|
|
48
|
+
alt="Loader Image"
|
|
49
|
+
:height="imageHeight"
|
|
50
|
+
:src="image"
|
|
51
|
+
:width="imageWidth"
|
|
52
|
+
/>
|
|
53
|
+
<div class="row items-center">
|
|
54
|
+
<div v-if="loadingMessage" class="text-center">
|
|
55
|
+
<span class="message q-mr-sm">{{ loadingMessage }}</span>
|
|
56
|
+
<q-spinner-facebook :color="spinnerColor" :size="spinnerSize" />
|
|
57
|
+
</div>
|
|
58
|
+
</div>
|
|
59
|
+
</div>
|
|
60
|
+
</q-inner-loading>
|
|
61
|
+
</template>
|
|
62
|
+
<style scoped lang="sass">
|
|
63
|
+
.u-loader
|
|
64
|
+
position: relative
|
|
65
|
+
height: 100%
|
|
66
|
+
.message
|
|
67
|
+
color: $dark
|
|
68
|
+
font-weight: 500
|
|
69
|
+
</style>
|