@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
|
@@ -1,34 +1,57 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
+
import { computed } from 'vue'
|
|
2
3
|
import UBtnStd from './UBtnStd.vue'
|
|
4
|
+
import { useScreenType } from '../../composables/useScreenType'
|
|
5
|
+
|
|
6
|
+
const emit = defineEmits(['primaryAction', 'secondaryAction'])
|
|
3
7
|
|
|
4
8
|
const props = defineProps({
|
|
5
|
-
|
|
9
|
+
dataTestId: {
|
|
6
10
|
type: String,
|
|
7
|
-
default: '
|
|
11
|
+
default: 'banner-std',
|
|
8
12
|
},
|
|
9
13
|
icon: {
|
|
10
14
|
type: String,
|
|
11
15
|
default: 'fa-kit-duotone fa-circle-info',
|
|
12
16
|
},
|
|
17
|
+
label: {
|
|
18
|
+
type: String,
|
|
19
|
+
default: '',
|
|
20
|
+
},
|
|
13
21
|
message: {
|
|
14
22
|
type: String,
|
|
15
23
|
default: '',
|
|
16
24
|
required: true,
|
|
17
25
|
},
|
|
26
|
+
primaryActionLabel: {
|
|
27
|
+
type: String,
|
|
28
|
+
},
|
|
29
|
+
secondaryActionLabel: {
|
|
30
|
+
type: String,
|
|
31
|
+
},
|
|
18
32
|
show: {
|
|
19
33
|
type: Boolean,
|
|
20
34
|
default: false,
|
|
21
35
|
required: true,
|
|
22
36
|
},
|
|
23
|
-
|
|
24
|
-
type:
|
|
37
|
+
showBorder: {
|
|
38
|
+
type: Boolean,
|
|
39
|
+
default: true,
|
|
25
40
|
},
|
|
26
|
-
|
|
41
|
+
type: {
|
|
27
42
|
type: String,
|
|
43
|
+
default: 'info',
|
|
28
44
|
},
|
|
29
45
|
})
|
|
30
46
|
|
|
31
|
-
const
|
|
47
|
+
const $screen = useScreenType()
|
|
48
|
+
|
|
49
|
+
const bordered = computed(() => {
|
|
50
|
+
if (props.showBorder) {
|
|
51
|
+
return 'bordered'
|
|
52
|
+
}
|
|
53
|
+
return ''
|
|
54
|
+
})
|
|
32
55
|
|
|
33
56
|
const handlePrimaryActionClick = () => {
|
|
34
57
|
emit('primaryAction')
|
|
@@ -41,75 +64,121 @@ const handleSecondaryActionClick = () => {
|
|
|
41
64
|
|
|
42
65
|
<template>
|
|
43
66
|
<q-banner
|
|
44
|
-
v-if="show && message"
|
|
67
|
+
v-if="show && (message.trim() || label.trim())"
|
|
68
|
+
:class="[
|
|
69
|
+
`u-banner u-banner-${type}`,
|
|
70
|
+
!icon ? 'no-padding-label' : '',
|
|
71
|
+
bordered,
|
|
72
|
+
$screen.isMobile ? 'u-banner-sm' : 'u-banner-md',
|
|
73
|
+
]"
|
|
74
|
+
:dataTestId="dataTestId"
|
|
45
75
|
inline-actions
|
|
46
|
-
:class="`u-banner u-banner-${type} ${!icon ? 'no-padding-label' : ''}`"
|
|
47
76
|
tabindex="0"
|
|
48
77
|
>
|
|
49
78
|
<template v-slot:avatar>
|
|
50
79
|
<q-icon
|
|
51
80
|
v-if="icon"
|
|
52
|
-
aria-label="Banner Icon"
|
|
53
81
|
:class="icon"
|
|
54
|
-
size="1.5rem"
|
|
55
|
-
:color="type"
|
|
56
82
|
alt="Banner Info Icon"
|
|
83
|
+
aria-label="Banner Icon"
|
|
84
|
+
:color="type"
|
|
85
|
+
size="sm"
|
|
57
86
|
/>
|
|
58
87
|
</template>
|
|
59
|
-
|
|
88
|
+
|
|
89
|
+
<div>
|
|
90
|
+
<span v-if="!label" class="text-caption-lg">{{ message }}</span>
|
|
91
|
+
<div v-else class="column">
|
|
92
|
+
<span class="text-caption-lg">{{ label }}</span>
|
|
93
|
+
<span class="text-body-sm">{{ message }}</span>
|
|
94
|
+
</div>
|
|
95
|
+
</div>
|
|
96
|
+
|
|
60
97
|
<template v-slot:action>
|
|
61
|
-
<
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
98
|
+
<div :class="['row', $screen.isMobile ? 'full-width q-mt-ba' : '']">
|
|
99
|
+
<u-btn-std
|
|
100
|
+
v-if="primaryActionLabel"
|
|
101
|
+
:color="type"
|
|
102
|
+
:label="primaryActionLabel"
|
|
103
|
+
:outline="true"
|
|
104
|
+
size="md"
|
|
105
|
+
@onClick="handlePrimaryActionClick"
|
|
106
|
+
/>
|
|
107
|
+
<u-btn-std
|
|
108
|
+
v-if="secondaryActionLabel"
|
|
109
|
+
:color="type"
|
|
110
|
+
:label="secondaryActionLabel"
|
|
111
|
+
size="md"
|
|
112
|
+
@onClick="handleSecondaryActionClick"
|
|
113
|
+
/>
|
|
114
|
+
</div>
|
|
78
115
|
</template>
|
|
79
116
|
</q-banner>
|
|
80
117
|
</template>
|
|
81
118
|
|
|
82
119
|
<style lang="sass">
|
|
83
120
|
.u-banner
|
|
84
|
-
min-width: 24.563rem
|
|
85
|
-
padding: $sm
|
|
86
121
|
.q-banner__avatar
|
|
87
122
|
align-self: center
|
|
88
123
|
|
|
89
124
|
.q-banner__content
|
|
90
125
|
padding-left: $xs !important
|
|
126
|
+
word-break: break-word
|
|
127
|
+
overflow-wrap: break-word
|
|
128
|
+
|
|
129
|
+
.u-banner-sm
|
|
130
|
+
flex-wrap: wrap
|
|
131
|
+
padding: $ba
|
|
132
|
+
.q-banner__actions
|
|
133
|
+
width: 100%
|
|
134
|
+
padding-left: 0px !important
|
|
135
|
+
>div
|
|
136
|
+
gap: $sm
|
|
137
|
+
.q-btn
|
|
138
|
+
flex: 1
|
|
139
|
+
min-width: 0
|
|
140
|
+
|
|
141
|
+
.u-banner-md
|
|
142
|
+
padding: $sm
|
|
143
|
+
.q-banner__actions
|
|
144
|
+
padding-left: $xs
|
|
145
|
+
>div
|
|
146
|
+
gap: $xs !important
|
|
91
147
|
|
|
92
148
|
.u-banner-positive
|
|
93
149
|
background: $green-1 !important
|
|
94
150
|
color: $green-7 !important
|
|
151
|
+
&.bordered
|
|
152
|
+
border: 1.5px solid $green-7
|
|
95
153
|
|
|
96
154
|
.u-banner-info
|
|
97
155
|
background: $purple-1 !important
|
|
98
156
|
color: $info !important
|
|
157
|
+
&.bordered
|
|
158
|
+
border: 1.5px solid $purple-7
|
|
99
159
|
|
|
100
160
|
.u-banner-warning
|
|
101
161
|
background: $orange-1 !important
|
|
102
162
|
color: $orange-7 !important
|
|
163
|
+
&.bordered
|
|
164
|
+
border: 1.5px solid $orange-7
|
|
103
165
|
|
|
104
166
|
.u-banner-accent
|
|
105
167
|
background: $red-1 !important
|
|
106
168
|
color: $red-7 !important
|
|
169
|
+
&.bordered
|
|
170
|
+
border: 1.5px solid $red-7
|
|
107
171
|
|
|
108
172
|
.u-banner-primary
|
|
109
173
|
background: $blue-1 !important
|
|
110
174
|
color: $primary !important
|
|
175
|
+
&.bordered
|
|
176
|
+
border: 1.5px solid $primary
|
|
111
177
|
|
|
112
178
|
.no-padding-label
|
|
113
179
|
.q-banner__content
|
|
114
180
|
padding-left: 0px !important
|
|
181
|
+
|
|
182
|
+
.bordered
|
|
183
|
+
border-radius: $xs
|
|
115
184
|
</style>
|
|
@@ -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,11 +1,12 @@
|
|
|
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,
|
|
@@ -15,10 +16,27 @@ const props = defineProps({
|
|
|
15
16
|
type: String,
|
|
16
17
|
default: 'primary',
|
|
17
18
|
},
|
|
19
|
+
dataTestId: {
|
|
20
|
+
type: String,
|
|
21
|
+
default: 'button-icon',
|
|
22
|
+
},
|
|
23
|
+
iconClass: {
|
|
24
|
+
type: String,
|
|
25
|
+
required: true,
|
|
26
|
+
default: 'fa-kit-duotone fa-circle-bolt',
|
|
27
|
+
},
|
|
28
|
+
offset: {
|
|
29
|
+
type: Array,
|
|
30
|
+
default: () => [4, 4],
|
|
31
|
+
},
|
|
18
32
|
round: {
|
|
19
33
|
type: Boolean,
|
|
20
34
|
default: true,
|
|
21
35
|
},
|
|
36
|
+
self: {
|
|
37
|
+
type: String,
|
|
38
|
+
default: 'center end',
|
|
39
|
+
},
|
|
22
40
|
size: {
|
|
23
41
|
type: String,
|
|
24
42
|
default: 'md',
|
|
@@ -32,26 +50,20 @@ const props = defineProps({
|
|
|
32
50
|
type: String,
|
|
33
51
|
default: 'top',
|
|
34
52
|
},
|
|
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
53
|
})
|
|
48
54
|
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
+
const btnClass = computed(() => {
|
|
56
|
+
if (props.color === 'neutral') {
|
|
57
|
+
return 'neutral-4'
|
|
58
|
+
}
|
|
59
|
+
return props.color
|
|
60
|
+
})
|
|
61
|
+
const iconColor = computed(() => {
|
|
62
|
+
if (props.color === 'neutral') {
|
|
63
|
+
return 'neutral-9'
|
|
64
|
+
}
|
|
65
|
+
return props.color
|
|
66
|
+
})
|
|
55
67
|
const iconSize = computed(() => {
|
|
56
68
|
if (props.size === 'sm') {
|
|
57
69
|
return 'xs'
|
|
@@ -62,47 +74,40 @@ const iconSize = computed(() => {
|
|
|
62
74
|
if (props.size === 'lg') {
|
|
63
75
|
return 'md'
|
|
64
76
|
}
|
|
65
|
-
|
|
66
77
|
return props.size
|
|
67
78
|
})
|
|
68
|
-
const iconColor = computed(() => {
|
|
69
|
-
if (props.color === 'neutral') {
|
|
70
|
-
return 'neutral-9'
|
|
71
|
-
}
|
|
72
|
-
return props.color
|
|
73
|
-
})
|
|
74
79
|
|
|
75
|
-
const
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
}
|
|
79
|
-
return props.color
|
|
80
|
-
})
|
|
80
|
+
const handleClick = () => {
|
|
81
|
+
return emit('onClick')
|
|
82
|
+
}
|
|
81
83
|
</script>
|
|
82
84
|
|
|
83
85
|
<template>
|
|
84
86
|
<q-btn
|
|
85
|
-
|
|
87
|
+
:class="`u-btn-icon size-${size} ${btnClass}`"
|
|
88
|
+
:aria-label="ariaLabel"
|
|
89
|
+
:dataTestId="dataTestId"
|
|
86
90
|
flat="flat"
|
|
87
91
|
:round="round"
|
|
88
|
-
|
|
89
|
-
class="u-btn-icon"
|
|
90
|
-
:class="`size-${size} ${btnClass}`"
|
|
92
|
+
@click="handleClick"
|
|
91
93
|
>
|
|
92
|
-
<
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
94
|
+
<template #default>
|
|
95
|
+
<q-icon
|
|
96
|
+
:class="`${iconClass} size-${size}`"
|
|
97
|
+
:aria-hidden="true"
|
|
98
|
+
:color="iconColor"
|
|
99
|
+
:size="iconSize"
|
|
100
|
+
/>
|
|
101
|
+
|
|
102
|
+
<UTooltip
|
|
103
|
+
v-if="tooltip"
|
|
104
|
+
:anchor="anchor"
|
|
105
|
+
:description="tooltip"
|
|
106
|
+
:offset="offset"
|
|
107
|
+
:self="self"
|
|
108
|
+
/>
|
|
109
|
+
<slot name="menu" />
|
|
110
|
+
</template>
|
|
106
111
|
</q-btn>
|
|
107
112
|
</template>
|
|
108
113
|
|
|
@@ -144,7 +149,7 @@ const btnClass = computed(() => {
|
|
|
144
149
|
&.neutral-9
|
|
145
150
|
color: $neutral-9
|
|
146
151
|
|
|
147
|
-
&.accent
|
|
152
|
+
&.accent:hover
|
|
148
153
|
background: $accent-bg-hover
|
|
149
154
|
|
|
150
155
|
.icon-tooltip
|
|
@@ -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,54 @@ const props = defineProps({
|
|
|
21
31
|
leftIcon: {
|
|
22
32
|
type: String,
|
|
23
33
|
},
|
|
24
|
-
|
|
34
|
+
leftIconSize: {
|
|
25
35
|
type: String,
|
|
36
|
+
default: 'ba',
|
|
37
|
+
validator: (val) => ['sm', 'md', 'lg', 'ms', 'ba'].includes(val),
|
|
26
38
|
},
|
|
27
39
|
outline: {
|
|
28
40
|
type: Boolean,
|
|
29
41
|
default: false,
|
|
30
42
|
},
|
|
43
|
+
rightIcon: {
|
|
44
|
+
type: String,
|
|
45
|
+
},
|
|
31
46
|
size: {
|
|
32
47
|
type: String,
|
|
33
48
|
default: 'md',
|
|
34
49
|
validator: (val) => ['sm', 'md', 'lg'].includes(val),
|
|
35
50
|
},
|
|
36
|
-
fullWidth: {
|
|
37
|
-
type: Boolean,
|
|
38
|
-
default: false,
|
|
39
|
-
},
|
|
40
51
|
})
|
|
41
52
|
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
return emit('onClick')
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
const textClass = computed(() => {
|
|
49
|
-
if (props.color === 'neutral') {
|
|
50
|
-
return 'text-neutral-9'
|
|
53
|
+
const isFullWidth = computed(() => {
|
|
54
|
+
if (props.fullWidth === true) {
|
|
55
|
+
return 'full-width'
|
|
51
56
|
}
|
|
52
57
|
return ''
|
|
53
58
|
})
|
|
54
59
|
|
|
55
|
-
const
|
|
56
|
-
if (props.
|
|
57
|
-
return '
|
|
60
|
+
const textClass = computed(() => {
|
|
61
|
+
if (props.color === 'neutral') {
|
|
62
|
+
return 'text-neutral-10'
|
|
58
63
|
}
|
|
59
64
|
return ''
|
|
60
65
|
})
|
|
66
|
+
|
|
67
|
+
const handleClick = () => {
|
|
68
|
+
return emit('onClick')
|
|
69
|
+
}
|
|
61
70
|
</script>
|
|
62
71
|
|
|
63
72
|
<template>
|
|
64
73
|
<q-btn
|
|
65
|
-
class="u-btn q-py-none"
|
|
66
|
-
:class="`size-${size} ${textClass} focus-${color} ${isFullWidth}`"
|
|
74
|
+
:class="`u-btn q-py-none size-${size} ${textClass} focus-${color} ${isFullWidth}`"
|
|
67
75
|
:color="color"
|
|
76
|
+
:dataTestId="dataTestId"
|
|
68
77
|
:disable="disable"
|
|
69
|
-
:unelevated="!outline"
|
|
70
|
-
:outline="outline"
|
|
71
|
-
no-caps
|
|
72
78
|
:flat="flat"
|
|
79
|
+
no-caps
|
|
80
|
+
:outline="outline"
|
|
81
|
+
:unelevated="!outline"
|
|
73
82
|
@click="handleClick"
|
|
74
83
|
>
|
|
75
84
|
<template #default>
|
|
@@ -77,10 +86,9 @@ const isFullWidth = computed(() => {
|
|
|
77
86
|
<div class="row items-center no-wrap">
|
|
78
87
|
<q-icon
|
|
79
88
|
v-if="leftIcon"
|
|
89
|
+
:class="`q-mr-xs ${leftIcon}`"
|
|
80
90
|
left
|
|
81
|
-
:
|
|
82
|
-
class="q-mr-xs"
|
|
83
|
-
size="1.25rem"
|
|
91
|
+
:size="leftIconSize"
|
|
84
92
|
/>
|
|
85
93
|
|
|
86
94
|
<div class="text-center text-caption-md button-label">
|
|
@@ -88,13 +96,15 @@ const isFullWidth = computed(() => {
|
|
|
88
96
|
</div>
|
|
89
97
|
<q-icon
|
|
90
98
|
v-if="rightIcon"
|
|
99
|
+
:class="`q-ml-xs ${rightIcon}`"
|
|
91
100
|
right
|
|
92
|
-
|
|
93
|
-
class="q-ml-xs"
|
|
94
|
-
size="1.25rem"
|
|
101
|
+
size="1rem"
|
|
95
102
|
/>
|
|
96
103
|
</div>
|
|
97
104
|
</slot>
|
|
105
|
+
|
|
106
|
+
<slot name="tooltip" />
|
|
107
|
+
<slot name="menu" />
|
|
98
108
|
</template>
|
|
99
109
|
</q-btn>
|
|
100
110
|
</template>
|
|
@@ -105,7 +115,7 @@ const isFullWidth = computed(() => {
|
|
|
105
115
|
min-width: 5.5rem !important
|
|
106
116
|
|
|
107
117
|
&.bg-neutral
|
|
108
|
-
background-color: $neutral-
|
|
118
|
+
background-color: $neutral-6
|
|
109
119
|
|
|
110
120
|
&.size-sm
|
|
111
121
|
min-height: $md
|
|
@@ -115,12 +125,10 @@ const isFullWidth = computed(() => {
|
|
|
115
125
|
min-height: $lg
|
|
116
126
|
padding: 0 $ba !important
|
|
117
127
|
|
|
118
|
-
|
|
119
128
|
&.size-lg
|
|
120
129
|
min-height: $xl
|
|
121
130
|
padding: 0 $ba !important
|
|
122
131
|
|
|
123
|
-
|
|
124
132
|
.button-label
|
|
125
133
|
word-break: break-all
|
|
126
134
|
</style>
|