@usssa/component-library 1.0.0-alpha.21 → 1.0.0-alpha.211
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 +25 -6
- 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/UBreadCrumbs.vue +171 -0
- package/src/components/core/UBtnIcon.vue +57 -52
- 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 +91 -43
- package/src/components/core/UDate.vue +581 -0
- package/src/components/core/UDialogStd.vue +452 -58
- package/src/components/core/UDrawer/UDrawer.vue +471 -0
- package/src/components/core/UDrawer/UDrawerMenuItem.vue +124 -0
- package/src/components/core/UEventCard.vue +419 -0
- package/src/components/core/UExpansionStd.vue +274 -0
- package/src/components/core/UExpansionTableStd.vue +297 -0
- package/src/components/core/UFilter.vue +89 -0
- package/src/components/core/UGameObject.vue +441 -0
- package/src/components/core/UInnerLoader.vue +69 -0
- package/src/components/core/UInputAddressLookup.vue +484 -0
- package/src/components/core/UInputPhoneStd.vue +74 -68
- package/src/components/core/UInputTextStd.vue +137 -116
- package/src/components/core/UInputTypeahead.vue +44 -0
- package/src/components/core/UInputTypeaheadAdvanceSearch.vue +134 -0
- package/src/components/core/UMenuButtonStd.vue +280 -0
- package/src/components/core/UMenuDropdown.vue +82 -0
- package/src/components/core/UMenuDropdownAdvancedSearch.vue +306 -0
- package/src/components/core/UMenuItem.vue +221 -0
- package/src/components/core/UMenuSearch.vue +73 -0
- package/src/components/core/UModal.vue +660 -0
- package/src/components/core/UMultiSelectStd.vue +501 -61
- package/src/components/core/UPagination.vue +84 -25
- package/src/components/core/URadioBtn.vue +66 -43
- package/src/components/core/URadioStd.vue +23 -14
- package/src/components/core/USelectStd.vue +415 -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 +211 -0
- package/src/components/core/UTabBtnStd.vue +36 -22
- package/src/components/core/UTable/UTable.vue +2061 -57
- package/src/components/core/UTableStd.vue +1311 -273
- package/src/components/core/UTabsStd.vue +52 -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 +31 -10
- package/src/components/core/UTypeahead.vue +890 -0
- package/src/components/core/UUploader.vue +644 -0
- package/src/components/index.js +77 -26
- 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 +42 -25
- package/src/css/colors.sass +2 -0
- package/src/css/quasar.variables.sass +99 -68
- package/src/css/vars/colors.variables.sass +28 -41
- package/src/utils/data.ts +177 -0
- package/src/App.vue +0 -9
- package/src/boot/.gitkeep +0 -0
- package/src/layouts/MainLayout.vue +0 -137
- 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 -92
- 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 -139
- 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 -371
- 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 -113
|
@@ -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
|
|
|
@@ -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
|
|
|
@@ -1,32 +1,50 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { computed } from 'vue'
|
|
3
|
+
import UTooltip from './UTooltip.vue'
|
|
4
|
+
import { isQuasarColor } from '../../utils/data'
|
|
3
5
|
|
|
6
|
+
const emit = defineEmits(['update:modelValue', 'onClick'])
|
|
4
7
|
const props = defineProps({
|
|
8
|
+
anchor: {
|
|
9
|
+
type: String,
|
|
10
|
+
default: 'bottom middle',
|
|
11
|
+
},
|
|
12
|
+
avatarLabel: {
|
|
13
|
+
type: String,
|
|
14
|
+
default: '',
|
|
15
|
+
},
|
|
16
|
+
backgroundColor: {
|
|
17
|
+
type: String,
|
|
18
|
+
},
|
|
5
19
|
chipLabel: {
|
|
6
20
|
type: String,
|
|
7
21
|
default: 'Chip',
|
|
8
22
|
},
|
|
9
|
-
|
|
10
|
-
type:
|
|
11
|
-
default:
|
|
23
|
+
dataTestId: {
|
|
24
|
+
type: String,
|
|
25
|
+
default: 'u-chip',
|
|
12
26
|
},
|
|
13
|
-
|
|
27
|
+
dense: {
|
|
14
28
|
type: Boolean,
|
|
15
29
|
default: false,
|
|
16
30
|
},
|
|
17
|
-
avatarLabel: {
|
|
18
|
-
type: String,
|
|
19
|
-
default: '',
|
|
20
|
-
},
|
|
21
31
|
icon: {
|
|
22
32
|
type: String,
|
|
23
33
|
},
|
|
24
34
|
iconClass: {
|
|
25
35
|
type: String,
|
|
26
36
|
},
|
|
27
|
-
|
|
28
|
-
type:
|
|
29
|
-
default:
|
|
37
|
+
isShowTooltip: {
|
|
38
|
+
type: Boolean,
|
|
39
|
+
default: false,
|
|
40
|
+
},
|
|
41
|
+
modelValue: {
|
|
42
|
+
type: Boolean,
|
|
43
|
+
default: false,
|
|
44
|
+
},
|
|
45
|
+
offset: {
|
|
46
|
+
default: () => [14, 14],
|
|
47
|
+
type: Array,
|
|
30
48
|
},
|
|
31
49
|
removable: {
|
|
32
50
|
type: Boolean,
|
|
@@ -35,13 +53,22 @@ const props = defineProps({
|
|
|
35
53
|
remove: {
|
|
36
54
|
type: Function,
|
|
37
55
|
},
|
|
56
|
+
textColor: {
|
|
57
|
+
type: String,
|
|
58
|
+
},
|
|
59
|
+
type: {
|
|
60
|
+
type: String,
|
|
61
|
+
default: 'neutral',
|
|
62
|
+
},
|
|
38
63
|
})
|
|
39
64
|
|
|
40
|
-
const
|
|
65
|
+
const avatarLabel = computed(() => {
|
|
66
|
+
if (props.avatarLabel && props.avatarLabel.length > 2) {
|
|
67
|
+
return props.avatarLabel.substring(0, 2)
|
|
68
|
+
}
|
|
69
|
+
return props.avatarLabel
|
|
70
|
+
})
|
|
41
71
|
|
|
42
|
-
const handleClick = () => {
|
|
43
|
-
return emit('onClick')
|
|
44
|
-
}
|
|
45
72
|
const size = computed(() => {
|
|
46
73
|
if (props.dense) {
|
|
47
74
|
return 'xs'
|
|
@@ -49,26 +76,32 @@ const size = computed(() => {
|
|
|
49
76
|
return 'sm'
|
|
50
77
|
})
|
|
51
78
|
|
|
52
|
-
const
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}
|
|
56
|
-
return props.avatarLabel
|
|
57
|
-
})
|
|
79
|
+
const handleClick = () => {
|
|
80
|
+
return emit('onClick')
|
|
81
|
+
}
|
|
58
82
|
</script>
|
|
59
83
|
|
|
60
84
|
<template>
|
|
61
85
|
<q-chip
|
|
86
|
+
v-bind="$attrs"
|
|
62
87
|
v-if="chipLabel"
|
|
63
88
|
class="u-chip q-px-xs"
|
|
64
|
-
|
|
65
|
-
:
|
|
66
|
-
:
|
|
89
|
+
:class="isQuasarColor(textColor) ? '' : type"
|
|
90
|
+
:color="isQuasarColor(backgroundColor) ? backgroundColor : undefined"
|
|
91
|
+
:aria-label="chipLabel"
|
|
92
|
+
:dataTestId="dataTestId"
|
|
67
93
|
:dense="dense"
|
|
68
|
-
|
|
94
|
+
:modelValue="modelValue"
|
|
69
95
|
:removable="removable"
|
|
70
|
-
:
|
|
96
|
+
:style="{
|
|
97
|
+
...(isQuasarColor(textColor) ? {} : { color: textColor }),
|
|
98
|
+
...(isQuasarColor(backgroundColor)
|
|
99
|
+
? {}
|
|
100
|
+
: { backgroundColor: backgroundColor }),
|
|
101
|
+
}"
|
|
102
|
+
:text-color="isQuasarColor(textColor) ? textColor : undefined"
|
|
71
103
|
@click="handleClick"
|
|
104
|
+
@remove="remove"
|
|
72
105
|
>
|
|
73
106
|
<q-avatar v-if="avatarLabel" class="u-avatar">
|
|
74
107
|
<span class="text-caption-xs">{{ avatarLabel }}</span>
|
|
@@ -79,6 +112,12 @@ const avatarLabel = computed(() => {
|
|
|
79
112
|
<span :class="`chip-label text-overline-${size} text-uppercase`">
|
|
80
113
|
{{ chipLabel }}
|
|
81
114
|
</span>
|
|
115
|
+
<UTooltip
|
|
116
|
+
v-if="isShowTooltip"
|
|
117
|
+
:anchor="anchor"
|
|
118
|
+
:description="chipLabel"
|
|
119
|
+
:offset="offset"
|
|
120
|
+
/>
|
|
82
121
|
</q-chip>
|
|
83
122
|
</template>
|
|
84
123
|
|
|
@@ -87,13 +126,17 @@ const avatarLabel = computed(() => {
|
|
|
87
126
|
padding: $xs
|
|
88
127
|
border-radius: 20px
|
|
89
128
|
height: $lg
|
|
129
|
+
margin-left: 0px !important
|
|
130
|
+
|
|
131
|
+
&.q-chip--dense
|
|
132
|
+
.chip-label
|
|
133
|
+
line-height: 2 !important
|
|
90
134
|
|
|
91
135
|
.u-avatar
|
|
92
136
|
width: $ms
|
|
93
137
|
height: $ms
|
|
94
138
|
margin-left:0 !important
|
|
95
139
|
|
|
96
|
-
|
|
97
140
|
.q-icon
|
|
98
141
|
width: $ba
|
|
99
142
|
height: $ba
|
|
@@ -106,7 +149,6 @@ const avatarLabel = computed(() => {
|
|
|
106
149
|
padding: $xs 0 $xs $xs
|
|
107
150
|
margin:0
|
|
108
151
|
|
|
109
|
-
|
|
110
152
|
&.neutral
|
|
111
153
|
background-color: $neutral-3
|
|
112
154
|
color: $neutral-9
|
|
@@ -128,24 +170,24 @@ const avatarLabel = computed(() => {
|
|
|
128
170
|
color: $primary !important
|
|
129
171
|
|
|
130
172
|
&.positive
|
|
131
|
-
background-color: $green-
|
|
132
|
-
color: $
|
|
173
|
+
background-color: $green-1
|
|
174
|
+
color: $positive
|
|
133
175
|
.q-avatar
|
|
134
|
-
background-color: $
|
|
135
|
-
color: $green-
|
|
176
|
+
background-color: $positive !important
|
|
177
|
+
color: $green-1 !important
|
|
136
178
|
|
|
137
179
|
.q-icon
|
|
138
|
-
color: $
|
|
180
|
+
color: $positive !important
|
|
139
181
|
|
|
140
182
|
&.accent
|
|
141
|
-
background-color: $red-
|
|
142
|
-
color: $
|
|
183
|
+
background-color: $red-1
|
|
184
|
+
color: $accent
|
|
143
185
|
.q-avatar
|
|
144
|
-
background-color: $
|
|
145
|
-
color: $red-
|
|
186
|
+
background-color: $accent !important
|
|
187
|
+
color: $red-1 !important
|
|
146
188
|
|
|
147
189
|
.q-icon
|
|
148
|
-
color: $
|
|
190
|
+
color: $accent !important
|
|
149
191
|
|
|
150
192
|
&.info
|
|
151
193
|
background-color: $purple-2
|
|
@@ -158,14 +200,14 @@ const avatarLabel = computed(() => {
|
|
|
158
200
|
color: $purple-7 !important
|
|
159
201
|
|
|
160
202
|
&.warning
|
|
161
|
-
background-color: $orange-
|
|
162
|
-
color: $
|
|
203
|
+
background-color: $orange-1
|
|
204
|
+
color: $warning
|
|
163
205
|
.q-avatar
|
|
164
|
-
background-color: $
|
|
165
|
-
color: $orange-
|
|
206
|
+
background-color: $warning !important
|
|
207
|
+
color: $orange-1 !important
|
|
166
208
|
|
|
167
209
|
.q-icon
|
|
168
|
-
color: $
|
|
210
|
+
color: $warning !important
|
|
169
211
|
&.yellow
|
|
170
212
|
background-color: $yellow-1
|
|
171
213
|
color: $yellow-9
|
|
@@ -223,4 +265,10 @@ const avatarLabel = computed(() => {
|
|
|
223
265
|
|
|
224
266
|
.q-chip__icon--remove
|
|
225
267
|
padding: $xxs
|
|
268
|
+
|
|
269
|
+
.chip-label
|
|
270
|
+
max-width: 12.5rem
|
|
271
|
+
white-space: normal
|
|
272
|
+
overflow-wrap: break-word
|
|
273
|
+
line-height: 1.5 !important // over-ridding this in long chip label case
|
|
226
274
|
</style>
|