@usssa/component-library 1.0.0-alpha.13 → 1.0.0-alpha.130
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/files.png +0 -0
- package/src/assets/logo.svg +19 -0
- package/src/assets/no-result.png +0 -0
- package/src/assets/quasar-logo-vertical.svg +15 -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 -33
- package/src/components/core/UBreadCrumbs.vue +93 -0
- package/src/components/core/UBtnIcon.vue +60 -48
- package/src/components/core/UBtnStd.vue +54 -42
- package/src/components/core/UBtnToggle.vue +11 -6
- package/src/components/core/UCheckboxStd.vue +26 -20
- package/src/components/core/UChip.vue +56 -27
- package/src/components/core/UDate.vue +425 -0
- package/src/components/core/UDialogStd.vue +87 -40
- package/src/components/core/UDrawer.vue +240 -0
- package/src/components/core/UInnerLoader.vue +67 -0
- package/src/components/core/UInputAddressLookup.vue +471 -0
- package/src/components/core/UInputPhoneStd.vue +73 -68
- package/src/components/core/UInputTextStd.vue +132 -108
- package/src/components/core/UInputTypeaheadAdvanceSearch.vue +64 -0
- package/src/components/core/UMenuButtonStd.vue +280 -0
- package/src/components/core/UMenuDropdown.vue +80 -0
- package/src/components/core/UMenuDropdownAdvancedSearch.vue +288 -0
- package/src/components/core/UMenuItem.vue +150 -0
- package/src/components/core/UMenuSearch.vue +831 -0
- package/src/components/core/UMultiSelectStd.vue +73 -57
- package/src/components/core/UPagination.vue +46 -24
- package/src/components/core/URadioBtn.vue +32 -22
- package/src/components/core/URadioStd.vue +19 -12
- package/src/components/core/USelectStd.vue +125 -80
- package/src/components/core/USheet.vue +334 -0
- package/src/components/core/UTabBtnStd.vue +87 -59
- package/src/components/core/UTable/UTable.vue +75 -41
- package/src/components/core/UTableStd.vue +701 -281
- package/src/components/core/UTabsStd.vue +33 -16
- package/src/components/core/UToggleStd.vue +43 -29
- package/src/components/core/UToolbar/UCustomMenuIcon.vue +60 -0
- package/src/components/core/UToolbar/UToolbar.vue +206 -0
- package/src/components/core/UTooltip.vue +31 -10
- package/src/components/core/UUploader.vue +508 -0
- package/src/components/index.js +59 -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 +101 -0
- package/src/css/media.sass +1 -0
- package/src/css/quasar.variables.sass +121 -0
- package/src/css/typography.sass +0 -0
- package/src/css/vars/colors.variables.sass +127 -0
- package/src/utils/data.ts +146 -0
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed } from 'vue'
|
|
3
|
+
|
|
4
|
+
const props = defineProps({
|
|
5
|
+
activeColor: {
|
|
6
|
+
type: String,
|
|
7
|
+
default: 'primary',
|
|
8
|
+
},
|
|
9
|
+
align: {
|
|
10
|
+
type: String,
|
|
11
|
+
default: 'left',
|
|
12
|
+
},
|
|
13
|
+
clickable: {
|
|
14
|
+
type: Boolean,
|
|
15
|
+
default: true,
|
|
16
|
+
},
|
|
17
|
+
dataTestId: {
|
|
18
|
+
type: String,
|
|
19
|
+
default: 'breadcrumbs-std',
|
|
20
|
+
},
|
|
21
|
+
fontTypo: {
|
|
22
|
+
type: String,
|
|
23
|
+
default: 'text-body-lg',
|
|
24
|
+
},
|
|
25
|
+
links: {
|
|
26
|
+
type: Array,
|
|
27
|
+
default: () => [],
|
|
28
|
+
},
|
|
29
|
+
showActiveRoute: {
|
|
30
|
+
type: Boolean,
|
|
31
|
+
default: true,
|
|
32
|
+
},
|
|
33
|
+
})
|
|
34
|
+
|
|
35
|
+
const ariaLabelDisabled = computed(() => {
|
|
36
|
+
if (!props.clickable) {
|
|
37
|
+
return `disabled`
|
|
38
|
+
}
|
|
39
|
+
return ''
|
|
40
|
+
})
|
|
41
|
+
|
|
42
|
+
const onClick = (event) => {
|
|
43
|
+
if (!props.clickable) {
|
|
44
|
+
event.preventDefault()
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
</script>
|
|
48
|
+
<template>
|
|
49
|
+
<q-breadcrumbs
|
|
50
|
+
v-bind="$attrs"
|
|
51
|
+
class="u-breadcrumb"
|
|
52
|
+
:active-color="activeColor"
|
|
53
|
+
:align="align"
|
|
54
|
+
:dataTestId="dataTestId"
|
|
55
|
+
gutter="none"
|
|
56
|
+
>
|
|
57
|
+
<q-breadcrumbs-el
|
|
58
|
+
v-for="(link, index) of links"
|
|
59
|
+
:class="`breadcrumb-label ${fontTypo} ${
|
|
60
|
+
index === 0
|
|
61
|
+
? 'q-mr-xs'
|
|
62
|
+
: index === links.length - 1
|
|
63
|
+
? 'q-ml-xs'
|
|
64
|
+
: 'q-mx-xs'
|
|
65
|
+
} ${!showActiveRoute ? 'hide-active-route' : null} ${
|
|
66
|
+
!clickable ? 'non-clickable-route' : null
|
|
67
|
+
}`"
|
|
68
|
+
:aria-label="`${ariaLabelDisabled} ${link.label}`"
|
|
69
|
+
:key="index"
|
|
70
|
+
:label="link.label"
|
|
71
|
+
:to="link.to"
|
|
72
|
+
@click="onClick"
|
|
73
|
+
/>
|
|
74
|
+
</q-breadcrumbs>
|
|
75
|
+
</template>
|
|
76
|
+
<style lang="sass">
|
|
77
|
+
.u-breadcrumb
|
|
78
|
+
.q-breadcrumbs__separator
|
|
79
|
+
font-size: 1rem
|
|
80
|
+
font-weight: 500
|
|
81
|
+
line-height: 1.25rem
|
|
82
|
+
letter-spacing: 0.03333rem
|
|
83
|
+
|
|
84
|
+
.q-router-link--active
|
|
85
|
+
cursor: default
|
|
86
|
+
|
|
87
|
+
.hide-active-route
|
|
88
|
+
color: $dark !important
|
|
89
|
+
|
|
90
|
+
.non-clickable-route
|
|
91
|
+
cursor: default !important
|
|
92
|
+
pointer-events: none
|
|
93
|
+
</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,22 +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
53
|
})
|
|
44
54
|
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
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
|
+
})
|
|
51
67
|
const iconSize = computed(() => {
|
|
52
68
|
if (props.size === 'sm') {
|
|
53
69
|
return 'xs'
|
|
@@ -58,47 +74,40 @@ const iconSize = computed(() => {
|
|
|
58
74
|
if (props.size === 'lg') {
|
|
59
75
|
return 'md'
|
|
60
76
|
}
|
|
61
|
-
|
|
62
77
|
return props.size
|
|
63
78
|
})
|
|
64
|
-
const iconColor = computed(() => {
|
|
65
|
-
if (props.color === 'neutral') {
|
|
66
|
-
return 'neutral-9'
|
|
67
|
-
}
|
|
68
|
-
return props.color
|
|
69
|
-
})
|
|
70
79
|
|
|
71
|
-
const
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
}
|
|
75
|
-
return props.color
|
|
76
|
-
})
|
|
80
|
+
const handleClick = () => {
|
|
81
|
+
return emit('onClick')
|
|
82
|
+
}
|
|
77
83
|
</script>
|
|
78
84
|
|
|
79
85
|
<template>
|
|
80
86
|
<q-btn
|
|
81
|
-
|
|
87
|
+
:class="`u-btn-icon size-${size} ${btnClass}`"
|
|
88
|
+
:aria-label="ariaLabel"
|
|
89
|
+
:dataTestId="dataTestId"
|
|
82
90
|
flat="flat"
|
|
83
91
|
:round="round"
|
|
84
|
-
|
|
85
|
-
class="u-btn-icon"
|
|
86
|
-
:class="`size-${size} ${btnClass}`"
|
|
92
|
+
@click="handleClick"
|
|
87
93
|
>
|
|
88
|
-
<
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
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>
|
|
102
111
|
</q-btn>
|
|
103
112
|
</template>
|
|
104
113
|
|
|
@@ -140,6 +149,9 @@ const btnClass = computed(() => {
|
|
|
140
149
|
&.neutral-9
|
|
141
150
|
color: $neutral-9
|
|
142
151
|
|
|
152
|
+
&.accent:hover
|
|
153
|
+
background: $accent-bg-hover
|
|
154
|
+
|
|
143
155
|
.icon-tooltip
|
|
144
156
|
background: $dark
|
|
145
157
|
border-radius: $xxs
|
|
@@ -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,29 +31,31 @@ 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
|
-
|
|
46
|
-
|
|
53
|
+
const isFullWidth = computed(() => {
|
|
54
|
+
if (props.fullWidth === true) {
|
|
55
|
+
return 'full-width'
|
|
56
|
+
}
|
|
57
|
+
return ''
|
|
58
|
+
})
|
|
47
59
|
|
|
48
60
|
const textClass = computed(() => {
|
|
49
61
|
if (props.color === 'neutral') {
|
|
@@ -52,46 +64,48 @@ const textClass = computed(() => {
|
|
|
52
64
|
return ''
|
|
53
65
|
})
|
|
54
66
|
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}
|
|
59
|
-
return ''
|
|
60
|
-
})
|
|
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
|
-
<
|
|
76
|
-
<
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
84
|
+
<template #default>
|
|
85
|
+
<slot name="default">
|
|
86
|
+
<div class="row items-center no-wrap">
|
|
87
|
+
<q-icon
|
|
88
|
+
v-if="leftIcon"
|
|
89
|
+
:class="`q-mr-xs ${leftIcon}`"
|
|
90
|
+
left
|
|
91
|
+
:size="leftIconSize"
|
|
92
|
+
/>
|
|
93
|
+
|
|
94
|
+
<div class="text-center text-caption-md button-label">
|
|
95
|
+
{{ label }}
|
|
96
|
+
</div>
|
|
97
|
+
<q-icon
|
|
98
|
+
v-if="rightIcon"
|
|
99
|
+
:class="`q-ml-xs ${rightIcon}`"
|
|
100
|
+
right
|
|
101
|
+
size="1rem"
|
|
102
|
+
/>
|
|
103
|
+
</div>
|
|
104
|
+
</slot>
|
|
83
105
|
|
|
84
|
-
<
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
<q-icon
|
|
88
|
-
v-if="rightIcon"
|
|
89
|
-
right
|
|
90
|
-
:class="rightIcon"
|
|
91
|
-
class="q-ml-xs"
|
|
92
|
-
size="1.25rem"
|
|
93
|
-
/>
|
|
94
|
-
</div>
|
|
106
|
+
<slot name="tooltip" />
|
|
107
|
+
<slot name="menu" />
|
|
108
|
+
</template>
|
|
95
109
|
</q-btn>
|
|
96
110
|
</template>
|
|
97
111
|
|
|
@@ -111,12 +125,10 @@ const isFullWidth = computed(() => {
|
|
|
111
125
|
min-height: $lg
|
|
112
126
|
padding: 0 $ba !important
|
|
113
127
|
|
|
114
|
-
|
|
115
128
|
&.size-lg
|
|
116
129
|
min-height: $xl
|
|
117
130
|
padding: 0 $ba !important
|
|
118
131
|
|
|
119
|
-
|
|
120
132
|
.button-label
|
|
121
133
|
word-break: break-all
|
|
122
134
|
</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,46 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { computed } from 'vue'
|
|
3
|
+
import UTooltip from './UTooltip.vue'
|
|
3
4
|
|
|
5
|
+
const emit = defineEmits(['update:modelValue', 'onClick'])
|
|
4
6
|
const props = defineProps({
|
|
7
|
+
anchor: {
|
|
8
|
+
type: String,
|
|
9
|
+
default: 'bottom middle',
|
|
10
|
+
},
|
|
11
|
+
avatarLabel: {
|
|
12
|
+
type: String,
|
|
13
|
+
default: '',
|
|
14
|
+
},
|
|
5
15
|
chipLabel: {
|
|
6
16
|
type: String,
|
|
7
17
|
default: 'Chip',
|
|
8
18
|
},
|
|
9
|
-
|
|
10
|
-
type:
|
|
11
|
-
default:
|
|
19
|
+
dataTestId: {
|
|
20
|
+
type: String,
|
|
21
|
+
default: 'u-chip'
|
|
12
22
|
},
|
|
13
|
-
|
|
23
|
+
dense: {
|
|
14
24
|
type: Boolean,
|
|
15
25
|
default: false,
|
|
16
26
|
},
|
|
17
|
-
avatarLabel: {
|
|
18
|
-
type: String,
|
|
19
|
-
default: '',
|
|
20
|
-
},
|
|
21
27
|
icon: {
|
|
22
28
|
type: String,
|
|
23
29
|
},
|
|
24
30
|
iconClass: {
|
|
25
31
|
type: String,
|
|
26
32
|
},
|
|
27
|
-
|
|
28
|
-
type:
|
|
29
|
-
default:
|
|
33
|
+
isShowTooltip: {
|
|
34
|
+
type: Boolean,
|
|
35
|
+
default: false,
|
|
36
|
+
},
|
|
37
|
+
modelValue: {
|
|
38
|
+
type: Boolean,
|
|
39
|
+
default: false,
|
|
40
|
+
},
|
|
41
|
+
offset: {
|
|
42
|
+
default: () => [14, 14],
|
|
43
|
+
type: Array,
|
|
30
44
|
},
|
|
31
45
|
removable: {
|
|
32
46
|
type: Boolean,
|
|
@@ -35,13 +49,19 @@ const props = defineProps({
|
|
|
35
49
|
remove: {
|
|
36
50
|
type: Function,
|
|
37
51
|
},
|
|
52
|
+
type: {
|
|
53
|
+
type: String,
|
|
54
|
+
default: 'neutral',
|
|
55
|
+
},
|
|
38
56
|
})
|
|
39
57
|
|
|
40
|
-
const
|
|
58
|
+
const avatarLabel = computed(() => {
|
|
59
|
+
if (props.avatarLabel && props.avatarLabel.length > 2) {
|
|
60
|
+
return props.avatarLabel.substring(0, 2)
|
|
61
|
+
}
|
|
62
|
+
return props.avatarLabel
|
|
63
|
+
})
|
|
41
64
|
|
|
42
|
-
const handleClick = () => {
|
|
43
|
-
return emit('onClick')
|
|
44
|
-
}
|
|
45
65
|
const size = computed(() => {
|
|
46
66
|
if (props.dense) {
|
|
47
67
|
return 'xs'
|
|
@@ -49,26 +69,24 @@ const size = computed(() => {
|
|
|
49
69
|
return 'sm'
|
|
50
70
|
})
|
|
51
71
|
|
|
52
|
-
const
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}
|
|
56
|
-
return props.avatarLabel
|
|
57
|
-
})
|
|
72
|
+
const handleClick = () => {
|
|
73
|
+
return emit('onClick')
|
|
74
|
+
}
|
|
58
75
|
</script>
|
|
59
76
|
|
|
60
77
|
<template>
|
|
61
78
|
<q-chip
|
|
79
|
+
v-bind="$attrs"
|
|
62
80
|
v-if="chipLabel"
|
|
63
81
|
class="u-chip q-px-xs"
|
|
64
|
-
v-bind="$attrs"
|
|
65
82
|
:class="type"
|
|
66
|
-
:
|
|
83
|
+
:aria-label="chipLabel"
|
|
84
|
+
:dataTestId="dataTestId"
|
|
67
85
|
:dense="dense"
|
|
68
|
-
|
|
86
|
+
:modelValue="modelValue"
|
|
69
87
|
:removable="removable"
|
|
70
|
-
:aria-label="chipLabel"
|
|
71
88
|
@click="handleClick"
|
|
89
|
+
@remove="remove"
|
|
72
90
|
>
|
|
73
91
|
<q-avatar v-if="avatarLabel" class="u-avatar">
|
|
74
92
|
<span class="text-caption-xs">{{ avatarLabel }}</span>
|
|
@@ -79,6 +97,12 @@ const avatarLabel = computed(() => {
|
|
|
79
97
|
<span :class="`chip-label text-overline-${size} text-uppercase`">
|
|
80
98
|
{{ chipLabel }}
|
|
81
99
|
</span>
|
|
100
|
+
<UTooltip
|
|
101
|
+
v-if="isShowTooltip"
|
|
102
|
+
:anchor="anchor"
|
|
103
|
+
:description="chipLabel"
|
|
104
|
+
:offset="offset"
|
|
105
|
+
/>
|
|
82
106
|
</q-chip>
|
|
83
107
|
</template>
|
|
84
108
|
|
|
@@ -87,13 +111,13 @@ const avatarLabel = computed(() => {
|
|
|
87
111
|
padding: $xs
|
|
88
112
|
border-radius: 20px
|
|
89
113
|
height: $lg
|
|
114
|
+
margin-left: 0px !important
|
|
90
115
|
|
|
91
116
|
.u-avatar
|
|
92
117
|
width: $ms
|
|
93
118
|
height: $ms
|
|
94
119
|
margin-left:0 !important
|
|
95
120
|
|
|
96
|
-
|
|
97
121
|
.q-icon
|
|
98
122
|
width: $ba
|
|
99
123
|
height: $ba
|
|
@@ -106,7 +130,6 @@ const avatarLabel = computed(() => {
|
|
|
106
130
|
padding: $xs 0 $xs $xs
|
|
107
131
|
margin:0
|
|
108
132
|
|
|
109
|
-
|
|
110
133
|
&.neutral
|
|
111
134
|
background-color: $neutral-3
|
|
112
135
|
color: $neutral-9
|
|
@@ -223,4 +246,10 @@ const avatarLabel = computed(() => {
|
|
|
223
246
|
|
|
224
247
|
.q-chip__icon--remove
|
|
225
248
|
padding: $xxs
|
|
249
|
+
|
|
250
|
+
.chip-label
|
|
251
|
+
max-width: 12.5rem
|
|
252
|
+
white-space: normal
|
|
253
|
+
overflow-wrap: break-word
|
|
254
|
+
line-height: 1.2 !important // over-ridding this in long chip label case
|
|
226
255
|
</style>
|