@usssa/component-library 1.0.0-alpha.4 → 1.0.0-alpha.41
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 +4 -1
- package/package.json +6 -4
- package/src/App.vue +9 -0
- package/src/assets/quasar-logo-vertical.svg +15 -0
- package/src/boot/.gitkeep +0 -0
- package/src/boot/google-maps.js +11 -0
- package/src/components/ComponentLink.vue +26 -0
- package/src/components/core/UAvatar.vue +161 -0
- package/src/components/core/UAvatarGroup.vue +119 -0
- package/src/components/core/UBadgeStd.vue +91 -0
- package/src/components/core/UBannerStd.vue +115 -0
- package/src/components/core/UBreadCrumbs.vue +67 -0
- package/src/components/core/UBtnIcon.vue +159 -0
- package/src/components/core/UBtnStd.vue +129 -0
- package/src/components/core/UBtnToggle.vue +68 -0
- package/src/components/core/UCheckboxStd.vue +95 -0
- package/src/components/core/UChip.vue +251 -0
- package/src/components/core/UDialogStd.vue +242 -0
- package/src/components/core/UDrawer.vue +211 -0
- package/src/components/core/UInnerLoader.vue +58 -0
- package/src/components/core/UInputAddressLookup.vue +466 -0
- package/src/components/core/UInputPhoneStd.vue +295 -0
- package/src/components/core/UInputTextStd.vue +293 -0
- package/src/components/core/UMenuButtonStd.vue +274 -0
- package/src/components/core/UMenuDropdown.vue +77 -0
- package/src/components/core/UMenuDropdownAdvancedSearch.vue +262 -0
- package/src/components/core/UMenuItem.vue +132 -0
- package/src/components/core/UMultiSelectStd.vue +259 -0
- package/src/components/core/UPagination.vue +104 -0
- package/src/components/core/URadioBtn.vue +116 -0
- package/src/components/core/URadioStd.vue +62 -0
- package/src/components/core/USelectStd.vue +233 -0
- package/src/components/core/UTabBtnStd.vue +167 -0
- package/src/components/core/UTable/UTable.vue +93 -0
- package/src/components/core/UTable/UTd.vue +63 -0
- package/src/components/core/UTable/UTh.vue +48 -0
- package/src/components/core/UTable/UTr.vue +20 -0
- package/src/components/core/UTableStd.vue +636 -0
- package/src/components/core/UTabsStd.vue +111 -0
- package/src/components/core/UToggleStd.vue +159 -0
- package/src/components/core/UTooltip.vue +71 -0
- package/src/components/index.js +66 -0
- package/src/composables/useNotify.js +79 -0
- package/src/composables/useOverlayLoader.js +23 -0
- package/src/css/app.sass +159 -0
- package/src/css/colors.sass +101 -0
- package/src/css/media.sass +1 -0
- package/src/css/quasar.variables.sass +119 -0
- package/src/css/typography.sass +0 -0
- package/src/css/vars/colors.variables.sass +126 -0
- package/src/layouts/MainLayout.vue +173 -0
- package/src/pages/AdvancedSearch.vue +512 -0
- package/src/pages/Avatar.vue +77 -0
- package/src/pages/AvatarGroup.vue +139 -0
- package/src/pages/BadgeStd.vue +83 -0
- package/src/pages/BannerPage.vue +76 -0
- package/src/pages/BreadCrumbs.vue +100 -0
- package/src/pages/BtnIcon.vue +120 -0
- package/src/pages/BtnStd.vue +138 -0
- package/src/pages/BtnToggle.vue +131 -0
- package/src/pages/CheckBox.vue +62 -0
- package/src/pages/Chip.vue +108 -0
- package/src/pages/ComponentBase.vue +54 -0
- package/src/pages/Dialog.vue +221 -0
- package/src/pages/Drawer.vue +128 -0
- package/src/pages/ErrorNotFound.vue +11 -0
- package/src/pages/IndexPage.vue +11 -0
- package/src/pages/InnerLoader.vue +81 -0
- package/src/pages/InputAddressLookup.vue +258 -0
- package/src/pages/InputPhone.vue +152 -0
- package/src/pages/InputText.vue +140 -0
- package/src/pages/MenuButton.vue +194 -0
- package/src/pages/MenuDropdown.vue +79 -0
- package/src/pages/MenuItem.vue +68 -0
- package/src/pages/MultiSelectStd.vue +174 -0
- package/src/pages/NotifyPage.vue +109 -0
- package/src/pages/OverlayLoader.vue +128 -0
- package/src/pages/Pagination.vue +71 -0
- package/src/pages/Radio.vue +80 -0
- package/src/pages/RadioBtn.vue +104 -0
- package/src/pages/SelectStd.vue +160 -0
- package/src/pages/TabButtonPage.vue +126 -0
- package/src/pages/TablePage.vue +375 -0
- package/src/pages/TabsPage.vue +261 -0
- package/src/pages/TogglePage.vue +58 -0
- package/src/pages/TooltipPage.vue +125 -0
- package/src/router/index.js +34 -0
- package/src/router/routes.js +149 -0
- package/dist/spa/assets/Avatar.45667392.js +0 -9
- package/dist/spa/assets/AvatarGroup.99557443.js +0 -9
- package/dist/spa/assets/AvatarGroup.bb4cd03a.css +0 -1
- package/dist/spa/assets/BadgeStd.ee4129c5.js +0 -6
- package/dist/spa/assets/BannerPage.6c6a98c4.js +0 -10
- package/dist/spa/assets/BannerPage.d195fcac.css +0 -1
- package/dist/spa/assets/BtnIcon.89e50d2e.css +0 -1
- package/dist/spa/assets/BtnIcon.934f8c5b.js +0 -10
- package/dist/spa/assets/BtnStd.95fc4510.js +0 -11
- package/dist/spa/assets/CheckBox.3c204a4b.css +0 -1
- package/dist/spa/assets/CheckBox.fbc0bd1a.js +0 -7
- package/dist/spa/assets/Chip.49ffc857.js +0 -11
- package/dist/spa/assets/Chip.74acaa33.css +0 -1
- package/dist/spa/assets/ComponentBase.1ae19b7e.js +0 -1
- package/dist/spa/assets/ErrorNotFound.6cccfaee.js +0 -1
- package/dist/spa/assets/IndexPage.17d09b76.js +0 -1
- package/dist/spa/assets/InputText.19c0d7d1.css +0 -1
- package/dist/spa/assets/InputText.3fcd97a4.js +0 -20
- package/dist/spa/assets/KFOkCnqEu92Fr1MmgVxIIzQ.34e9582c.woff +0 -0
- package/dist/spa/assets/KFOlCnqEu92Fr1MmEU9fBBc-.9ce7f3ac.woff +0 -0
- package/dist/spa/assets/KFOlCnqEu92Fr1MmSU5fBBc-.bf14c7d7.woff +0 -0
- package/dist/spa/assets/KFOlCnqEu92Fr1MmWUlfBBc-.e0fd57c0.woff +0 -0
- package/dist/spa/assets/KFOlCnqEu92Fr1MmYUtfBBc-.f6537e32.woff +0 -0
- package/dist/spa/assets/KFOmCnqEu92Fr1Mu4mxM.f2abf7fb.woff +0 -0
- package/dist/spa/assets/MainLayout.912bb0f8.js +0 -1
- package/dist/spa/assets/MultiSelectStd.644b108c.js +0 -17
- package/dist/spa/assets/MultiSelectStd.c7af49eb.css +0 -1
- package/dist/spa/assets/QAvatar.5940a79e.js +0 -1
- package/dist/spa/assets/QCheckbox.48b43f7d.js +0 -1
- package/dist/spa/assets/QPage.ca395ec4.js +0 -1
- package/dist/spa/assets/QRadio.0a7f5e2c.js +0 -1
- package/dist/spa/assets/QResizeObserver.30c3566c.js +0 -1
- package/dist/spa/assets/QSelect.a40eb786.js +0 -1
- package/dist/spa/assets/QTabs.72f2507e.js +0 -1
- package/dist/spa/assets/QToggle.376c48be.js +0 -1
- package/dist/spa/assets/QTooltip.5aa8e325.js +0 -1
- package/dist/spa/assets/Radio.0ac35288.js +0 -7
- package/dist/spa/assets/Radio.aca54a89.css +0 -1
- package/dist/spa/assets/SelectStd.5c6891db.css +0 -1
- package/dist/spa/assets/SelectStd.daf1def9.js +0 -16
- package/dist/spa/assets/TabButtonPage.20e871dd.js +0 -7
- package/dist/spa/assets/TabButtonPage.36ce9f9c.css +0 -1
- package/dist/spa/assets/TabsPage.9b94ff39.css +0 -1
- package/dist/spa/assets/TabsPage.b92cccee.js +0 -9
- package/dist/spa/assets/TogglePage.8129b631.css +0 -1
- package/dist/spa/assets/TogglePage.ba6e325c.js +0 -9
- package/dist/spa/assets/UAvatar.dda7e478.js +0 -1
- package/dist/spa/assets/UAvatar.ea8daa38.css +0 -1
- package/dist/spa/assets/UBadgeStd.3965db9a.css +0 -1
- package/dist/spa/assets/UBadgeStd.e165ee05.js +0 -1
- package/dist/spa/assets/UBtnStd.979ec4e8.js +0 -1
- package/dist/spa/assets/UBtnStd.bdd4f5e5.css +0 -1
- package/dist/spa/assets/UTooltip.d2e04d0c.js +0 -1
- package/dist/spa/assets/UTooltip.efa029a7.css +0 -1
- package/dist/spa/assets/dom.e9d4ad51.js +0 -1
- package/dist/spa/assets/flUhRq6tzZclQEJ-Vdg-IuiaDsNa.fd84f88b.woff +0 -0
- package/dist/spa/assets/flUhRq6tzZclQEJ-Vdg-IuiaDsNcIhQ8tQ.4a4dbc62.woff2 +0 -0
- package/dist/spa/assets/format.41663636.js +0 -1
- package/dist/spa/assets/index.43c62a18.js +0 -21
- package/dist/spa/assets/index.4fbd73cf.css +0 -5
- package/dist/spa/assets/option-sizes.10cc02d3.js +0 -1
- package/dist/spa/assets/render.e67ff27a.js +0 -1
- package/dist/spa/assets/tooltip.7c0d0774.js +0 -8
- package/dist/spa/assets/touch.9135741d.js +0 -1
- package/dist/spa/assets/use-checkbox.44a623c0.js +0 -1
- package/dist/spa/favicon.ico +0 -0
- package/dist/spa/icons/caret-down.svg +0 -5
- package/dist/spa/icons/circle-xmark.svg +0 -6
- package/dist/spa/icons/favicon-128x128.png +0 -0
- package/dist/spa/icons/favicon-16x16.png +0 -0
- package/dist/spa/icons/favicon-32x32.png +0 -0
- package/dist/spa/icons/favicon-96x96.png +0 -0
- package/dist/spa/index.html +0 -3
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed, ref } from 'vue'
|
|
3
|
+
import UAvatar from './UAvatar.vue'
|
|
4
|
+
import UBtnStd from './UBtnStd.vue'
|
|
5
|
+
import UBtnIcon from './UBtnIcon.vue'
|
|
6
|
+
|
|
7
|
+
const props = defineProps({
|
|
8
|
+
color: {
|
|
9
|
+
type: String,
|
|
10
|
+
},
|
|
11
|
+
label: {
|
|
12
|
+
type: String
|
|
13
|
+
},
|
|
14
|
+
iconClass: {
|
|
15
|
+
type: String,
|
|
16
|
+
},
|
|
17
|
+
size: {
|
|
18
|
+
type: String,
|
|
19
|
+
default: 'md',
|
|
20
|
+
validator: (val) => ['sm', 'md', 'lg'].includes(val),
|
|
21
|
+
},
|
|
22
|
+
states: {
|
|
23
|
+
type: String,
|
|
24
|
+
default: 'Basic',
|
|
25
|
+
validator: (val) => ['Basic', 'Icon', 'Button', 'Avatar', 'Prefix'].includes(val),
|
|
26
|
+
},
|
|
27
|
+
selectedCountry: {
|
|
28
|
+
type: Object,
|
|
29
|
+
},
|
|
30
|
+
tooltip: {
|
|
31
|
+
type: String,
|
|
32
|
+
},
|
|
33
|
+
anchor: {
|
|
34
|
+
type: String,
|
|
35
|
+
},
|
|
36
|
+
self: {
|
|
37
|
+
type: String,
|
|
38
|
+
},
|
|
39
|
+
displayName: {
|
|
40
|
+
type: String,
|
|
41
|
+
},
|
|
42
|
+
avatarUrl: {
|
|
43
|
+
type: String,
|
|
44
|
+
},
|
|
45
|
+
ariaLabel: {
|
|
46
|
+
type: String,
|
|
47
|
+
},
|
|
48
|
+
menuOffset: {
|
|
49
|
+
type: Array,
|
|
50
|
+
default: () => [4, 4],
|
|
51
|
+
},
|
|
52
|
+
})
|
|
53
|
+
|
|
54
|
+
const emit = defineEmits(['update-country', 'onClick'])
|
|
55
|
+
|
|
56
|
+
const handleClick = () => {
|
|
57
|
+
return emit('onClick')
|
|
58
|
+
}
|
|
59
|
+
const selectCountry = (country) => {
|
|
60
|
+
emit('update-country', country)
|
|
61
|
+
}
|
|
62
|
+
const toLowerCase = (str) => str.toLowerCase()
|
|
63
|
+
</script>
|
|
64
|
+
|
|
65
|
+
<template>
|
|
66
|
+
|
|
67
|
+
<!-- 1. Menu button Basic state -->
|
|
68
|
+
<q-btn-dropdown
|
|
69
|
+
v-if="states === 'Basic'"
|
|
70
|
+
:aria-label="label"
|
|
71
|
+
:class="`u-mb-btn u-mb-basic size-${size}`"
|
|
72
|
+
:color="color"
|
|
73
|
+
flat
|
|
74
|
+
:menu-offset="menuOffset"
|
|
75
|
+
no-caps
|
|
76
|
+
text-color='dark'
|
|
77
|
+
>
|
|
78
|
+
<template #label>
|
|
79
|
+
<q-icon
|
|
80
|
+
v-if="iconClass"
|
|
81
|
+
:class="iconClass"
|
|
82
|
+
size='sm'
|
|
83
|
+
/>
|
|
84
|
+
<div class="text-body-md q-ml-xs">{{ label }}</div>
|
|
85
|
+
</template>
|
|
86
|
+
<slot name='menu' />
|
|
87
|
+
</q-btn-dropdown>
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
<!-- 2. Menu button Icon state -->
|
|
91
|
+
<UBtnIcon
|
|
92
|
+
v-if="states === 'Icon'"
|
|
93
|
+
:ariaLabel="ariaLabel"
|
|
94
|
+
:anchor="anchor"
|
|
95
|
+
class="u-mb-icon"
|
|
96
|
+
:color="color"
|
|
97
|
+
:iconClass="iconClass"
|
|
98
|
+
:offset="menuOffset"
|
|
99
|
+
ref="btn-icon"
|
|
100
|
+
:size="size"
|
|
101
|
+
:self="self"
|
|
102
|
+
:tooltip="tooltip"
|
|
103
|
+
@onClick="handleClick"
|
|
104
|
+
>
|
|
105
|
+
<template v-slot:menu>
|
|
106
|
+
<slot name='menu' />
|
|
107
|
+
</template>
|
|
108
|
+
</UBtnIcon>
|
|
109
|
+
|
|
110
|
+
<!-- 3. Menu button Button state -->
|
|
111
|
+
<UBtnStd
|
|
112
|
+
v-if="states === 'Button'"
|
|
113
|
+
class="u-mb-btn"
|
|
114
|
+
:color="color"
|
|
115
|
+
:left-icon="iconClass"
|
|
116
|
+
:label="label"
|
|
117
|
+
outline
|
|
118
|
+
:size="size"
|
|
119
|
+
>
|
|
120
|
+
<template v-slot:menu>
|
|
121
|
+
<slot name='menu' />
|
|
122
|
+
</template>
|
|
123
|
+
</UBtnStd>
|
|
124
|
+
|
|
125
|
+
<!-- 4. Menu button Avatar state -->
|
|
126
|
+
<q-btn-dropdown
|
|
127
|
+
v-if="states === 'Avatar'"
|
|
128
|
+
:class="`u-mb-avatar size-${size}`"
|
|
129
|
+
:color="color"
|
|
130
|
+
content-class="u-options-menu"
|
|
131
|
+
no-caps
|
|
132
|
+
:menu-offset="menuOffset"
|
|
133
|
+
rounded
|
|
134
|
+
text-color="black"
|
|
135
|
+
unelevated
|
|
136
|
+
>
|
|
137
|
+
<template #label>
|
|
138
|
+
<q-item class="account-drop-down">
|
|
139
|
+
<q-item-section avatar class="q-pr-xs">
|
|
140
|
+
<UAvatar
|
|
141
|
+
v-if="avatarUrl"
|
|
142
|
+
:image="avatarUrl"
|
|
143
|
+
:name="displayName"
|
|
144
|
+
size="md"
|
|
145
|
+
:showIndicator="false"
|
|
146
|
+
:round="true"
|
|
147
|
+
/>
|
|
148
|
+
<UAvatar
|
|
149
|
+
v-else
|
|
150
|
+
:name="displayName"
|
|
151
|
+
size="md"
|
|
152
|
+
:showIndicator="false"
|
|
153
|
+
:round="true"
|
|
154
|
+
/>
|
|
155
|
+
</q-item-section>
|
|
156
|
+
<q-item-section v-if="displayName">
|
|
157
|
+
<q-item-label class="text-body-md">
|
|
158
|
+
{{ displayName }}
|
|
159
|
+
</q-item-label>
|
|
160
|
+
</q-item-section>
|
|
161
|
+
</q-item>
|
|
162
|
+
</template>
|
|
163
|
+
<slot name='menu' />
|
|
164
|
+
</q-btn-dropdown>
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
<!-- 5. Menu button Prefix state -->
|
|
168
|
+
<q-btn-dropdown
|
|
169
|
+
v-if="states === 'Prefix'"
|
|
170
|
+
class="u-prefix-dropdown text-body-sm"
|
|
171
|
+
:class="`btn-field-${size}`"
|
|
172
|
+
content-class="u-prefix-dropdown-list"
|
|
173
|
+
flat
|
|
174
|
+
menu-anchor="top right"
|
|
175
|
+
menu-self="bottom middle"
|
|
176
|
+
:menu-offset="menuOffset"
|
|
177
|
+
rounded
|
|
178
|
+
>
|
|
179
|
+
<template #label>
|
|
180
|
+
<q-icon
|
|
181
|
+
:class="`fi fi-${toLowerCase(selectedCountry.flag)} q-mr-xxs`"
|
|
182
|
+
:aria-label="selectedCountry.name"
|
|
183
|
+
left
|
|
184
|
+
/>
|
|
185
|
+
<label class="selected-code"> {{ selectedCountry.code }}</label>
|
|
186
|
+
</template>
|
|
187
|
+
<slot name='menu' />
|
|
188
|
+
</q-btn-dropdown>
|
|
189
|
+
</template>
|
|
190
|
+
|
|
191
|
+
<style lang="sass">
|
|
192
|
+
.u-mb-basic
|
|
193
|
+
.q-icon
|
|
194
|
+
font-size: 1.875rem
|
|
195
|
+
|
|
196
|
+
.u-mb-avatar
|
|
197
|
+
padding: 0rem $xs
|
|
198
|
+
align-items: center
|
|
199
|
+
&:hover::before
|
|
200
|
+
background-color: $neutral-3
|
|
201
|
+
gap: $xs
|
|
202
|
+
.account-drop-down
|
|
203
|
+
padding: 0
|
|
204
|
+
min-height: 0
|
|
205
|
+
.q-item__section--avatar
|
|
206
|
+
min-width: 0
|
|
207
|
+
.q-btn__content
|
|
208
|
+
.q-icon
|
|
209
|
+
width:1rem
|
|
210
|
+
height:1rem
|
|
211
|
+
|
|
212
|
+
.u-mb-icon
|
|
213
|
+
&:hover::before
|
|
214
|
+
background-color: $blue-1
|
|
215
|
+
&:focus
|
|
216
|
+
border: 1.5px solid $primary
|
|
217
|
+
background-color: $blue-1
|
|
218
|
+
box-shadow: 0px 0px 0px 2px $primary-transparent
|
|
219
|
+
|
|
220
|
+
.u-mb-btn
|
|
221
|
+
border-radius: $xs
|
|
222
|
+
min-width: 5.5rem !important
|
|
223
|
+
&.bg-neutral
|
|
224
|
+
background-color: $neutral-3
|
|
225
|
+
&.size-sm
|
|
226
|
+
min-height: $md
|
|
227
|
+
padding: 0 $sm !important
|
|
228
|
+
&.size-md
|
|
229
|
+
min-height: $lg
|
|
230
|
+
padding: 0 $ba !important
|
|
231
|
+
&.size-lg
|
|
232
|
+
min-height: $xl
|
|
233
|
+
padding: 0 $ba !important
|
|
234
|
+
|
|
235
|
+
.u-mb-avatar
|
|
236
|
+
&.size-sm
|
|
237
|
+
min-height: $md
|
|
238
|
+
&.size-md
|
|
239
|
+
min-height: $lg
|
|
240
|
+
&.size-lg
|
|
241
|
+
min-height: $xl
|
|
242
|
+
|
|
243
|
+
.u-prefix-dropdown
|
|
244
|
+
border-radius: $xs 0px 0px $xs
|
|
245
|
+
border: 1.5px solid $neutral-4
|
|
246
|
+
background: $neutral-2
|
|
247
|
+
&:hover
|
|
248
|
+
border: 1.5px solid $primary
|
|
249
|
+
background-color: $neutral-2
|
|
250
|
+
&:focus
|
|
251
|
+
border: 1.5px solid $primary
|
|
252
|
+
background-color: $neutral-2
|
|
253
|
+
box-shadow: 0px 0px 0px 2px $primary-transparent
|
|
254
|
+
&.q-btn
|
|
255
|
+
height: 2rem
|
|
256
|
+
min-height: 2rem
|
|
257
|
+
padding: 0px $xs
|
|
258
|
+
.selected-code
|
|
259
|
+
width: 2rem
|
|
260
|
+
&.btn-field-sm
|
|
261
|
+
height: $md
|
|
262
|
+
&.btn-field-md
|
|
263
|
+
height: $lg
|
|
264
|
+
&.btn-field-lg
|
|
265
|
+
height: $xl
|
|
266
|
+
.q-icon.on-left
|
|
267
|
+
width: 1rem
|
|
268
|
+
height: 0.655rem
|
|
269
|
+
|
|
270
|
+
.q-btn-dropdown__arrow
|
|
271
|
+
width: 1rem
|
|
272
|
+
height: 1rem
|
|
273
|
+
margin-left: $xxs
|
|
274
|
+
</style>
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import UMenuItem from './UMenuItem.vue'
|
|
3
|
+
|
|
4
|
+
const props = defineProps({
|
|
5
|
+
data: {
|
|
6
|
+
type: Array,
|
|
7
|
+
},
|
|
8
|
+
destructive: {
|
|
9
|
+
type: Boolean,
|
|
10
|
+
default: false,
|
|
11
|
+
},
|
|
12
|
+
iconClass: {
|
|
13
|
+
type: String,
|
|
14
|
+
},
|
|
15
|
+
size: {
|
|
16
|
+
type: String,
|
|
17
|
+
default: 'md',
|
|
18
|
+
validator: (val) => ['sm', 'md', 'lg'].includes(val),
|
|
19
|
+
},
|
|
20
|
+
menuClass: {
|
|
21
|
+
type: String,
|
|
22
|
+
},
|
|
23
|
+
selected: {
|
|
24
|
+
type: Boolean,
|
|
25
|
+
},
|
|
26
|
+
})
|
|
27
|
+
|
|
28
|
+
const emit = defineEmits(['onClick'])
|
|
29
|
+
|
|
30
|
+
const handleClick = () => {
|
|
31
|
+
return emit('onClick')
|
|
32
|
+
}
|
|
33
|
+
</script>
|
|
34
|
+
|
|
35
|
+
<template>
|
|
36
|
+
<q-list :class="`u-menu-dropdown size-${size} ${menuClass}`">
|
|
37
|
+
<template v-for="(item, index) in data" :key="index">
|
|
38
|
+
<UMenuItem
|
|
39
|
+
:label="item.label"
|
|
40
|
+
:leftIcon="item.leftIcon"
|
|
41
|
+
:rightIcon="item.rightIcon"
|
|
42
|
+
@onClick="handleClick"
|
|
43
|
+
:destructive="destructive"
|
|
44
|
+
:iconClass="iconClass"
|
|
45
|
+
>
|
|
46
|
+
<template #leading_slot>
|
|
47
|
+
<slot name="leading_slot"></slot>
|
|
48
|
+
</template>
|
|
49
|
+
|
|
50
|
+
<template #trailing_slot>
|
|
51
|
+
<slot name="trailing_slot"></slot>
|
|
52
|
+
</template>
|
|
53
|
+
</UMenuItem>
|
|
54
|
+
</template>
|
|
55
|
+
</q-list>
|
|
56
|
+
</template>
|
|
57
|
+
|
|
58
|
+
<style lang="sass">
|
|
59
|
+
.u-menu-dropdown
|
|
60
|
+
width: 11.5rem
|
|
61
|
+
padding: $xxs
|
|
62
|
+
flex-direction: column
|
|
63
|
+
align-items: flex-start
|
|
64
|
+
gap: q-my-xxs
|
|
65
|
+
flex-shrink: 0
|
|
66
|
+
border-radius: $xs
|
|
67
|
+
background: $neutral-1
|
|
68
|
+
box-shadow: 0px 0px 4px 0px rgba(16, 17, 20, 0.08)
|
|
69
|
+
&.size-sm
|
|
70
|
+
min-width: 11.5rem
|
|
71
|
+
max-width: 11.5rem
|
|
72
|
+
&.size-md
|
|
73
|
+
min-width: 11.75rem
|
|
74
|
+
max-width: 15rem
|
|
75
|
+
&.size-lg
|
|
76
|
+
width: 18rem
|
|
77
|
+
</style>
|
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed } from 'vue'
|
|
3
|
+
import UInputPhoneStd from './UInputPhoneStd.vue'
|
|
4
|
+
import UInputTextStd from './UInputTextStd.vue'
|
|
5
|
+
import UMultiSelectStd from './UMultiSelectStd.vue'
|
|
6
|
+
import USelectStd from './USelectStd.vue'
|
|
7
|
+
|
|
8
|
+
const props = defineProps({
|
|
9
|
+
title: {
|
|
10
|
+
type: String,
|
|
11
|
+
default: 'Advanced search',
|
|
12
|
+
},
|
|
13
|
+
size: {
|
|
14
|
+
type: String,
|
|
15
|
+
default: 'md',
|
|
16
|
+
validator: (val) => ['sm', 'md'].includes(val),
|
|
17
|
+
},
|
|
18
|
+
searchType: {
|
|
19
|
+
type: String,
|
|
20
|
+
},
|
|
21
|
+
fields: {
|
|
22
|
+
type: Array,
|
|
23
|
+
},
|
|
24
|
+
showCustomMenu: {
|
|
25
|
+
type: Boolean,
|
|
26
|
+
default: false,
|
|
27
|
+
},
|
|
28
|
+
menuClass: {
|
|
29
|
+
type: String,
|
|
30
|
+
},
|
|
31
|
+
labelIcon: {
|
|
32
|
+
type: String,
|
|
33
|
+
default: 'fa-kit-duotone fa-filter-search',
|
|
34
|
+
},
|
|
35
|
+
model: {
|
|
36
|
+
type: Object,
|
|
37
|
+
},
|
|
38
|
+
})
|
|
39
|
+
const emit = defineEmits(['updateModelVal', 'updateCountry'])
|
|
40
|
+
|
|
41
|
+
const menuSize = computed(() => {
|
|
42
|
+
if (props.size === 'md') {
|
|
43
|
+
return '24.1875rem'
|
|
44
|
+
} else if (props.size === 'sm') {
|
|
45
|
+
return '23.5625rem'
|
|
46
|
+
} else {
|
|
47
|
+
return props.size
|
|
48
|
+
}
|
|
49
|
+
})
|
|
50
|
+
|
|
51
|
+
const updateModelVal = (event, index) => {
|
|
52
|
+
emit('updateModelVal', event, index)
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const updateCountry = (val, label) => {
|
|
56
|
+
emit('updateCountry', val, label)
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const titleToCamelCase = (str) => {
|
|
60
|
+
return str
|
|
61
|
+
.split(' ')
|
|
62
|
+
.map((word, index) => {
|
|
63
|
+
if (index === 0) {
|
|
64
|
+
return word.toLowerCase()
|
|
65
|
+
} else {
|
|
66
|
+
return word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()
|
|
67
|
+
}
|
|
68
|
+
})
|
|
69
|
+
.join('')
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
const getKeyValueByTitle = (label) => {
|
|
73
|
+
const model = props.model
|
|
74
|
+
const camelCaseKey = titleToCamelCase(label)
|
|
75
|
+
if (camelCaseKey in model) {
|
|
76
|
+
return model[camelCaseKey]
|
|
77
|
+
} else {
|
|
78
|
+
return ''
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
</script>
|
|
82
|
+
|
|
83
|
+
<template>
|
|
84
|
+
<div>
|
|
85
|
+
<q-expansion-item
|
|
86
|
+
v-bind="$attrs"
|
|
87
|
+
class="overflow-hidden u-expansion"
|
|
88
|
+
header-class="bg-neutral-2"
|
|
89
|
+
dense-toggle
|
|
90
|
+
:style="`width: ${menuSize}`"
|
|
91
|
+
>
|
|
92
|
+
<template #header>
|
|
93
|
+
<div class="row items-center full-width">
|
|
94
|
+
<q-icon :class="labelIcon" size="1rem" color="neutral-9" />
|
|
95
|
+
<span class="q-ml-xs text-caption-sm text-neutral-13">
|
|
96
|
+
{{ title }}
|
|
97
|
+
</span>
|
|
98
|
+
</div>
|
|
99
|
+
</template>
|
|
100
|
+
|
|
101
|
+
<!-- Using slot for custom menu -->
|
|
102
|
+
<template v-if="showCustomMenu">
|
|
103
|
+
<slot name="custom-menu" />
|
|
104
|
+
</template>
|
|
105
|
+
|
|
106
|
+
<section class="bg-neutral-2 q-px-ba" v-else>
|
|
107
|
+
<div class="row items-container">
|
|
108
|
+
<div
|
|
109
|
+
v-for="(item, index) in fields && fields.length ? fields : []"
|
|
110
|
+
:key="index"
|
|
111
|
+
:class="`${
|
|
112
|
+
size === 'sm'
|
|
113
|
+
? 'full-width'
|
|
114
|
+
: `col-${item?.col || 12} ${
|
|
115
|
+
item?.col !== 12 ? 'half-width' : ''
|
|
116
|
+
}`
|
|
117
|
+
}`"
|
|
118
|
+
>
|
|
119
|
+
<UInputTextStd
|
|
120
|
+
v-if="item.inputType === 'Text'"
|
|
121
|
+
v-bind="item.props"
|
|
122
|
+
:aria-label="item.label"
|
|
123
|
+
:hintText="item.hintText"
|
|
124
|
+
:label="item.label"
|
|
125
|
+
:modelValue="getKeyValueByTitle(item.label)"
|
|
126
|
+
@update:modelValue="
|
|
127
|
+
updateModelVal($event, titleToCamelCase(item.label))
|
|
128
|
+
"
|
|
129
|
+
/>
|
|
130
|
+
<USelectStd
|
|
131
|
+
v-if="item.inputType === 'Select'"
|
|
132
|
+
v-bind="item.props"
|
|
133
|
+
:aria-label="item.label"
|
|
134
|
+
hintIcon=""
|
|
135
|
+
:hintText="item.hintText"
|
|
136
|
+
:label="item.label"
|
|
137
|
+
:modelValue="getKeyValueByTitle(item.label)"
|
|
138
|
+
:options="item.options"
|
|
139
|
+
@update:modelValue="
|
|
140
|
+
updateModelVal($event, titleToCamelCase(item.label))
|
|
141
|
+
"
|
|
142
|
+
/>
|
|
143
|
+
<UMultiSelectStd
|
|
144
|
+
v-if="item.inputType === 'Multiselect'"
|
|
145
|
+
v-bind="item.props"
|
|
146
|
+
:aria-label="item.label"
|
|
147
|
+
:hintText="item.hintText"
|
|
148
|
+
:label="item.label"
|
|
149
|
+
:modelValue="getKeyValueByTitle(item.label)"
|
|
150
|
+
:options="item.options"
|
|
151
|
+
@update:modelValue="
|
|
152
|
+
updateModelVal($event, titleToCamelCase(item.label))
|
|
153
|
+
"
|
|
154
|
+
/>
|
|
155
|
+
<UInputPhoneStd
|
|
156
|
+
v-if="item.inputType === 'Phone'"
|
|
157
|
+
v-bind="item.props"
|
|
158
|
+
:aria-label="item.label"
|
|
159
|
+
hintIcon=""
|
|
160
|
+
:hintText="item.hintText"
|
|
161
|
+
:label="item.label"
|
|
162
|
+
:modelValue="getKeyValueByTitle(item.label)"
|
|
163
|
+
:options="item.options"
|
|
164
|
+
placeholder=""
|
|
165
|
+
:selected-country="model.selectedCountry"
|
|
166
|
+
:validationRules="[]"
|
|
167
|
+
@update-country="
|
|
168
|
+
updateCountry($event, titleToCamelCase(item.label))
|
|
169
|
+
"
|
|
170
|
+
@update:modelValue="
|
|
171
|
+
updateModelVal($event, titleToCamelCase(item.label))
|
|
172
|
+
"
|
|
173
|
+
/>
|
|
174
|
+
<UInputTextStd
|
|
175
|
+
v-if="item.inputType === 'Date'"
|
|
176
|
+
v-bind="item.props"
|
|
177
|
+
:aria-label="item.label"
|
|
178
|
+
:hintText="item.hintText"
|
|
179
|
+
:label="item.label"
|
|
180
|
+
:modelValue="getKeyValueByTitle(item.label)"
|
|
181
|
+
outlined
|
|
182
|
+
parentClass="col"
|
|
183
|
+
@update:modelValue="
|
|
184
|
+
updateModelVal($event, titleToCamelCase(item.label))
|
|
185
|
+
"
|
|
186
|
+
>
|
|
187
|
+
<template v-slot:append>
|
|
188
|
+
<q-icon
|
|
189
|
+
class="fa-kit-duotone fa-calendar-range cursor-pointer"
|
|
190
|
+
aria-label="Birthday calendar"
|
|
191
|
+
color="neutral-9"
|
|
192
|
+
size="1rem"
|
|
193
|
+
tabindex="0"
|
|
194
|
+
>
|
|
195
|
+
<q-popup-proxy
|
|
196
|
+
cover
|
|
197
|
+
transition-show="scale"
|
|
198
|
+
transition-hide="scale"
|
|
199
|
+
>
|
|
200
|
+
<q-date
|
|
201
|
+
v-model="item.value"
|
|
202
|
+
v-bind="item.dateProps"
|
|
203
|
+
mask="MM/DD/YYYY"
|
|
204
|
+
@update:modelValue="
|
|
205
|
+
updateModelVal($event, titleToCamelCase(item.label))
|
|
206
|
+
"
|
|
207
|
+
>
|
|
208
|
+
<div class="row items-center justify-end">
|
|
209
|
+
<q-btn
|
|
210
|
+
v-close-popup
|
|
211
|
+
color="primary"
|
|
212
|
+
flat
|
|
213
|
+
label="Close"
|
|
214
|
+
/>
|
|
215
|
+
</div>
|
|
216
|
+
</q-date>
|
|
217
|
+
</q-popup-proxy>
|
|
218
|
+
</q-icon>
|
|
219
|
+
</template>
|
|
220
|
+
</UInputTextStd>
|
|
221
|
+
</div>
|
|
222
|
+
</div>
|
|
223
|
+
|
|
224
|
+
<!-- Action Buttons -->
|
|
225
|
+
|
|
226
|
+
<div class="action-wrapper">
|
|
227
|
+
<q-card-actions align="left" class="full-width">
|
|
228
|
+
<slot name="action_left_button"></slot>
|
|
229
|
+
</q-card-actions>
|
|
230
|
+
<q-card-actions align="right" class="full-width">
|
|
231
|
+
<slot name="action_right_button"></slot>
|
|
232
|
+
</q-card-actions>
|
|
233
|
+
</div>
|
|
234
|
+
</section>
|
|
235
|
+
</q-expansion-item>
|
|
236
|
+
</div>
|
|
237
|
+
</template>
|
|
238
|
+
|
|
239
|
+
<style lang="sass">
|
|
240
|
+
.u-expansion
|
|
241
|
+
border-radius: $xs
|
|
242
|
+
justify-content: space-between
|
|
243
|
+
align-items: center
|
|
244
|
+
align-self: stretch
|
|
245
|
+
.q-item
|
|
246
|
+
padding: $xs $xs $xs $ba
|
|
247
|
+
.q-item__section--side
|
|
248
|
+
padding-right: 0px
|
|
249
|
+
color: $neutral-9
|
|
250
|
+
.action-wrapper
|
|
251
|
+
display: flex
|
|
252
|
+
justify-content: space-between
|
|
253
|
+
gap: $xs
|
|
254
|
+
.q-card__actions
|
|
255
|
+
padding: 0px
|
|
256
|
+
margin: $ba 0px $ba 0px
|
|
257
|
+
.items-container
|
|
258
|
+
gap: $ba $xs
|
|
259
|
+
.half-width
|
|
260
|
+
flex: 1 1 calc(50% - 44px)
|
|
261
|
+
box-sizing: border-box
|
|
262
|
+
</style>
|