@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,171 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { ref, computed } from 'vue'
|
|
3
|
+
import { useRouter } from 'vue-router'
|
|
4
|
+
import { useScreenType } from '../../composables/useScreenType'
|
|
5
|
+
import UTooltip from './UTooltip.vue'
|
|
6
|
+
|
|
7
|
+
const props = defineProps({
|
|
8
|
+
activeColor: {
|
|
9
|
+
type: String,
|
|
10
|
+
default: 'primary',
|
|
11
|
+
},
|
|
12
|
+
align: {
|
|
13
|
+
type: String,
|
|
14
|
+
default: 'left',
|
|
15
|
+
},
|
|
16
|
+
dataTestId: {
|
|
17
|
+
type: String,
|
|
18
|
+
default: 'breadcrumbs-std',
|
|
19
|
+
},
|
|
20
|
+
fontTypo: {
|
|
21
|
+
type: String,
|
|
22
|
+
default: 'text-caption-sm',
|
|
23
|
+
},
|
|
24
|
+
links: {
|
|
25
|
+
type: Array,
|
|
26
|
+
default: () => [],
|
|
27
|
+
},
|
|
28
|
+
showActiveRoute: {
|
|
29
|
+
type: Boolean,
|
|
30
|
+
default: true,
|
|
31
|
+
},
|
|
32
|
+
})
|
|
33
|
+
|
|
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
|
+
}
|
|
67
|
+
}
|
|
68
|
+
return false
|
|
69
|
+
})
|
|
70
|
+
|
|
71
|
+
const checkOverflow = () => {
|
|
72
|
+
if (textEl.value) {
|
|
73
|
+
isOverflowing.value = textEl.value.scrollWidth > textEl.value.clientWidth
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
const onClick = (link) => {
|
|
78
|
+
if (link.to) router.push(link.to)
|
|
79
|
+
}
|
|
80
|
+
</script>
|
|
81
|
+
|
|
82
|
+
<template>
|
|
83
|
+
<q-breadcrumbs
|
|
84
|
+
v-bind="$attrs"
|
|
85
|
+
class="u-breadcrumb"
|
|
86
|
+
:active-color="showActiveRoute ? activeColor : 'text-dark'"
|
|
87
|
+
:align="align"
|
|
88
|
+
:dataTestId="dataTestId"
|
|
89
|
+
gutter="none"
|
|
90
|
+
separator-color="text-dark"
|
|
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
|
+
|
|
124
|
+
<q-breadcrumbs-el
|
|
125
|
+
v-if="currentLink && $screen.isMobile"
|
|
126
|
+
:class="fontTypo"
|
|
127
|
+
:aria-label="currentLink.label"
|
|
128
|
+
@click="onClick"
|
|
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>
|
|
153
|
+
</q-breadcrumbs>
|
|
154
|
+
</template>
|
|
155
|
+
|
|
156
|
+
<style lang="sass">
|
|
157
|
+
.u-breadcrumb
|
|
158
|
+
.q-breadcrumbs__separator
|
|
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
|
|
171
|
+
</style>
|
|
@@ -1,28 +1,61 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { computed } from 'vue'
|
|
3
3
|
import UTooltip from './UTooltip.vue'
|
|
4
|
+
|
|
5
|
+
const emit = defineEmits(['onClick'])
|
|
4
6
|
const props = defineProps({
|
|
5
|
-
|
|
7
|
+
anchor: {
|
|
6
8
|
type: String,
|
|
7
|
-
|
|
8
|
-
default: 'fa-kit-duotone fa-circle-bolt',
|
|
9
|
+
default: 'center left',
|
|
9
10
|
},
|
|
10
11
|
ariaLabel: {
|
|
11
12
|
type: String,
|
|
12
13
|
default: '',
|
|
13
14
|
},
|
|
15
|
+
badge: {
|
|
16
|
+
type: Boolean,
|
|
17
|
+
default: false,
|
|
18
|
+
},
|
|
19
|
+
badgeColor: {
|
|
20
|
+
type: String,
|
|
21
|
+
default: 'primary',
|
|
22
|
+
},
|
|
23
|
+
badgeLabel: {
|
|
24
|
+
type: String,
|
|
25
|
+
default: '',
|
|
26
|
+
},
|
|
14
27
|
color: {
|
|
15
28
|
type: String,
|
|
16
29
|
default: 'primary',
|
|
17
30
|
},
|
|
31
|
+
dataTestId: {
|
|
32
|
+
type: String,
|
|
33
|
+
default: 'button-icon',
|
|
34
|
+
},
|
|
35
|
+
iconClass: {
|
|
36
|
+
type: String,
|
|
37
|
+
required: true,
|
|
38
|
+
default: 'fa-kit-duotone fa-circle-bolt',
|
|
39
|
+
},
|
|
40
|
+
offset: {
|
|
41
|
+
type: Array,
|
|
42
|
+
default: () => [4, 4],
|
|
43
|
+
},
|
|
18
44
|
round: {
|
|
19
45
|
type: Boolean,
|
|
20
46
|
default: true,
|
|
21
47
|
},
|
|
48
|
+
self: {
|
|
49
|
+
type: String,
|
|
50
|
+
default: 'center end',
|
|
51
|
+
},
|
|
52
|
+
showIconBorder: {
|
|
53
|
+
type: Boolean,
|
|
54
|
+
default: false,
|
|
55
|
+
},
|
|
22
56
|
size: {
|
|
23
57
|
type: String,
|
|
24
58
|
default: 'md',
|
|
25
|
-
validator: (val) => ['sm', 'md', 'lg'].includes(val),
|
|
26
59
|
},
|
|
27
60
|
tooltip: {
|
|
28
61
|
type: String,
|
|
@@ -32,26 +65,32 @@ const props = defineProps({
|
|
|
32
65
|
type: String,
|
|
33
66
|
default: 'top',
|
|
34
67
|
},
|
|
35
|
-
anchor: {
|
|
36
|
-
type: String,
|
|
37
|
-
default: 'center left',
|
|
38
|
-
},
|
|
39
|
-
self: {
|
|
40
|
-
type: String,
|
|
41
|
-
default: 'center end',
|
|
42
|
-
},
|
|
43
|
-
offset: {
|
|
44
|
-
type: Array,
|
|
45
|
-
default: () => [4, 4],
|
|
46
|
-
},
|
|
47
68
|
})
|
|
48
69
|
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
70
|
+
const btnAriaLabel = computed(() => {
|
|
71
|
+
if (props.badge) {
|
|
72
|
+
return props.ariaLabel + ' ' + props.badgeLabel
|
|
73
|
+
}
|
|
74
|
+
return props.ariaLabel
|
|
75
|
+
})
|
|
76
|
+
const btnClass = computed(() => {
|
|
77
|
+
if (props.color === 'neutral') {
|
|
78
|
+
return 'neutral-4'
|
|
79
|
+
}
|
|
80
|
+
return props.color
|
|
81
|
+
})
|
|
82
|
+
const customBadgeColor = computed(() => {
|
|
83
|
+
if (props.badgeColor === 'neutral') {
|
|
84
|
+
return 'neutral-9'
|
|
85
|
+
}
|
|
86
|
+
return props.badgeColor
|
|
87
|
+
})
|
|
88
|
+
const iconColor = computed(() => {
|
|
89
|
+
if (props.color === 'neutral') {
|
|
90
|
+
return 'neutral-9'
|
|
91
|
+
}
|
|
92
|
+
return props.color
|
|
93
|
+
})
|
|
55
94
|
const iconSize = computed(() => {
|
|
56
95
|
if (props.size === 'sm') {
|
|
57
96
|
return 'xs'
|
|
@@ -62,47 +101,51 @@ const iconSize = computed(() => {
|
|
|
62
101
|
if (props.size === 'lg') {
|
|
63
102
|
return 'md'
|
|
64
103
|
}
|
|
65
|
-
|
|
66
104
|
return props.size
|
|
67
105
|
})
|
|
68
|
-
const iconColor = computed(() => {
|
|
69
|
-
if (props.color === 'neutral') {
|
|
70
|
-
return 'neutral-9'
|
|
71
|
-
}
|
|
72
|
-
return props.color
|
|
73
|
-
})
|
|
74
106
|
|
|
75
|
-
const
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
return props.color
|
|
80
|
-
})
|
|
107
|
+
const handleClick = () => {
|
|
108
|
+
return emit('onClick')
|
|
109
|
+
}
|
|
110
|
+
|
|
81
111
|
</script>
|
|
82
112
|
|
|
83
113
|
<template>
|
|
84
114
|
<q-btn
|
|
85
|
-
|
|
115
|
+
:class="`u-btn-icon size-${size} ${btnClass}`"
|
|
116
|
+
:aria-label="btnAriaLabel"
|
|
117
|
+
:dataTestId="dataTestId"
|
|
86
118
|
flat="flat"
|
|
87
119
|
:round="round"
|
|
88
|
-
|
|
89
|
-
class="u-btn-icon"
|
|
90
|
-
:class="`size-${size} ${btnClass}`"
|
|
120
|
+
@click="handleClick"
|
|
91
121
|
>
|
|
92
|
-
<
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
122
|
+
<template #default>
|
|
123
|
+
<q-icon
|
|
124
|
+
:class="`${iconClass} size-${size}`"
|
|
125
|
+
:aria-hidden="true"
|
|
126
|
+
:color="iconColor"
|
|
127
|
+
:size="iconSize"
|
|
128
|
+
>
|
|
129
|
+
<q-badge
|
|
130
|
+
v-if="badge && badgeLabel"
|
|
131
|
+
:class="`size-${size}`"
|
|
132
|
+
:color="customBadgeColor"
|
|
133
|
+
floating
|
|
134
|
+
:label="badgeLabel"
|
|
135
|
+
rounded
|
|
136
|
+
/>
|
|
137
|
+
</q-icon>
|
|
138
|
+
|
|
139
|
+
<UTooltip
|
|
140
|
+
v-if="tooltip"
|
|
141
|
+
:anchor="anchor"
|
|
142
|
+
:description="tooltip"
|
|
143
|
+
:offset="offset"
|
|
144
|
+
:self="self"
|
|
145
|
+
/>
|
|
146
|
+
|
|
147
|
+
<slot name="menu" />
|
|
148
|
+
</template>
|
|
106
149
|
</q-btn>
|
|
107
150
|
</template>
|
|
108
151
|
|
|
@@ -143,6 +186,16 @@ const btnClass = computed(() => {
|
|
|
143
186
|
width: $md
|
|
144
187
|
&.neutral-9
|
|
145
188
|
color: $neutral-9
|
|
189
|
+
.q-badge
|
|
190
|
+
z-index: 1
|
|
191
|
+
&.size-sm
|
|
192
|
+
font-size: $xs !important
|
|
193
|
+
padding: 0.125rem 0.3125rem !important
|
|
194
|
+
right: -0.3125rem !important
|
|
195
|
+
|
|
196
|
+
&.size-md
|
|
197
|
+
font-size: 0.6875rem !important
|
|
198
|
+
right: -0.3125rem !important
|
|
146
199
|
|
|
147
200
|
&.accent:hover
|
|
148
201
|
background: $accent-bg-hover
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { computed } from 'vue'
|
|
3
3
|
|
|
4
|
+
const emit = defineEmits(['onClick'])
|
|
5
|
+
|
|
4
6
|
const props = defineProps({
|
|
5
7
|
color: {
|
|
6
8
|
type: String,
|
|
7
9
|
default: 'neutral-7',
|
|
8
10
|
},
|
|
11
|
+
dataTestId: {
|
|
12
|
+
type: String,
|
|
13
|
+
default: 'button-std',
|
|
14
|
+
},
|
|
9
15
|
disable: {
|
|
10
16
|
type: Boolean,
|
|
11
17
|
default: false,
|
|
@@ -14,6 +20,10 @@ const props = defineProps({
|
|
|
14
20
|
type: Boolean,
|
|
15
21
|
default: false,
|
|
16
22
|
},
|
|
23
|
+
fullWidth: {
|
|
24
|
+
type: Boolean,
|
|
25
|
+
default: false,
|
|
26
|
+
},
|
|
17
27
|
label: {
|
|
18
28
|
type: String,
|
|
19
29
|
default: 'Button',
|
|
@@ -21,55 +31,53 @@ const props = defineProps({
|
|
|
21
31
|
leftIcon: {
|
|
22
32
|
type: String,
|
|
23
33
|
},
|
|
24
|
-
|
|
34
|
+
leftIconSize: {
|
|
25
35
|
type: String,
|
|
36
|
+
default: 'ba',
|
|
26
37
|
},
|
|
27
38
|
outline: {
|
|
28
39
|
type: Boolean,
|
|
29
40
|
default: false,
|
|
30
41
|
},
|
|
42
|
+
rightIcon: {
|
|
43
|
+
type: String,
|
|
44
|
+
},
|
|
31
45
|
size: {
|
|
32
46
|
type: String,
|
|
33
47
|
default: 'md',
|
|
34
48
|
validator: (val) => ['sm', 'md', 'lg'].includes(val),
|
|
35
49
|
},
|
|
36
|
-
fullWidth: {
|
|
37
|
-
type: Boolean,
|
|
38
|
-
default: false,
|
|
39
|
-
},
|
|
40
50
|
})
|
|
41
51
|
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
return emit('onClick')
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
const textClass = computed(() => {
|
|
49
|
-
if (props.color === 'neutral') {
|
|
50
|
-
return 'text-neutral-9'
|
|
52
|
+
const isFullWidth = computed(() => {
|
|
53
|
+
if (props.fullWidth === true) {
|
|
54
|
+
return 'full-width'
|
|
51
55
|
}
|
|
52
56
|
return ''
|
|
53
57
|
})
|
|
54
58
|
|
|
55
|
-
const
|
|
56
|
-
if (props.
|
|
57
|
-
return '
|
|
59
|
+
const textClass = computed(() => {
|
|
60
|
+
if (props.color === 'neutral') {
|
|
61
|
+
return 'text-neutral-10'
|
|
58
62
|
}
|
|
59
63
|
return ''
|
|
60
64
|
})
|
|
65
|
+
|
|
66
|
+
const handleClick = () => {
|
|
67
|
+
return emit('onClick')
|
|
68
|
+
}
|
|
61
69
|
</script>
|
|
62
70
|
|
|
63
71
|
<template>
|
|
64
72
|
<q-btn
|
|
65
|
-
class="u-btn q-py-none"
|
|
66
|
-
:class="`size-${size} ${textClass} focus-${color} ${isFullWidth}`"
|
|
73
|
+
:class="`u-btn q-py-none size-${size} ${textClass} focus-${color} ${isFullWidth}`"
|
|
67
74
|
:color="color"
|
|
75
|
+
:dataTestId="dataTestId"
|
|
68
76
|
:disable="disable"
|
|
69
|
-
:unelevated="!outline"
|
|
70
|
-
:outline="outline"
|
|
71
|
-
no-caps
|
|
72
77
|
:flat="flat"
|
|
78
|
+
no-caps
|
|
79
|
+
:outline="outline"
|
|
80
|
+
:unelevated="!outline"
|
|
73
81
|
@click="handleClick"
|
|
74
82
|
>
|
|
75
83
|
<template #default>
|
|
@@ -77,10 +85,9 @@ const isFullWidth = computed(() => {
|
|
|
77
85
|
<div class="row items-center no-wrap">
|
|
78
86
|
<q-icon
|
|
79
87
|
v-if="leftIcon"
|
|
88
|
+
:class="`q-mr-xs ${leftIcon} icon-secondary-opacity`"
|
|
80
89
|
left
|
|
81
|
-
:
|
|
82
|
-
class="q-mr-xs"
|
|
83
|
-
size="1.25rem"
|
|
90
|
+
:size="leftIconSize"
|
|
84
91
|
/>
|
|
85
92
|
|
|
86
93
|
<div class="text-center text-caption-md button-label">
|
|
@@ -88,13 +95,15 @@ const isFullWidth = computed(() => {
|
|
|
88
95
|
</div>
|
|
89
96
|
<q-icon
|
|
90
97
|
v-if="rightIcon"
|
|
98
|
+
:class="`q-ml-xs ${rightIcon}`"
|
|
91
99
|
right
|
|
92
|
-
|
|
93
|
-
class="q-ml-xs"
|
|
94
|
-
size="1.25rem"
|
|
100
|
+
size="1rem"
|
|
95
101
|
/>
|
|
96
102
|
</div>
|
|
97
103
|
</slot>
|
|
104
|
+
|
|
105
|
+
<slot name="tooltip" />
|
|
106
|
+
<slot name="menu" />
|
|
98
107
|
</template>
|
|
99
108
|
</q-btn>
|
|
100
109
|
</template>
|
|
@@ -105,7 +114,7 @@ const isFullWidth = computed(() => {
|
|
|
105
114
|
min-width: 5.5rem !important
|
|
106
115
|
|
|
107
116
|
&.bg-neutral
|
|
108
|
-
background-color: $neutral-
|
|
117
|
+
background-color: $neutral-6
|
|
109
118
|
|
|
110
119
|
&.size-sm
|
|
111
120
|
min-height: $md
|
|
@@ -115,12 +124,10 @@ const isFullWidth = computed(() => {
|
|
|
115
124
|
min-height: $lg
|
|
116
125
|
padding: 0 $ba !important
|
|
117
126
|
|
|
118
|
-
|
|
119
127
|
&.size-lg
|
|
120
128
|
min-height: $xl
|
|
121
129
|
padding: 0 $ba !important
|
|
122
130
|
|
|
123
|
-
|
|
124
131
|
.button-label
|
|
125
132
|
word-break: break-all
|
|
126
133
|
</style>
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
const props = defineProps({
|
|
3
|
+
dataTestId: {
|
|
4
|
+
type: String,
|
|
5
|
+
default: 'toggle-btn',
|
|
6
|
+
},
|
|
3
7
|
options: {
|
|
4
8
|
type: Array,
|
|
5
9
|
require: true,
|
|
@@ -10,16 +14,17 @@ const model = defineModel()
|
|
|
10
14
|
|
|
11
15
|
<template>
|
|
12
16
|
<q-btn-toggle
|
|
13
|
-
class="u-btn-toggle"
|
|
14
17
|
v-model="model"
|
|
15
|
-
|
|
16
|
-
text-color="dark"
|
|
17
|
-
unelevated
|
|
18
|
+
class="u-btn-toggle"
|
|
18
19
|
color="white"
|
|
20
|
+
:dataTestId="dataTestId"
|
|
19
21
|
no-caps
|
|
22
|
+
:options="options"
|
|
23
|
+
size="md"
|
|
20
24
|
spread
|
|
25
|
+
text-color="dark"
|
|
21
26
|
toggle-color="primary"
|
|
22
|
-
|
|
27
|
+
unelevated
|
|
23
28
|
>
|
|
24
29
|
<template
|
|
25
30
|
v-for="(option, index) in options"
|
|
@@ -28,8 +33,8 @@ const model = defineModel()
|
|
|
28
33
|
>
|
|
29
34
|
<div class="row items-center no-wrap slot">
|
|
30
35
|
<q-icon
|
|
31
|
-
:class="options[index].iconClass"
|
|
32
36
|
v-if="options[index].iconClass"
|
|
37
|
+
:class="options[index].iconClass"
|
|
33
38
|
/>
|
|
34
39
|
<div class="text-center text-caption-md">
|
|
35
40
|
{{ options[index].name }}
|
|
@@ -1,23 +1,16 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { onMounted } from 'vue'
|
|
3
3
|
|
|
4
|
+
const isChecked = defineModel({ default: false, type: Boolean })
|
|
4
5
|
const props = defineProps({
|
|
5
|
-
|
|
6
|
-
type: String,
|
|
7
|
-
default: '',
|
|
8
|
-
},
|
|
9
|
-
name: {
|
|
6
|
+
dataTestId: {
|
|
10
7
|
type: String,
|
|
11
|
-
default: '',
|
|
8
|
+
default: 'checkbox-std',
|
|
12
9
|
},
|
|
13
10
|
disabled: {
|
|
14
11
|
type: Boolean,
|
|
15
12
|
default: false,
|
|
16
13
|
},
|
|
17
|
-
showLabel: {
|
|
18
|
-
type: Boolean,
|
|
19
|
-
default: true,
|
|
20
|
-
},
|
|
21
14
|
id: {
|
|
22
15
|
type: [String, Number],
|
|
23
16
|
default: 'u-checkbox',
|
|
@@ -27,15 +20,27 @@ const props = defineProps({
|
|
|
27
20
|
type: Boolean,
|
|
28
21
|
default: false,
|
|
29
22
|
},
|
|
23
|
+
label: {
|
|
24
|
+
type: String,
|
|
25
|
+
default: '',
|
|
26
|
+
},
|
|
27
|
+
name: {
|
|
28
|
+
type: String,
|
|
29
|
+
default: '',
|
|
30
|
+
},
|
|
31
|
+
showLabel: {
|
|
32
|
+
type: Boolean,
|
|
33
|
+
default: true,
|
|
34
|
+
},
|
|
30
35
|
})
|
|
31
36
|
|
|
32
|
-
const isChecked = defineModel({ default: false, type: Boolean })
|
|
33
|
-
|
|
34
37
|
onMounted(() => {
|
|
35
38
|
const checkboxElement = document.getElementById(`${props.id}`)
|
|
36
39
|
if (checkboxElement) {
|
|
37
40
|
const inputElement = checkboxElement.querySelector('input')
|
|
38
|
-
inputElement
|
|
41
|
+
if (inputElement) {
|
|
42
|
+
inputElement.id = `${props.id}`
|
|
43
|
+
}
|
|
39
44
|
} else {
|
|
40
45
|
// need to add if element is not found
|
|
41
46
|
}
|
|
@@ -43,19 +48,20 @@ onMounted(() => {
|
|
|
43
48
|
</script>
|
|
44
49
|
|
|
45
50
|
<template>
|
|
46
|
-
<label
|
|
51
|
+
<label :for="`${id}`" style="display: none">Checkbox</label>
|
|
47
52
|
<q-checkbox
|
|
48
|
-
|
|
49
|
-
class="u-checkbox text-caption-lg"
|
|
50
|
-
:name="name"
|
|
53
|
+
v-bind="$attrs"
|
|
51
54
|
v-model="isChecked"
|
|
55
|
+
class="u-checkbox text-caption-lg"
|
|
56
|
+
color="primary"
|
|
57
|
+
:dataTestId="dataTestId"
|
|
52
58
|
:disable="disabled"
|
|
59
|
+
:id="`${id}`"
|
|
60
|
+
keep-color
|
|
53
61
|
:label="showLabel ? label : ''"
|
|
62
|
+
:name="name"
|
|
54
63
|
size="md"
|
|
55
|
-
keep-color
|
|
56
|
-
color="primary"
|
|
57
64
|
:toggle-indeterminate="indeterminate"
|
|
58
|
-
v-bind="$attrs"
|
|
59
65
|
/>
|
|
60
66
|
</template>
|
|
61
67
|
|