@usssa/component-library 1.0.0-alpha.27 → 1.0.0-alpha.271
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 +8 -5
- package/package.json +30 -8
- package/src/assets/VS.svg +5 -0
- package/src/assets/fonts/CorneroRegular.woff +0 -0
- package/src/assets/fonts/CorneroRegular.woff2 +0 -0
- package/src/assets/logo.svg +19 -0
- package/src/assets/no-result.svg +25 -0
- package/src/assets/upload-illustration.svg +48 -0
- package/src/components/core/UAccordionSelect.vue +237 -0
- package/src/components/core/UAvatar.vue +90 -26
- 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/UBracket.vue +2181 -0
- package/src/components/core/UBreadCrumbs.vue +171 -0
- package/src/components/core/UBtnIcon.vue +106 -53
- package/src/components/core/UBtnStd.vue +38 -31
- package/src/components/core/UBtnToggle.vue +11 -6
- package/src/components/core/UCheckboxStd.vue +26 -20
- package/src/components/core/UChip.vue +107 -58
- package/src/components/core/UDate.vue +627 -0
- package/src/components/core/UDialogStd.vue +456 -58
- package/src/components/core/UDrawer/UDrawer.vue +479 -0
- package/src/components/core/UDrawer/UDrawerMenuItem.vue +130 -0
- package/src/components/core/UEventCard.vue +463 -0
- package/src/components/core/UExpansionStd.vue +380 -0
- package/src/components/core/UExpansionTableStd.vue +311 -0
- package/src/components/core/UFilter.vue +99 -0
- package/src/components/core/UGameObject.vue +478 -0
- package/src/components/core/UInnerLoader.vue +69 -0
- package/src/components/core/UInputAddressLookup.vue +535 -0
- package/src/components/core/UInputPhoneStd.vue +74 -67
- package/src/components/core/UInputTextStd.vue +99 -64
- package/src/components/core/UInputTypeahead.vue +44 -0
- package/src/components/core/UInputTypeaheadAdvanceSearch.vue +134 -0
- package/src/components/core/UMatchup.vue +404 -0
- package/src/components/core/UMenuButtonStd.vue +280 -0
- package/src/components/core/UMenuDropdown.vue +38 -33
- package/src/components/core/UMenuDropdownAdvancedSearch.vue +306 -0
- package/src/components/core/UMenuItem.vue +226 -0
- package/src/components/core/UMenuSearch.vue +73 -0
- package/src/components/core/UModal.vue +660 -0
- package/src/components/core/UMultiSelectStd.vue +521 -63
- package/src/components/core/UPagination.vue +76 -24
- package/src/components/core/URadioBtn.vue +66 -43
- package/src/components/core/URadioStd.vue +23 -14
- package/src/components/core/USelectStd.vue +441 -84
- package/src/components/core/USheet.vue +349 -0
- package/src/components/core/UStepper/UProgress.vue +157 -0
- package/src/components/core/UStepper/UStepper.vue +214 -0
- package/src/components/core/UTabBtnStd.vue +36 -22
- package/src/components/core/UTable/UTable.vue +2269 -57
- package/src/components/core/UTableStd.vue +1436 -286
- package/src/components/core/UTabsStd.vue +53 -23
- package/src/components/core/UToggleStd.vue +18 -13
- package/src/components/core/UToolbar/UCustomMenuIcon.vue +58 -0
- package/src/components/core/UToolbar/UToolbar.vue +226 -0
- package/src/components/core/UTooltip.vue +32 -10
- package/src/components/core/UTypeahead.vue +890 -0
- package/src/components/core/UUploader.vue +757 -0
- package/src/components/core/UVenueCard.vue +221 -0
- package/src/components/index.js +83 -30
- 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 +69 -36
- package/src/css/colors.sass +2 -0
- package/src/css/quasar.variables.sass +102 -70
- package/src/css/vars/colors.variables.sass +28 -41
- package/src/utils/bracket.json +1538 -0
- package/src/utils/data.ts +179 -0
- package/src/App.vue +0 -9
- package/src/boot/.gitkeep +0 -0
- package/src/components/core/UMenutem.vue +0 -130
- package/src/layouts/MainLayout.vue +0 -145
- package/src/pages/Avatar.vue +0 -77
- package/src/pages/AvatarGroup.vue +0 -139
- package/src/pages/BadgeStd.vue +0 -83
- package/src/pages/BannerPage.vue +0 -76
- package/src/pages/BtnIcon.vue +0 -120
- package/src/pages/BtnStd.vue +0 -126
- package/src/pages/BtnToggle.vue +0 -131
- package/src/pages/CheckBox.vue +0 -62
- package/src/pages/Chip.vue +0 -108
- package/src/pages/ComponentBase.vue +0 -54
- package/src/pages/Dialog.vue +0 -206
- package/src/pages/ErrorNotFound.vue +0 -11
- package/src/pages/IndexPage.vue +0 -11
- package/src/pages/InputPhone.vue +0 -152
- package/src/pages/InputText.vue +0 -140
- package/src/pages/MenuDropdown.vue +0 -79
- package/src/pages/MenuItem.vue +0 -68
- package/src/pages/MultiSelectStd.vue +0 -174
- package/src/pages/NotifyPage.vue +0 -109
- package/src/pages/Pagination.vue +0 -71
- package/src/pages/Radio.vue +0 -80
- package/src/pages/RadioBtn.vue +0 -104
- package/src/pages/SelectStd.vue +0 -160
- package/src/pages/TabButtonPage.vue +0 -126
- package/src/pages/TablePage.vue +0 -375
- package/src/pages/TabsPage.vue +0 -261
- package/src/pages/TogglePage.vue +0 -58
- package/src/pages/TooltipPage.vue +0 -125
- package/src/router/index.js +0 -34
- package/src/router/routes.js +0 -121
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description Format date
|
|
3
|
+
* @param {string} date
|
|
4
|
+
* @returns {string} - Returns Formatted Date
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
export const formatDate = (date: Date | string | number) => {
|
|
8
|
+
const d = new Date(date)
|
|
9
|
+
return (
|
|
10
|
+
String(d.getDate()).padStart(2, '0') +
|
|
11
|
+
'/' +
|
|
12
|
+
String(d.getMonth() + 1).padStart(2, '0') +
|
|
13
|
+
'/' +
|
|
14
|
+
String(d.getFullYear()).slice(-2)
|
|
15
|
+
)
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* @description Return String with Fixed Length
|
|
20
|
+
* @param {string} string, length
|
|
21
|
+
* @returns {string} - Returns Return partial String
|
|
22
|
+
*/
|
|
23
|
+
export const fixStringLength = (str: string, length: number) => {
|
|
24
|
+
if (str?.length > length) {
|
|
25
|
+
return str.substring(0, length) + '....'
|
|
26
|
+
} else {
|
|
27
|
+
return str?.padEnd(length, ' ')
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* @description Get File Category from MIME Types
|
|
33
|
+
* @param {string} str - Mime Type
|
|
34
|
+
* @returns {string} - Returns Category :- pdf, video, audio, doc etc.
|
|
35
|
+
**/
|
|
36
|
+
export const getFileCategory = (mimeType) => {
|
|
37
|
+
const mimeTypes = {
|
|
38
|
+
// Document MIME types
|
|
39
|
+
'application/pdf': 'pdf',
|
|
40
|
+
'application/msword': 'word',
|
|
41
|
+
'application/vnd.openxmlformats-officedocument.wordprocessingml.document':
|
|
42
|
+
'doc',
|
|
43
|
+
'text/plain': 'text',
|
|
44
|
+
'application/vnd.ms-excel': 'excel',
|
|
45
|
+
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet':
|
|
46
|
+
'excel',
|
|
47
|
+
'application/vnd.ms-powerpoint': 'doc',
|
|
48
|
+
'application/vnd.openxmlformats-officedocument.presentationml.presentation':
|
|
49
|
+
'doc',
|
|
50
|
+
|
|
51
|
+
// Image MIME types
|
|
52
|
+
'image/jpeg': 'image',
|
|
53
|
+
'image/png': 'image',
|
|
54
|
+
'image/gif': 'image',
|
|
55
|
+
'image/bmp': 'image',
|
|
56
|
+
'image/svg+xml': 'image',
|
|
57
|
+
'image/webp': 'image',
|
|
58
|
+
'image/heic': 'image',
|
|
59
|
+
'image/heif': 'image',
|
|
60
|
+
|
|
61
|
+
// Video MIME types
|
|
62
|
+
'video/mp4': 'video',
|
|
63
|
+
'video/x-msvideo': 'video',
|
|
64
|
+
'video/x-matroska': 'video',
|
|
65
|
+
'video/quicktime': 'video',
|
|
66
|
+
'video/x-ms-wmv': 'video',
|
|
67
|
+
'video/avi': 'video',
|
|
68
|
+
|
|
69
|
+
// Audio MIME types
|
|
70
|
+
'audio/mpeg': 'audio',
|
|
71
|
+
'audio/wav': 'audio',
|
|
72
|
+
'audio/aac': 'audio',
|
|
73
|
+
'audio/flac': 'audio',
|
|
74
|
+
|
|
75
|
+
// Archive MIME types
|
|
76
|
+
'application/zip': 'archive',
|
|
77
|
+
'application/x-rar-compressed': 'archive',
|
|
78
|
+
'application/x-tar': 'archive',
|
|
79
|
+
'application/gzip': 'archive',
|
|
80
|
+
|
|
81
|
+
// Add more MIME types as needed
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
return mimeTypes[mimeType] || 'Unknown'
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* @description Parses intials from a "name" string
|
|
88
|
+
* @param {string} str - Name string (e.g. "John Hancock", "John", "John Tyler Smith")
|
|
89
|
+
* @returns {string} - Returns initials
|
|
90
|
+
**/
|
|
91
|
+
export const parseInitials = (str: string): string | void => {
|
|
92
|
+
if (!str) return void 0
|
|
93
|
+
const parts = str.split(' ')
|
|
94
|
+
|
|
95
|
+
if (parts.length === 1) return parts[0].substring(0, 2).toUpperCase()
|
|
96
|
+
|
|
97
|
+
return `${parts[0].substring(0, 1).toUpperCase()}${parts[1]
|
|
98
|
+
.substring(0, 1)
|
|
99
|
+
.toUpperCase()}`
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export const isQuasarColor = (color: string) => {
|
|
103
|
+
const quasarColors = [
|
|
104
|
+
'accent',
|
|
105
|
+
'dark',
|
|
106
|
+
'gold',
|
|
107
|
+
'info',
|
|
108
|
+
'negative',
|
|
109
|
+
'neutral',
|
|
110
|
+
'positive',
|
|
111
|
+
'pink',
|
|
112
|
+
'primary',
|
|
113
|
+
'secondary',
|
|
114
|
+
'teal',
|
|
115
|
+
'warning',
|
|
116
|
+
'yellow',
|
|
117
|
+
]
|
|
118
|
+
const quasarShadeRegex = /^[a-zA-Z]+-\d+$/
|
|
119
|
+
|
|
120
|
+
return quasarColors.includes(color) || quasarShadeRegex.test(color)
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export function categorizeObjects(
|
|
124
|
+
array: Record<string, any>[],
|
|
125
|
+
categoryField: string
|
|
126
|
+
): Record<string, any[]> {
|
|
127
|
+
return array.reduce((acc, item) => {
|
|
128
|
+
if (!acc[item[categoryField]]) {
|
|
129
|
+
acc[item[categoryField]] = []
|
|
130
|
+
}
|
|
131
|
+
acc[item[categoryField]].push(item)
|
|
132
|
+
return acc
|
|
133
|
+
}, {})
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export function deepEqual(
|
|
137
|
+
obj1: Record<string, any>,
|
|
138
|
+
obj2: Record<string, any>
|
|
139
|
+
) {
|
|
140
|
+
// Check if both are the same reference
|
|
141
|
+
if (obj1 === obj2) {
|
|
142
|
+
return true
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
// Check if either is null or not an object
|
|
146
|
+
if (
|
|
147
|
+
obj1 == null ||
|
|
148
|
+
typeof obj1 !== 'object' ||
|
|
149
|
+
obj2 == null ||
|
|
150
|
+
typeof obj2 !== 'object'
|
|
151
|
+
) {
|
|
152
|
+
return false
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
// Get the keys of both objects
|
|
156
|
+
const keys1 = Object.keys(obj1)
|
|
157
|
+
const keys2 = Object.keys(obj2)
|
|
158
|
+
|
|
159
|
+
// Check if they have the same number of keys
|
|
160
|
+
if (keys1.length !== keys2.length) {
|
|
161
|
+
return false
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
// Check if all keys and values are the same
|
|
165
|
+
for (let key of keys1) {
|
|
166
|
+
if (!keys2.includes(key) || !deepEqual(obj1[key], obj2[key])) {
|
|
167
|
+
return false
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
return true
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
export function trimmedLabel(text = '', maxLength = 20, fallback = '') {
|
|
175
|
+
const safeText = text || fallback
|
|
176
|
+
const isTrimmed = safeText.length > maxLength
|
|
177
|
+
const trimmed = isTrimmed ? safeText.slice(0, maxLength) + '...' : safeText
|
|
178
|
+
return { text: trimmed, isTrimmed }
|
|
179
|
+
}
|
package/src/App.vue
DELETED
package/src/boot/.gitkeep
DELETED
|
File without changes
|
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import { computed, ref, watch } from 'vue'
|
|
3
|
-
|
|
4
|
-
const props = defineProps({
|
|
5
|
-
leftIcon: {
|
|
6
|
-
type: String,
|
|
7
|
-
},
|
|
8
|
-
rightIcon: {
|
|
9
|
-
type: String,
|
|
10
|
-
},
|
|
11
|
-
label: {
|
|
12
|
-
type: String,
|
|
13
|
-
},
|
|
14
|
-
selected: {
|
|
15
|
-
type: Boolean,
|
|
16
|
-
default: false,
|
|
17
|
-
},
|
|
18
|
-
destructive: {
|
|
19
|
-
type: Boolean,
|
|
20
|
-
default: false,
|
|
21
|
-
},
|
|
22
|
-
iconClass: {
|
|
23
|
-
type: String,
|
|
24
|
-
},
|
|
25
|
-
})
|
|
26
|
-
|
|
27
|
-
const type = ref(props.destructive ? 'destructive' : 'default')
|
|
28
|
-
|
|
29
|
-
watch(
|
|
30
|
-
() => props.destructive,
|
|
31
|
-
(newValue) => {
|
|
32
|
-
type.value = newValue ? 'destructive' : 'default'
|
|
33
|
-
}
|
|
34
|
-
)
|
|
35
|
-
|
|
36
|
-
const emit = defineEmits(['onClick'])
|
|
37
|
-
|
|
38
|
-
const handleClick = () => {
|
|
39
|
-
return emit('onClick')
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
const labelColor = computed(() => {
|
|
43
|
-
if (props.destructive) {
|
|
44
|
-
return 'text-red-6'
|
|
45
|
-
} else if (props.selected) {
|
|
46
|
-
return 'text-primary'
|
|
47
|
-
}
|
|
48
|
-
return 'text-dark'
|
|
49
|
-
})
|
|
50
|
-
|
|
51
|
-
const iconColor = computed(() => {
|
|
52
|
-
if (props.destructive) {
|
|
53
|
-
return 'red-6'
|
|
54
|
-
} else if (props.selected) {
|
|
55
|
-
return 'primary'
|
|
56
|
-
}
|
|
57
|
-
return 'dark'
|
|
58
|
-
})
|
|
59
|
-
|
|
60
|
-
const backgroundColor = computed(() => {
|
|
61
|
-
if (props.selected && !props.destructive) {
|
|
62
|
-
return 'bg-blue-1'
|
|
63
|
-
}
|
|
64
|
-
return 'bg-neutral-1'
|
|
65
|
-
})
|
|
66
|
-
</script>
|
|
67
|
-
|
|
68
|
-
<template>
|
|
69
|
-
<div class="u-menu-link q-mb-xxs">
|
|
70
|
-
<q-item
|
|
71
|
-
clickable
|
|
72
|
-
:class="`${backgroundColor} item-${type}`"
|
|
73
|
-
@click="handleClick"
|
|
74
|
-
>
|
|
75
|
-
<q-item-section side v-if="leftIcon">
|
|
76
|
-
<q-icon
|
|
77
|
-
:color="iconColor"
|
|
78
|
-
:class="`${leftIcon} ${iconClass}`"
|
|
79
|
-
size="1rem"
|
|
80
|
-
:aria-hidden="true"
|
|
81
|
-
/>
|
|
82
|
-
</q-item-section>
|
|
83
|
-
|
|
84
|
-
<slot name="leading_slot"></slot>
|
|
85
|
-
|
|
86
|
-
<q-item-section class="text-body-sm label" :class="labelColor">
|
|
87
|
-
{{ label }}
|
|
88
|
-
</q-item-section>
|
|
89
|
-
|
|
90
|
-
<q-item-section side v-if="rightIcon">
|
|
91
|
-
<q-icon
|
|
92
|
-
:color="iconColor"
|
|
93
|
-
:class="`${rightIcon} ${iconClass}`"
|
|
94
|
-
size="1rem"
|
|
95
|
-
:aria-hidden="true"
|
|
96
|
-
/>
|
|
97
|
-
</q-item-section>
|
|
98
|
-
|
|
99
|
-
<slot name="trailing_slot"></slot>
|
|
100
|
-
</q-item>
|
|
101
|
-
</div>
|
|
102
|
-
</template>
|
|
103
|
-
|
|
104
|
-
<style lang="sass">
|
|
105
|
-
.u-menu-link
|
|
106
|
-
.q-item
|
|
107
|
-
border-radius: $xxs
|
|
108
|
-
padding: 0rem $xs
|
|
109
|
-
align-items: center
|
|
110
|
-
display: flex
|
|
111
|
-
min-height: $lg
|
|
112
|
-
gap: $xs
|
|
113
|
-
.q-item__section--avatar
|
|
114
|
-
min-width: 0px
|
|
115
|
-
.q-item__section--side
|
|
116
|
-
padding: 0px
|
|
117
|
-
&.item-destructive
|
|
118
|
-
&.q-hoverable:hover > .q-focus-helper:after
|
|
119
|
-
background: $red-6
|
|
120
|
-
opacity: 1
|
|
121
|
-
&.item-default
|
|
122
|
-
&.q-hoverable:hover > .q-focus-helper:after
|
|
123
|
-
background: $surface-bg-link-hover
|
|
124
|
-
opacity: 1
|
|
125
|
-
.label
|
|
126
|
-
word-break: break-all
|
|
127
|
-
|
|
128
|
-
.u-menu-link:last-child
|
|
129
|
-
margin-bottom : 0
|
|
130
|
-
</style>
|
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import { ref } from 'vue'
|
|
3
|
-
|
|
4
|
-
defineOptions({
|
|
5
|
-
name: 'MainLayout',
|
|
6
|
-
})
|
|
7
|
-
|
|
8
|
-
const components = [
|
|
9
|
-
{
|
|
10
|
-
title: 'Avatar',
|
|
11
|
-
path: '/avatar',
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
title: 'Avatar Group',
|
|
15
|
-
path: '/avatar-group',
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
title: 'Badge',
|
|
19
|
-
path: '/badge',
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
title: 'Banner',
|
|
23
|
-
path: '/banner',
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
title: 'Button',
|
|
27
|
-
path: '/button-standard',
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
title: 'Button Icon',
|
|
31
|
-
path: '/button-icon',
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
title: 'Button Toggle',
|
|
35
|
-
path: '/button-toggle',
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
title: 'Checkbox',
|
|
39
|
-
path: '/check-box',
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
title: 'Chip',
|
|
43
|
-
path: 'chip',
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
title: 'Dialog',
|
|
47
|
-
path: 'dialog',
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
title: 'Input Text',
|
|
51
|
-
path: 'input-text',
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
title: 'Input Phone',
|
|
55
|
-
path: 'input-phone',
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
title: 'Menu Dropdown',
|
|
59
|
-
path: 'menu-dropdown',
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
title: 'Menu Item',
|
|
63
|
-
path: 'menu-item',
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
title: 'MultiSelect',
|
|
67
|
-
path: 'multiselect-standard',
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
title: 'Notify',
|
|
71
|
-
path: '/notify',
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
title: 'Pagination',
|
|
75
|
-
path: 'pagination',
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
title: 'Radio',
|
|
79
|
-
path: 'radio',
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
title: 'Radio Button',
|
|
83
|
-
path: 'radio-btn',
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
title: 'Select',
|
|
87
|
-
path: 'select',
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
title: 'Tabs',
|
|
91
|
-
path: '/tabs/home',
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
title: 'Tab Button',
|
|
95
|
-
path: '/tab-button',
|
|
96
|
-
},
|
|
97
|
-
{
|
|
98
|
-
title: 'Tooltip',
|
|
99
|
-
path: '/tooltip',
|
|
100
|
-
},
|
|
101
|
-
{
|
|
102
|
-
title: 'Toggle',
|
|
103
|
-
path: '/toggle',
|
|
104
|
-
},
|
|
105
|
-
{
|
|
106
|
-
title: 'Table',
|
|
107
|
-
path: '/table',
|
|
108
|
-
},
|
|
109
|
-
]
|
|
110
|
-
|
|
111
|
-
const leftDrawerOpen = ref(true)
|
|
112
|
-
</script>
|
|
113
|
-
|
|
114
|
-
<template>
|
|
115
|
-
<q-layout view="hHh lpr fFf">
|
|
116
|
-
<q-header bordered>
|
|
117
|
-
<q-toolbar class="bg-primary">
|
|
118
|
-
<q-toolbar-title>USSSA Component Library</q-toolbar-title>
|
|
119
|
-
</q-toolbar>
|
|
120
|
-
</q-header>
|
|
121
|
-
|
|
122
|
-
<q-drawer v-model="leftDrawerOpen" bordered>
|
|
123
|
-
<q-list separator>
|
|
124
|
-
<q-item-label class="bg-grey-8 text-grey-3" header>
|
|
125
|
-
Select Component
|
|
126
|
-
</q-item-label>
|
|
127
|
-
|
|
128
|
-
<q-item
|
|
129
|
-
v-for="c of components.sort((a, b) => a.title.localeCompare(b.title))"
|
|
130
|
-
:key="c.title"
|
|
131
|
-
active-class="bg-info text-grey-1 text-weight-bold"
|
|
132
|
-
clickable
|
|
133
|
-
:to="c.path"
|
|
134
|
-
>
|
|
135
|
-
<q-item-section>
|
|
136
|
-
<q-item-label>{{ c.title }}</q-item-label>
|
|
137
|
-
</q-item-section>
|
|
138
|
-
</q-item>
|
|
139
|
-
</q-list>
|
|
140
|
-
</q-drawer>
|
|
141
|
-
<q-page-container>
|
|
142
|
-
<router-view />
|
|
143
|
-
</q-page-container>
|
|
144
|
-
</q-layout>
|
|
145
|
-
</template>
|
package/src/pages/Avatar.vue
DELETED
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import { UAvatar } from 'src/components'
|
|
3
|
-
import ComponentBase from './ComponentBase.vue'
|
|
4
|
-
import { ref } from 'vue'
|
|
5
|
-
|
|
6
|
-
const type = ref('label')
|
|
7
|
-
const round = ref(true)
|
|
8
|
-
const name = ref('A')
|
|
9
|
-
const indicatorColor = ref('')
|
|
10
|
-
const image = ref('')
|
|
11
|
-
const size = ref('sm')
|
|
12
|
-
const indicatorColorOptions = ['primary', 'accent', 'positive', 'neutral']
|
|
13
|
-
const sizeOptions = ['sm', 'md', 'lg', 'xl']
|
|
14
|
-
const showIndicator = ref(true)
|
|
15
|
-
const htmlContent = `<UAvatar
|
|
16
|
-
ref="avatar"
|
|
17
|
-
:name="name"
|
|
18
|
-
:size="size"
|
|
19
|
-
:showIndicator="showIndicator"
|
|
20
|
-
:indicatorColor="indicatorColor"
|
|
21
|
-
:round="round"
|
|
22
|
-
:image="image"
|
|
23
|
-
/>`
|
|
24
|
-
|
|
25
|
-
defineOptions({
|
|
26
|
-
name: 'UAvatar',
|
|
27
|
-
})
|
|
28
|
-
</script>
|
|
29
|
-
|
|
30
|
-
<template>
|
|
31
|
-
<q-page class="flex flex-center">
|
|
32
|
-
<ComponentBase
|
|
33
|
-
figmaUrl="https://www.figma.com/design/2FoTrjVL4ZrTdsvB4DcSao/Components?node-id=2246-39909"
|
|
34
|
-
>
|
|
35
|
-
<template v-slot:component>
|
|
36
|
-
<UAvatar
|
|
37
|
-
ref="avatar"
|
|
38
|
-
:name="name"
|
|
39
|
-
:size="size"
|
|
40
|
-
:showIndicator="showIndicator"
|
|
41
|
-
:indicatorColor="indicatorColor"
|
|
42
|
-
:round="round"
|
|
43
|
-
:image="image"
|
|
44
|
-
/>
|
|
45
|
-
</template>
|
|
46
|
-
|
|
47
|
-
<template v-slot:properties>
|
|
48
|
-
<div class="column q-gutter-y-lg">
|
|
49
|
-
<q-input label="Name" v-model="name"></q-input>
|
|
50
|
-
<q-input label="image" v-model="image"></q-input>
|
|
51
|
-
<q-select v-model="size" :options="sizeOptions" label="Size" />
|
|
52
|
-
<div class="column">
|
|
53
|
-
<span class="text-grey-8 text-caption-sm">Show Indicator</span>
|
|
54
|
-
<q-checkbox
|
|
55
|
-
size="xs"
|
|
56
|
-
v-model="showIndicator"
|
|
57
|
-
:val="true"
|
|
58
|
-
label="Show Indicator"
|
|
59
|
-
/>
|
|
60
|
-
</div>
|
|
61
|
-
<div>
|
|
62
|
-
<q-checkbox size="xs" v-model="round" :val="true" label="Round" />
|
|
63
|
-
</div>
|
|
64
|
-
<q-select
|
|
65
|
-
v-model="indicatorColor"
|
|
66
|
-
:options="indicatorColorOptions"
|
|
67
|
-
label="Indicator Color"
|
|
68
|
-
/>
|
|
69
|
-
</div>
|
|
70
|
-
</template>
|
|
71
|
-
|
|
72
|
-
<template v-slot:code>
|
|
73
|
-
<pre>{{ htmlContent }}</pre>
|
|
74
|
-
</template>
|
|
75
|
-
</ComponentBase>
|
|
76
|
-
</q-page>
|
|
77
|
-
</template>
|
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import { UAvatarGroup } from 'src/components'
|
|
3
|
-
import ComponentBase from './ComponentBase.vue'
|
|
4
|
-
import { ref } from 'vue'
|
|
5
|
-
|
|
6
|
-
const round = ref(true)
|
|
7
|
-
const label = ref('A')
|
|
8
|
-
const indicatorColor = ref('')
|
|
9
|
-
|
|
10
|
-
const size = ref('xl')
|
|
11
|
-
const indicatorColorOptions = ['primary', 'accent', 'positive', 'neutral']
|
|
12
|
-
const sizeOptions = ['sm', 'md', 'lg', 'xl']
|
|
13
|
-
const showIndicator = ref(true)
|
|
14
|
-
const avatarLimit = ref(4)
|
|
15
|
-
|
|
16
|
-
const htmlContent = `<UAvatarGroup
|
|
17
|
-
ref="avatar"
|
|
18
|
-
:label="label"
|
|
19
|
-
:size="size"
|
|
20
|
-
:showIndicator="showIndicator"
|
|
21
|
-
:indicatorColor="indicatorColor"
|
|
22
|
-
:round="round"
|
|
23
|
-
:images="users"
|
|
24
|
-
/>`
|
|
25
|
-
|
|
26
|
-
defineOptions({
|
|
27
|
-
name: 'UAvatarGroup',
|
|
28
|
-
})
|
|
29
|
-
</script>
|
|
30
|
-
|
|
31
|
-
<template>
|
|
32
|
-
<q-page class="flex flex-center">
|
|
33
|
-
<ComponentBase
|
|
34
|
-
figmaUrl="https://www.figma.com/design/2FoTrjVL4ZrTdsvB4DcSao/Components?node-id=2246-39909"
|
|
35
|
-
>
|
|
36
|
-
<template v-slot:component>
|
|
37
|
-
<UAvatarGroup
|
|
38
|
-
ref="avatar"
|
|
39
|
-
:label="label"
|
|
40
|
-
:size="size"
|
|
41
|
-
:showIndicator="showIndicator"
|
|
42
|
-
:indicatorColor="indicatorColor"
|
|
43
|
-
:round="round"
|
|
44
|
-
:images="users"
|
|
45
|
-
:avatarLimit="avatarLimit"
|
|
46
|
-
/>
|
|
47
|
-
</template>
|
|
48
|
-
|
|
49
|
-
<template v-slot:properties>
|
|
50
|
-
<div class="column q-gutter-y-lg">
|
|
51
|
-
<div v-for="(item, index) in users" :key="index">
|
|
52
|
-
<span class="text-grey-8 text-caption-sm"
|
|
53
|
-
>User {{ index + 1 }}</span
|
|
54
|
-
>
|
|
55
|
-
|
|
56
|
-
<q-input
|
|
57
|
-
v-model="users[index].name"
|
|
58
|
-
:val="users[index].name"
|
|
59
|
-
label="Name"
|
|
60
|
-
></q-input>
|
|
61
|
-
<q-input
|
|
62
|
-
v-model="users[index].image"
|
|
63
|
-
:val="item.image"
|
|
64
|
-
label="Image"
|
|
65
|
-
></q-input>
|
|
66
|
-
<div
|
|
67
|
-
class="full-width row justify-end q-mt-xs"
|
|
68
|
-
style="cursor: pointer"
|
|
69
|
-
>
|
|
70
|
-
<q-icon
|
|
71
|
-
@click="removeField(index)"
|
|
72
|
-
class="fa-duotone fa-solid fa-circle-minus"
|
|
73
|
-
size="sm"
|
|
74
|
-
color="primary"
|
|
75
|
-
/>
|
|
76
|
-
</div>
|
|
77
|
-
</div>
|
|
78
|
-
<div class="full-width row justify-end q-mt-sm">
|
|
79
|
-
<q-icon
|
|
80
|
-
@click="addField"
|
|
81
|
-
style="cursor: pointer"
|
|
82
|
-
class="fa-duotone fa-solid fa-circle-plus"
|
|
83
|
-
size="xl"
|
|
84
|
-
color="primary"
|
|
85
|
-
/>
|
|
86
|
-
</div>
|
|
87
|
-
</div>
|
|
88
|
-
<div class="column q-gutter-y-lg">
|
|
89
|
-
<q-input v-model="avatarLimit" label="Avatar Limit" />
|
|
90
|
-
</div>
|
|
91
|
-
<div class="column q-gutter-y-lg">
|
|
92
|
-
<q-select v-model="size" :options="sizeOptions" label="Size" />
|
|
93
|
-
</div>
|
|
94
|
-
<div class="column">
|
|
95
|
-
<span class="text-grey-8 text-caption-sm">Show Indicator</span>
|
|
96
|
-
<q-checkbox
|
|
97
|
-
size="xs"
|
|
98
|
-
v-model="showIndicator"
|
|
99
|
-
:val="true"
|
|
100
|
-
label="Show Indicator"
|
|
101
|
-
/>
|
|
102
|
-
</div>
|
|
103
|
-
<q-select
|
|
104
|
-
v-model="indicatorColor"
|
|
105
|
-
:options="indicatorColorOptions"
|
|
106
|
-
label="Indicator Color"
|
|
107
|
-
/>
|
|
108
|
-
</template>
|
|
109
|
-
|
|
110
|
-
<template v-slot:code>
|
|
111
|
-
<pre>{{ htmlContent }}</pre>
|
|
112
|
-
</template>
|
|
113
|
-
</ComponentBase>
|
|
114
|
-
</q-page>
|
|
115
|
-
</template>
|
|
116
|
-
<script>
|
|
117
|
-
export default {
|
|
118
|
-
data() {
|
|
119
|
-
return {
|
|
120
|
-
users: [
|
|
121
|
-
{ name: 'Alice', image: 'https://cdn.quasar.dev/img/avatar1.jpg' },
|
|
122
|
-
{ name: 'Bob', image: 'https://cdn.quasar.dev/img/avatar2.jpg' },
|
|
123
|
-
{ name: 'Charlie', image: 'https://cdn.quasar.dev/img/avatar3.jpg' },
|
|
124
|
-
{ name: 'Diana', image: 'https://cdn.quasar.dev/img/avatar4.jpg' },
|
|
125
|
-
{ name: 'Edward', image: 'https://cdn.quasar.dev/img/avatar5.jpg' },
|
|
126
|
-
{ name: 'Alex', image: 'https://cdn.quasar.dev/img/avatar6.jpg' },
|
|
127
|
-
],
|
|
128
|
-
}
|
|
129
|
-
},
|
|
130
|
-
methods: {
|
|
131
|
-
addField() {
|
|
132
|
-
this.users.push({ name: '', image: '' })
|
|
133
|
-
},
|
|
134
|
-
removeField(index) {
|
|
135
|
-
this.users.splice(index, 1)
|
|
136
|
-
},
|
|
137
|
-
},
|
|
138
|
-
}
|
|
139
|
-
</script>
|