@usssa/component-library 1.0.0-alpha.200 → 1.0.0-alpha.202
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
CHANGED
package/package.json
CHANGED
|
@@ -64,6 +64,10 @@ const props = defineProps({
|
|
|
64
64
|
type: Boolean,
|
|
65
65
|
default: false,
|
|
66
66
|
},
|
|
67
|
+
toggleIconRotationClass: {
|
|
68
|
+
type: String,
|
|
69
|
+
default: 'rotate-180',
|
|
70
|
+
},
|
|
67
71
|
})
|
|
68
72
|
|
|
69
73
|
const isExpanded = ref(false)
|
|
@@ -123,7 +127,7 @@ const toggleExpansion = () => {
|
|
|
123
127
|
'icon-secondary-opacity',
|
|
124
128
|
'transition-all',
|
|
125
129
|
expansionIcon,
|
|
126
|
-
|
|
130
|
+
isExpanded ? toggleIconRotationClass : '',
|
|
127
131
|
]"
|
|
128
132
|
:aria-label="isExpanded ? collapsedAriaLabel : expandAriaLabel"
|
|
129
133
|
:color="expansionIconColor"
|
|
@@ -145,7 +149,7 @@ const toggleExpansion = () => {
|
|
|
145
149
|
'icon-secondary-opacity',
|
|
146
150
|
'transition-all',
|
|
147
151
|
expansionIcon,
|
|
148
|
-
|
|
152
|
+
isExpanded ? toggleIconRotationClass : '',
|
|
149
153
|
]"
|
|
150
154
|
:aria-label="isExpanded ? collapsedAriaLabel : expandAriaLabel"
|
|
151
155
|
:color="expansionIconColor"
|
|
@@ -197,7 +201,7 @@ const toggleExpansion = () => {
|
|
|
197
201
|
'icon-secondary-opacity',
|
|
198
202
|
'transition-all',
|
|
199
203
|
expansionIcon,
|
|
200
|
-
|
|
204
|
+
isExpanded ? toggleIconRotationClass : '',
|
|
201
205
|
]"
|
|
202
206
|
:color="expansionIconColor"
|
|
203
207
|
:size="expansionIconSize"
|
|
@@ -215,7 +219,7 @@ const toggleExpansion = () => {
|
|
|
215
219
|
'icon-secondary-opacity',
|
|
216
220
|
'transition-all',
|
|
217
221
|
expansionIcon,
|
|
218
|
-
|
|
222
|
+
isExpanded ? toggleIconRotationClass : '',
|
|
219
223
|
]"
|
|
220
224
|
:color="expansionIconColor"
|
|
221
225
|
:size="expansionIconSize"
|
|
@@ -260,6 +264,10 @@ const toggleExpansion = () => {
|
|
|
260
264
|
transform: rotate(180deg)
|
|
261
265
|
transition: 0.3s
|
|
262
266
|
|
|
267
|
+
.rotate-90
|
|
268
|
+
transform: rotate(90deg)
|
|
269
|
+
transition: 0.3s
|
|
270
|
+
|
|
263
271
|
.expansion-radio-wrapper
|
|
264
272
|
.q-radio__label
|
|
265
273
|
padding-left: 0px !important
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import UExpansionStd from './UExpansionStd.vue'
|
|
3
|
+
|
|
4
|
+
const filterOptions = defineModel('filterOptions', {
|
|
5
|
+
default: () => [],
|
|
6
|
+
type: Array,
|
|
7
|
+
})
|
|
8
|
+
const props = defineProps({
|
|
9
|
+
dataTestId: {
|
|
10
|
+
type: String,
|
|
11
|
+
default: 'u-expansion-filter',
|
|
12
|
+
},
|
|
13
|
+
header: {
|
|
14
|
+
type: String,
|
|
15
|
+
default: null,
|
|
16
|
+
},
|
|
17
|
+
subHeader: {
|
|
18
|
+
type: Boolean,
|
|
19
|
+
default: true,
|
|
20
|
+
},
|
|
21
|
+
})
|
|
22
|
+
</script>
|
|
23
|
+
|
|
24
|
+
<template>
|
|
25
|
+
<div
|
|
26
|
+
v-if="filterOptions.length"
|
|
27
|
+
class="u-expansion-filter q-pa-sm"
|
|
28
|
+
:dataTestId="dataTestId"
|
|
29
|
+
>
|
|
30
|
+
<div v-if="header" class="text-heading-sm text-dark q-pb-xs q-mb-xxs">
|
|
31
|
+
{{ header }}
|
|
32
|
+
</div>
|
|
33
|
+
<div
|
|
34
|
+
v-if="subHeader"
|
|
35
|
+
class="q-mb-xxs"
|
|
36
|
+
dataTestId="expansion-filter-sub-header"
|
|
37
|
+
>
|
|
38
|
+
<slot name="subHeader" />
|
|
39
|
+
</div>
|
|
40
|
+
<template v-for="filter in filterOptions" :key="filter.type">
|
|
41
|
+
<q-list v-if="filter.label" bordered>
|
|
42
|
+
<UExpansionStd
|
|
43
|
+
v-model="filter.isExpanded"
|
|
44
|
+
class="expansion-filter-item-wrapper"
|
|
45
|
+
:disabled="filter.disabled"
|
|
46
|
+
expansion-icon="fa-kit fa-chevron-right rotate-0"
|
|
47
|
+
:id="`filter-expansion-item-${filter.type}`"
|
|
48
|
+
:label="filter.label"
|
|
49
|
+
:toggle-icon-left="true"
|
|
50
|
+
toggle-icon-rotation-class="rotate-90"
|
|
51
|
+
>
|
|
52
|
+
<template #body>
|
|
53
|
+
<div class="expansion-filter-body-wrapper">
|
|
54
|
+
<slot :name="`type${filter.type}`" />
|
|
55
|
+
</div>
|
|
56
|
+
</template>
|
|
57
|
+
</UExpansionStd>
|
|
58
|
+
</q-list>
|
|
59
|
+
</template>
|
|
60
|
+
</div>
|
|
61
|
+
</template>
|
|
62
|
+
|
|
63
|
+
<style lang="sass">
|
|
64
|
+
.u-expansion-filter
|
|
65
|
+
.q-list
|
|
66
|
+
margin-bottom: $xxs
|
|
67
|
+
|
|
68
|
+
border: 1px solid $neutral-4
|
|
69
|
+
border-radius: $sm
|
|
70
|
+
.q-list
|
|
71
|
+
border: none
|
|
72
|
+
|
|
73
|
+
.q-item.q-item-type
|
|
74
|
+
padding: $xs $xxs !important
|
|
75
|
+
display: flex
|
|
76
|
+
justify-content: start
|
|
77
|
+
align-items: center
|
|
78
|
+
min-height: $lg
|
|
79
|
+
|
|
80
|
+
.expansion-transition-icon
|
|
81
|
+
transition: all 0.2s ease-in-out 0.1s
|
|
82
|
+
|
|
83
|
+
.expansion-filter-item-wrapper
|
|
84
|
+
border: none !important
|
|
85
|
+
min-height: auto !important
|
|
86
|
+
|
|
87
|
+
.expansion-filter-body-wrapper
|
|
88
|
+
padding: $xs
|
|
89
|
+
</style>
|
|
@@ -34,6 +34,7 @@ const props = defineProps({
|
|
|
34
34
|
<template v-for="(item, index) in data" :key="index">
|
|
35
35
|
<UMenuItem
|
|
36
36
|
:iconClass="iconClass"
|
|
37
|
+
:avatarImage="item.avatarImage"
|
|
37
38
|
:destructive="item.destructive"
|
|
38
39
|
:disable="item.disable"
|
|
39
40
|
:hide="item.hide"
|
|
@@ -42,6 +43,7 @@ const props = defineProps({
|
|
|
42
43
|
:leftIcon="item.leftIcon"
|
|
43
44
|
:positive="item.positive"
|
|
44
45
|
:rightIcon="item.rightIcon"
|
|
46
|
+
:typeIcon="item.typeIcon"
|
|
45
47
|
@onClick="item.handler"
|
|
46
48
|
>
|
|
47
49
|
<template #leading_slot>
|
|
@@ -1,8 +1,20 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { computed } from 'vue'
|
|
3
|
+
import UAvatar from './UAvatar.vue'
|
|
3
4
|
|
|
4
5
|
const emit = defineEmits(['onClick'])
|
|
5
6
|
const props = defineProps({
|
|
7
|
+
// Avatar props
|
|
8
|
+
avatarImage: { type: String },
|
|
9
|
+
avatarIndicatorColor: {
|
|
10
|
+
type: [Function, String, Object],
|
|
11
|
+
default: 'neutral-4',
|
|
12
|
+
},
|
|
13
|
+
avatarIndicatorIcon: { type: [Function, String, Object], default: '' },
|
|
14
|
+
avatarName: { type: String },
|
|
15
|
+
avatarRound: { type: Boolean, default: true },
|
|
16
|
+
avatarShowIndicator: { type: Boolean, default: false },
|
|
17
|
+
avatarSize: { type: String, default: 'sm' },
|
|
6
18
|
caption: {
|
|
7
19
|
type: String,
|
|
8
20
|
default: '',
|
|
@@ -50,8 +62,22 @@ const props = defineProps({
|
|
|
50
62
|
type: Boolean,
|
|
51
63
|
default: false,
|
|
52
64
|
},
|
|
65
|
+
typeIcon: {
|
|
66
|
+
type: String,
|
|
67
|
+
default: 'icon',
|
|
68
|
+
},
|
|
53
69
|
})
|
|
54
70
|
|
|
71
|
+
const avatarProps = computed(() => ({
|
|
72
|
+
image: props.avatarImage,
|
|
73
|
+
indicatorColor: props.avatarIndicatorColor,
|
|
74
|
+
indicatorIcon: props.avatarIndicatorIcon,
|
|
75
|
+
name: props.avatarName,
|
|
76
|
+
round: props.avatarRound,
|
|
77
|
+
showIndicator: props.avatarShowIndicator,
|
|
78
|
+
size: props.avatarSize,
|
|
79
|
+
}))
|
|
80
|
+
|
|
55
81
|
/* Computed variables */
|
|
56
82
|
const backgroundColor = computed(() => {
|
|
57
83
|
if (props.selected && !props.destructive && !props.positive) {
|
|
@@ -89,6 +115,8 @@ const labelStyle = computed(() => {
|
|
|
89
115
|
return 'text-body-sm'
|
|
90
116
|
})
|
|
91
117
|
|
|
118
|
+
const showAvatar = computed(() => props.typeIcon === 'avatar')
|
|
119
|
+
|
|
92
120
|
const type = computed(() => {
|
|
93
121
|
if (props.destructive) {
|
|
94
122
|
return 'destructive'
|
|
@@ -115,7 +143,8 @@ const handleClick = () => {
|
|
|
115
143
|
:tabindex="inSheet ? '-1' : '0'"
|
|
116
144
|
@click="handleClick"
|
|
117
145
|
>
|
|
118
|
-
|
|
146
|
+
<!-- Left Icon -->
|
|
147
|
+
<q-item-section v-if="typeIcon === 'icon' && leftIcon" side>
|
|
119
148
|
<q-icon
|
|
120
149
|
:class="`${leftIcon} ${iconClass}`"
|
|
121
150
|
:aria-hidden="true"
|
|
@@ -123,6 +152,13 @@ const handleClick = () => {
|
|
|
123
152
|
size="1rem"
|
|
124
153
|
/>
|
|
125
154
|
</q-item-section>
|
|
155
|
+
|
|
156
|
+
<!-- Avatar -->
|
|
157
|
+
<q-item-section v-if="showAvatar" side>
|
|
158
|
+
<slot name="avatar">
|
|
159
|
+
<UAvatar v-bind="avatarProps" :name="props.avatarName || ''" />
|
|
160
|
+
</slot>
|
|
161
|
+
</q-item-section>
|
|
126
162
|
<slot name="leading_slot"></slot>
|
|
127
163
|
<q-item-section
|
|
128
164
|
v-if="showCaption"
|
|
@@ -130,7 +166,9 @@ const handleClick = () => {
|
|
|
130
166
|
:tabindex="!inSheet ? '-1' : '0'"
|
|
131
167
|
>
|
|
132
168
|
<q-item-label>{{ label }}</q-item-label>
|
|
133
|
-
<q-item-label class="text-body-xs text-description">
|
|
169
|
+
<q-item-label class="text-body-xs text-description">
|
|
170
|
+
{{ caption }}
|
|
171
|
+
</q-item-label>
|
|
134
172
|
</q-item-section>
|
|
135
173
|
<q-item-section
|
|
136
174
|
v-else
|
package/src/components/index.js
CHANGED
|
@@ -13,6 +13,7 @@ import UDate from './core/UDate.vue'
|
|
|
13
13
|
import UDialogStd from './core/UDialogStd.vue'
|
|
14
14
|
import UDrawer from './core/UDrawer/UDrawer.vue'
|
|
15
15
|
import UExpansionStd from './core/UExpansionStd.vue'
|
|
16
|
+
import UFilter from './core/UFilter.vue'
|
|
16
17
|
import UInnerLoader from './core/UInnerLoader.vue'
|
|
17
18
|
import UInputAddressLookup from './core/UInputAddressLookup.vue'
|
|
18
19
|
import UInputPhoneStd from './core/UInputPhoneStd.vue'
|
|
@@ -59,6 +60,7 @@ export {
|
|
|
59
60
|
UDialogStd,
|
|
60
61
|
UDrawer,
|
|
61
62
|
UExpansionStd,
|
|
63
|
+
UFilter,
|
|
62
64
|
UInnerLoader,
|
|
63
65
|
UInputAddressLookup,
|
|
64
66
|
UInputPhoneStd,
|