@usssa/component-library 1.0.0-alpha.2 → 1.0.0-alpha.200
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 +24 -8
- 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/ComponentLink.vue +26 -0
- package/src/components/core/UAvatar.vue +210 -0
- package/src/components/core/UAvatarGroup.vue +129 -0
- package/src/components/core/UBadgeStd.vue +96 -0
- package/src/components/core/UBannerStd.vue +184 -0
- package/src/components/core/UBreadCrumbs.vue +171 -0
- package/src/components/core/UBtnIcon.vue +160 -0
- package/src/components/core/UBtnStd.vue +134 -0
- package/src/components/core/UBtnToggle.vue +73 -0
- package/src/components/core/UCheckboxStd.vue +101 -0
- package/src/components/core/UChip.vue +274 -0
- package/src/components/core/UDate.vue +581 -0
- package/src/components/core/UDialogStd.vue +614 -0
- package/src/components/core/UDrawer/UDrawer.vue +471 -0
- package/src/components/core/UDrawer/UDrawerMenuItem.vue +124 -0
- package/src/components/core/UExpansionStd.vue +266 -0
- package/src/components/core/UInnerLoader.vue +69 -0
- package/src/components/core/UInputAddressLookup.vue +484 -0
- package/src/components/core/UInputPhoneStd.vue +303 -0
- package/src/components/core/UInputTextStd.vue +308 -0
- 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 +80 -0
- package/src/components/core/UMenuDropdownAdvancedSearch.vue +306 -0
- package/src/components/core/UMenuItem.vue +183 -0
- package/src/components/core/UMenuSearch.vue +73 -0
- package/src/components/core/UModal.vue +660 -0
- package/src/components/core/UMultiSelectStd.vue +699 -0
- package/src/components/core/UPagination.vue +156 -0
- package/src/components/core/URadioBtn.vue +139 -0
- package/src/components/core/URadioStd.vue +71 -0
- package/src/components/core/USelectStd.vue +564 -0
- 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 +181 -0
- package/src/components/core/UTable/UTable.vue +1984 -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 +1449 -0
- package/src/components/core/UTabsStd.vue +140 -0
- package/src/components/core/UToggleStd.vue +164 -0
- package/src/components/core/UToolbar/UCustomMenuIcon.vue +58 -0
- package/src/components/core/UToolbar/UToolbar.vue +226 -0
- package/src/components/core/UTooltip.vue +78 -0
- package/src/components/core/UTypeahead.vue +890 -0
- package/src/components/core/UUploader.vue +644 -0
- package/src/components/index.js +91 -0
- package/src/composables/useNotify.js +79 -0
- 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 +150 -0
- package/src/css/typography.sass +0 -0
- package/src/css/vars/colors.variables.sass +113 -0
- package/src/utils/data.ts +170 -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,699 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed, nextTick, ref, watch } from 'vue'
|
|
3
|
+
import UBtnStd from './UBtnStd.vue'
|
|
4
|
+
import UBtnToggle from './UBtnToggle.vue'
|
|
5
|
+
import UChip from './UChip.vue'
|
|
6
|
+
import UMenuItem from './UMenuItem.vue'
|
|
7
|
+
import USheet from './USheet.vue'
|
|
8
|
+
import UTabBtnStd from './UTabBtnStd.vue'
|
|
9
|
+
import UTooltip from './UTooltip.vue'
|
|
10
|
+
import { useScreenType } from '../../composables/useScreenType'
|
|
11
|
+
|
|
12
|
+
const emit = defineEmits([
|
|
13
|
+
'update:modelValue',
|
|
14
|
+
'onClick',
|
|
15
|
+
'handleTabChange',
|
|
16
|
+
'updateButtonToggle',
|
|
17
|
+
])
|
|
18
|
+
|
|
19
|
+
const options = defineModel('options', {
|
|
20
|
+
type: Array,
|
|
21
|
+
default: [],
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
const selectedTab = defineModel('selectedTab', {
|
|
25
|
+
type: [String, Number],
|
|
26
|
+
default: null,
|
|
27
|
+
})
|
|
28
|
+
|
|
29
|
+
const props = defineProps({
|
|
30
|
+
applyLabel: {
|
|
31
|
+
type: String,
|
|
32
|
+
default: 'Apply',
|
|
33
|
+
},
|
|
34
|
+
beforeOptions: {
|
|
35
|
+
type: Array,
|
|
36
|
+
},
|
|
37
|
+
cancelLabel: {
|
|
38
|
+
type: String,
|
|
39
|
+
default: 'Cancel',
|
|
40
|
+
},
|
|
41
|
+
caption: {
|
|
42
|
+
type: String,
|
|
43
|
+
default: '',
|
|
44
|
+
},
|
|
45
|
+
color: {
|
|
46
|
+
type: String,
|
|
47
|
+
default: 'neutral-7',
|
|
48
|
+
},
|
|
49
|
+
dataTestId: {
|
|
50
|
+
type: String,
|
|
51
|
+
default: 'multi-select',
|
|
52
|
+
},
|
|
53
|
+
filterFn: {
|
|
54
|
+
type: Function,
|
|
55
|
+
required: false,
|
|
56
|
+
},
|
|
57
|
+
hintIcon: {
|
|
58
|
+
type: String,
|
|
59
|
+
default: 'fa-kit-duotone fa-triangle-exclamation',
|
|
60
|
+
},
|
|
61
|
+
hintText: {
|
|
62
|
+
type: String,
|
|
63
|
+
},
|
|
64
|
+
isBeforeOptions: {
|
|
65
|
+
type: Boolean,
|
|
66
|
+
default: false,
|
|
67
|
+
},
|
|
68
|
+
isRequired: {
|
|
69
|
+
type: Boolean,
|
|
70
|
+
default: false,
|
|
71
|
+
},
|
|
72
|
+
isTabBeforeOptions: {
|
|
73
|
+
type: Boolean,
|
|
74
|
+
default: true,
|
|
75
|
+
},
|
|
76
|
+
label: {
|
|
77
|
+
type: String,
|
|
78
|
+
},
|
|
79
|
+
leftIcon: {
|
|
80
|
+
type: String,
|
|
81
|
+
},
|
|
82
|
+
modelValue: {
|
|
83
|
+
type: [Array, String, null],
|
|
84
|
+
required: true,
|
|
85
|
+
},
|
|
86
|
+
multiSelect: {
|
|
87
|
+
type: Boolean,
|
|
88
|
+
default: true,
|
|
89
|
+
},
|
|
90
|
+
noSearchText: {
|
|
91
|
+
type: String,
|
|
92
|
+
required: false,
|
|
93
|
+
},
|
|
94
|
+
optionLabel: {
|
|
95
|
+
type: String,
|
|
96
|
+
default: 'label',
|
|
97
|
+
},
|
|
98
|
+
optionValue: {
|
|
99
|
+
type: String,
|
|
100
|
+
default: 'value',
|
|
101
|
+
},
|
|
102
|
+
placeholder: {
|
|
103
|
+
type: String,
|
|
104
|
+
default: '',
|
|
105
|
+
},
|
|
106
|
+
showSheetInput: {
|
|
107
|
+
type: Boolean,
|
|
108
|
+
default: true,
|
|
109
|
+
},
|
|
110
|
+
size: {
|
|
111
|
+
type: String,
|
|
112
|
+
default: 'md',
|
|
113
|
+
validator: (val) => ['sm', 'md', 'lg'].includes(val),
|
|
114
|
+
},
|
|
115
|
+
toolTipText: {
|
|
116
|
+
type: String,
|
|
117
|
+
},
|
|
118
|
+
updateFn: {
|
|
119
|
+
type: Function,
|
|
120
|
+
required: true,
|
|
121
|
+
},
|
|
122
|
+
useCustomComponent: {
|
|
123
|
+
type: Boolean,
|
|
124
|
+
default: false,
|
|
125
|
+
},
|
|
126
|
+
useInput: {
|
|
127
|
+
type: Boolean,
|
|
128
|
+
required: false,
|
|
129
|
+
},
|
|
130
|
+
})
|
|
131
|
+
|
|
132
|
+
const $screen = useScreenType()
|
|
133
|
+
let cloneOptions = JSON.parse(JSON.stringify(options.value))
|
|
134
|
+
|
|
135
|
+
const chipModelVal = ref(true)
|
|
136
|
+
const dialogs = ref([])
|
|
137
|
+
const placeholderText = ref(props.placeholder)
|
|
138
|
+
const selectedItems = ref([...props.modelValue])
|
|
139
|
+
const selectRef = ref(null)
|
|
140
|
+
|
|
141
|
+
const sheetHeading = computed(() => props.label)
|
|
142
|
+
|
|
143
|
+
const filterSheetOptions = (val, update) => {
|
|
144
|
+
if (val === '') {
|
|
145
|
+
update(() => {
|
|
146
|
+
options.value = cloneOptions
|
|
147
|
+
})
|
|
148
|
+
return
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
const typeValue = val.toLowerCase()
|
|
152
|
+
update(() => {
|
|
153
|
+
options.value = cloneOptions.filter((option) =>
|
|
154
|
+
option.label.toLowerCase().includes(typeValue)
|
|
155
|
+
)
|
|
156
|
+
})
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
const handleApply = () => {
|
|
160
|
+
dialogs.value[0].open = false
|
|
161
|
+
emit('update:modelValue', selectedItems.value)
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
const handleClick = (event) => {
|
|
165
|
+
if (!$screen.value.isMobile) return
|
|
166
|
+
|
|
167
|
+
// Prevent default behavior in mobile screen
|
|
168
|
+
event.preventDefault()
|
|
169
|
+
event.stopPropagation()
|
|
170
|
+
nextTick(() => {
|
|
171
|
+
selectRef.value.hidePopup()
|
|
172
|
+
})
|
|
173
|
+
|
|
174
|
+
const isSelectElement = event.target.closest('.q-field__control')
|
|
175
|
+
|
|
176
|
+
if (props.useCustomComponent && isSelectElement) {
|
|
177
|
+
// Emit click event for handling in parent component
|
|
178
|
+
emit('onClick')
|
|
179
|
+
return
|
|
180
|
+
}
|
|
181
|
+
if (isSelectElement) {
|
|
182
|
+
dialogs.value = [
|
|
183
|
+
{
|
|
184
|
+
open: true,
|
|
185
|
+
height: 350,
|
|
186
|
+
persistent: true,
|
|
187
|
+
transitionDuration: 500,
|
|
188
|
+
position: 'bottom',
|
|
189
|
+
},
|
|
190
|
+
]
|
|
191
|
+
selectedItems.value = props.modelValue
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
const handleClose = () => {
|
|
196
|
+
dialogs.value[0].open = false
|
|
197
|
+
selectedItems.value = props.modelValue.length ? props.modelValue : []
|
|
198
|
+
options.value = cloneOptions
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
// adding scroll if highlighted menu is not visible to user
|
|
202
|
+
const handleKeydown = (event) => {
|
|
203
|
+
if (event.key === 'Enter') {
|
|
204
|
+
handleClick(event)
|
|
205
|
+
return
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
// Only handle arrow keys for scrolling
|
|
209
|
+
if (event.key === 'ArrowUp' || event.key === 'ArrowDown') {
|
|
210
|
+
nextTick(() => {
|
|
211
|
+
scrollToFocusedOption()
|
|
212
|
+
})
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
const handleSheetItemClick = (val) => {
|
|
217
|
+
const exists = selectedItems.value.find((item) => item.value === val.value)
|
|
218
|
+
|
|
219
|
+
if (!exists) {
|
|
220
|
+
selectedItems.value = [...selectedItems.value, val]
|
|
221
|
+
} else {
|
|
222
|
+
selectedItems.value = selectedItems.value.filter(
|
|
223
|
+
(item) => item.value !== val.value
|
|
224
|
+
)
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
const handleSheetItemRemove = (item) => {
|
|
229
|
+
selectedItems.value = selectedItems.value.filter(
|
|
230
|
+
(option) => option.value !== item.value
|
|
231
|
+
)
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
const handleSheetSelectionUpdate = (val) => {
|
|
235
|
+
selectedItems.value = val
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
const handleTabChange = (val) => {
|
|
239
|
+
nextTick(() => {
|
|
240
|
+
selectRef.value?.focus()
|
|
241
|
+
})
|
|
242
|
+
emit('handleTabChange', val)
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
const isSelected = (value) => {
|
|
246
|
+
let getItems = selectedItems.value.filter((e) => e.value === value)
|
|
247
|
+
return getItems.length ? true : false
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
const removeItems = (item) => {
|
|
251
|
+
selectedItems.value = selectedItems.value.filter(
|
|
252
|
+
(option) => option.value !== item.value
|
|
253
|
+
)
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
const scrollToFocusedOption = () => {
|
|
257
|
+
requestAnimationFrame(() => {
|
|
258
|
+
if (!selectRef.value) return
|
|
259
|
+
|
|
260
|
+
const selectElement = selectRef.value.$el
|
|
261
|
+
const dropdownContainer =
|
|
262
|
+
selectElement?.querySelector('.u-option-menu') ||
|
|
263
|
+
document.querySelector('.u-option-menu')
|
|
264
|
+
|
|
265
|
+
if (!dropdownContainer) return
|
|
266
|
+
|
|
267
|
+
const focusedElement = dropdownContainer.querySelector(
|
|
268
|
+
'.q-manual-focusable--focused'
|
|
269
|
+
)
|
|
270
|
+
|
|
271
|
+
if (focusedElement) {
|
|
272
|
+
const itemRect = focusedElement.getBoundingClientRect()
|
|
273
|
+
const containerRect = dropdownContainer.getBoundingClientRect()
|
|
274
|
+
|
|
275
|
+
const isVisible =
|
|
276
|
+
itemRect.top >= containerRect.top &&
|
|
277
|
+
itemRect.bottom <= containerRect.bottom
|
|
278
|
+
|
|
279
|
+
if (!isVisible) {
|
|
280
|
+
focusedElement.scrollIntoView({
|
|
281
|
+
behavior: 'smooth',
|
|
282
|
+
block: 'nearest',
|
|
283
|
+
inline: 'nearest',
|
|
284
|
+
})
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
})
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
const updateButtonToggle = () => {
|
|
291
|
+
emit('updateButtonToggle')
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
const updateVal = (val) => {
|
|
295
|
+
props.updateFn(val)
|
|
296
|
+
placeholderText.value = val.length ? '' : props.placeholder
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
watch(
|
|
300
|
+
() => dialogs.value[0]?.open,
|
|
301
|
+
() => {
|
|
302
|
+
options.value = cloneOptions
|
|
303
|
+
}
|
|
304
|
+
)
|
|
305
|
+
|
|
306
|
+
watch(
|
|
307
|
+
() => props.placeholder,
|
|
308
|
+
(value) => {
|
|
309
|
+
placeholderText.value = value
|
|
310
|
+
}
|
|
311
|
+
)
|
|
312
|
+
|
|
313
|
+
watch(
|
|
314
|
+
() => $screen.value,
|
|
315
|
+
(newValue) => {
|
|
316
|
+
dialogs.value = []
|
|
317
|
+
if (newValue) {
|
|
318
|
+
selectedItems.value = [...props.modelValue]
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
)
|
|
322
|
+
|
|
323
|
+
watch(selectedTab, () => {
|
|
324
|
+
cloneOptions = JSON.parse(JSON.stringify(options.value))
|
|
325
|
+
})
|
|
326
|
+
</script>
|
|
327
|
+
|
|
328
|
+
<template>
|
|
329
|
+
<div class="q-gutter-xs" :dataTestId="dataTestId" @click="handleClick">
|
|
330
|
+
<label class="row items-center" for="select">
|
|
331
|
+
<div class="u-select-label text-body-sm">
|
|
332
|
+
<span>{{ label }}</span>
|
|
333
|
+
<span v-if="isRequired" class="text-red-5 q-ml-xs">*</span>
|
|
334
|
+
</div>
|
|
335
|
+
|
|
336
|
+
<q-icon
|
|
337
|
+
v-if="toolTipText"
|
|
338
|
+
class="q-ml-xs fa-kit-duotone fa-circle-info cursor-pointer"
|
|
339
|
+
aria-hidden="true"
|
|
340
|
+
color="neutral-9"
|
|
341
|
+
size="1rem"
|
|
342
|
+
>
|
|
343
|
+
<UTooltip
|
|
344
|
+
anchor="top middle"
|
|
345
|
+
:description="toolTipText"
|
|
346
|
+
self="bottom middle"
|
|
347
|
+
/>
|
|
348
|
+
</q-icon>
|
|
349
|
+
</label>
|
|
350
|
+
<q-select
|
|
351
|
+
v-bind="$attrs"
|
|
352
|
+
:class="`u-multi-select field-${size}`"
|
|
353
|
+
behavior="menu"
|
|
354
|
+
bottom-slots
|
|
355
|
+
:color="color"
|
|
356
|
+
hide-bottom-space
|
|
357
|
+
:hide-dropdown-icon="$screen.isMobile ? true : false"
|
|
358
|
+
id="multi-select"
|
|
359
|
+
:menu-offset="[0, 5]"
|
|
360
|
+
:modelValue="modelValue"
|
|
361
|
+
multiple
|
|
362
|
+
:option-label="optionLabel"
|
|
363
|
+
:option-value="optionValue"
|
|
364
|
+
:options="options"
|
|
365
|
+
options-selected-class="primary bg-blue-1"
|
|
366
|
+
outlined
|
|
367
|
+
:placeholder="modelValue.length ? '' : placeholderText"
|
|
368
|
+
popup-content-class="u-option-menu"
|
|
369
|
+
ref="selectRef"
|
|
370
|
+
use-chips
|
|
371
|
+
:use-input="useInput"
|
|
372
|
+
@add="
|
|
373
|
+
(details) =>
|
|
374
|
+
updateFn({
|
|
375
|
+
...details,
|
|
376
|
+
multiSelect,
|
|
377
|
+
})
|
|
378
|
+
"
|
|
379
|
+
@click.prevent="handleClick"
|
|
380
|
+
@filter="filterFn"
|
|
381
|
+
@keydown="handleKeydown"
|
|
382
|
+
@remove="
|
|
383
|
+
(details) =>
|
|
384
|
+
updateFn({
|
|
385
|
+
remove: true,
|
|
386
|
+
...details,
|
|
387
|
+
})
|
|
388
|
+
"
|
|
389
|
+
@update:model-value="(val) => updateVal(val)"
|
|
390
|
+
>
|
|
391
|
+
<template v-slot:no-option>
|
|
392
|
+
<q-item :class="[{ 'no-result-container': isBeforeOptions }]">
|
|
393
|
+
<div v-if="isBeforeOptions">
|
|
394
|
+
<div
|
|
395
|
+
v-if="isTabBeforeOptions"
|
|
396
|
+
class="tab-container q-mt-sm q-mx-xs"
|
|
397
|
+
>
|
|
398
|
+
<UTabBtnStd
|
|
399
|
+
v-model:selectedTab="selectedTab"
|
|
400
|
+
:buttonTabsOptions="beforeOptions"
|
|
401
|
+
size="sm"
|
|
402
|
+
@on-tab-click="(val) => handleTabChange(val)"
|
|
403
|
+
/>
|
|
404
|
+
</div>
|
|
405
|
+
<slot v-else name="before-options" />
|
|
406
|
+
</div>
|
|
407
|
+
<q-item-section
|
|
408
|
+
:class="[
|
|
409
|
+
'text-grey',
|
|
410
|
+
{ 'q-mt-xs q-mx-sm q-mb-xs': isBeforeOptions },
|
|
411
|
+
]"
|
|
412
|
+
>
|
|
413
|
+
{{ noSearchText }}
|
|
414
|
+
</q-item-section>
|
|
415
|
+
</q-item>
|
|
416
|
+
</template>
|
|
417
|
+
|
|
418
|
+
<template v-if="leftIcon" v-slot:prepend>
|
|
419
|
+
<q-icon :class="leftIcon" size="1rem" />
|
|
420
|
+
</template>
|
|
421
|
+
|
|
422
|
+
<template v-if="$screen.isMobile" v-slot:append>
|
|
423
|
+
<q-icon
|
|
424
|
+
class="cursor-pointer"
|
|
425
|
+
name="arrow_drop_down"
|
|
426
|
+
@click.stop="handleClick"
|
|
427
|
+
/>
|
|
428
|
+
</template>
|
|
429
|
+
|
|
430
|
+
<template v-if="hintText" v-slot:hint>
|
|
431
|
+
<div class="row no-wrap items-center">
|
|
432
|
+
<q-icon v-if="hintIcon" :class="hintIcon" size="1rem" />
|
|
433
|
+
|
|
434
|
+
<div class="q-mx-xxs text-body-xs">
|
|
435
|
+
{{ hintText }}
|
|
436
|
+
</div>
|
|
437
|
+
</div>
|
|
438
|
+
</template>
|
|
439
|
+
|
|
440
|
+
<template v-slot:before-options>
|
|
441
|
+
<div v-if="isBeforeOptions">
|
|
442
|
+
<div
|
|
443
|
+
v-if="isTabBeforeOptions"
|
|
444
|
+
class="tab-container q-mx-xs q-mt-sm q-mb-xs"
|
|
445
|
+
>
|
|
446
|
+
<UTabBtnStd
|
|
447
|
+
v-model:selectedTab="selectedTab"
|
|
448
|
+
:buttonTabsOptions="beforeOptions"
|
|
449
|
+
size="sm"
|
|
450
|
+
@on-tab-click="(val) => handleTabChange(val)"
|
|
451
|
+
/>
|
|
452
|
+
</div>
|
|
453
|
+
<slot v-else name="before-options" />
|
|
454
|
+
</div>
|
|
455
|
+
</template>
|
|
456
|
+
|
|
457
|
+
<template v-slot:option="scope">
|
|
458
|
+
<q-item
|
|
459
|
+
v-bind="scope.itemProps"
|
|
460
|
+
v-if="!$screen.isMobile && !useCustomComponent"
|
|
461
|
+
class="items-center u-custom-options"
|
|
462
|
+
:key="scope.opt.value"
|
|
463
|
+
>
|
|
464
|
+
<div v-if="scope.opt.icon" class="q-pr-xs">
|
|
465
|
+
<q-icon :class="scope.opt.icon" color="neutral-13" size="1rem" />
|
|
466
|
+
</div>
|
|
467
|
+
|
|
468
|
+
<q-item-section>
|
|
469
|
+
<q-item-label class="text-body-sm">
|
|
470
|
+
{{ scope.opt.label }}
|
|
471
|
+
</q-item-label>
|
|
472
|
+
<q-item-label v-if="scope.opt.description" caption>
|
|
473
|
+
{{ scope.opt.description }}
|
|
474
|
+
</q-item-label>
|
|
475
|
+
</q-item-section>
|
|
476
|
+
|
|
477
|
+
<q-item-section v-if="scope.selected" side>
|
|
478
|
+
<q-icon
|
|
479
|
+
class="fa-kit-duotone fa-circle-check"
|
|
480
|
+
color="primary"
|
|
481
|
+
size="1rem"
|
|
482
|
+
/>
|
|
483
|
+
</q-item-section>
|
|
484
|
+
</q-item>
|
|
485
|
+
</template>
|
|
486
|
+
<template v-slot:selected-item="scope">
|
|
487
|
+
<UChip
|
|
488
|
+
v-model="chipModelVal"
|
|
489
|
+
:chipLabel="scope.opt.label"
|
|
490
|
+
dense
|
|
491
|
+
:removable="true"
|
|
492
|
+
:tabindex="scope.tabindex"
|
|
493
|
+
@remove="scope.removeAtIndex(scope.index)"
|
|
494
|
+
/>
|
|
495
|
+
</template>
|
|
496
|
+
</q-select>
|
|
497
|
+
</div>
|
|
498
|
+
<USheet
|
|
499
|
+
v-if="$screen.isMobile && !useCustomComponent"
|
|
500
|
+
v-model:dialogs="dialogs"
|
|
501
|
+
dialog-class="options-dialog"
|
|
502
|
+
:heading="sheetHeading"
|
|
503
|
+
:heading-caption="caption"
|
|
504
|
+
:show-action-buttons="true"
|
|
505
|
+
>
|
|
506
|
+
<template #header>
|
|
507
|
+
<div v-if="isBeforeOptions" class="q-mt-xs">
|
|
508
|
+
<UBtnToggle
|
|
509
|
+
v-if="isTabBeforeOptions"
|
|
510
|
+
v-model="selectedTab"
|
|
511
|
+
:options="beforeOptions"
|
|
512
|
+
size="md"
|
|
513
|
+
@update:model-value="updateButtonToggle"
|
|
514
|
+
/>
|
|
515
|
+
<slot v-else name="before-options" />
|
|
516
|
+
</div>
|
|
517
|
+
<q-select
|
|
518
|
+
v-if="showSheetInput"
|
|
519
|
+
:model-value="selectedItems"
|
|
520
|
+
:class="`u-multi-select field-md q-mt-ba`"
|
|
521
|
+
behavior="menu"
|
|
522
|
+
multiple
|
|
523
|
+
outlined
|
|
524
|
+
:placeholder="selectedItems.length ? '' : placeholderText"
|
|
525
|
+
use-chips
|
|
526
|
+
:use-input="useInput"
|
|
527
|
+
@click="() => null"
|
|
528
|
+
@filter="filterSheetOptions"
|
|
529
|
+
@remove="handleSheetItemRemove"
|
|
530
|
+
@update:model-value="handleSheetSelectionUpdate"
|
|
531
|
+
>
|
|
532
|
+
<template v-if="leftIcon" v-slot:prepend>
|
|
533
|
+
<q-icon :class="leftIcon" size="1rem" />
|
|
534
|
+
</template>
|
|
535
|
+
<template v-slot:selected-item="scope">
|
|
536
|
+
<UChip
|
|
537
|
+
v-model="chipModelVal"
|
|
538
|
+
:avatar="scope.opt.img"
|
|
539
|
+
:chipLabel="scope.opt.label"
|
|
540
|
+
dense
|
|
541
|
+
:removable="true"
|
|
542
|
+
:tabindex="scope.tabindex"
|
|
543
|
+
@remove="removeItems(scope.opt)"
|
|
544
|
+
/>
|
|
545
|
+
</template>
|
|
546
|
+
</q-select>
|
|
547
|
+
</template>
|
|
548
|
+
|
|
549
|
+
<template #content>
|
|
550
|
+
<template v-if="options.length > 0">
|
|
551
|
+
<template v-for="(item, index) in options" :key="index">
|
|
552
|
+
<UMenuItem
|
|
553
|
+
:destructive="item.destructive"
|
|
554
|
+
:disable="item.disable"
|
|
555
|
+
:hide="item.hide"
|
|
556
|
+
:index="index"
|
|
557
|
+
:inSheet="true"
|
|
558
|
+
:label="item.label"
|
|
559
|
+
labelStyle="text-caption-lg"
|
|
560
|
+
:leftIcon="item.icon"
|
|
561
|
+
:positive="item.positive"
|
|
562
|
+
:rightIcon="item.rightIcon"
|
|
563
|
+
:selected="isSelected(item.value)"
|
|
564
|
+
@onClick="handleSheetItemClick(item, index)"
|
|
565
|
+
>
|
|
566
|
+
<template #trailing_slot>
|
|
567
|
+
<slot name="trailing_slot">
|
|
568
|
+
<q-icon
|
|
569
|
+
v-if="isSelected(item.value)"
|
|
570
|
+
class="fa-kit-duotone fa-circle-check"
|
|
571
|
+
color="primary"
|
|
572
|
+
size="1rem"
|
|
573
|
+
/>
|
|
574
|
+
</slot>
|
|
575
|
+
</template>
|
|
576
|
+
</UMenuItem>
|
|
577
|
+
</template>
|
|
578
|
+
</template>
|
|
579
|
+
<template v-else>
|
|
580
|
+
<q-item>
|
|
581
|
+
<q-item-section class="text-grey">
|
|
582
|
+
{{ noSearchText }}
|
|
583
|
+
</q-item-section>
|
|
584
|
+
</q-item>
|
|
585
|
+
</template>
|
|
586
|
+
</template>
|
|
587
|
+
<template #action_primary_one>
|
|
588
|
+
<UBtnStd
|
|
589
|
+
color="primary"
|
|
590
|
+
:label="cancelLabel"
|
|
591
|
+
outline
|
|
592
|
+
size="md"
|
|
593
|
+
@onClick="handleClose"
|
|
594
|
+
/>
|
|
595
|
+
</template>
|
|
596
|
+
<template #action_primary_two>
|
|
597
|
+
<UBtnStd
|
|
598
|
+
color="primary"
|
|
599
|
+
:label="applyLabel"
|
|
600
|
+
size="md"
|
|
601
|
+
@onClick="handleApply"
|
|
602
|
+
/>
|
|
603
|
+
</template>
|
|
604
|
+
</USheet>
|
|
605
|
+
</template>
|
|
606
|
+
|
|
607
|
+
<style lang="sass">
|
|
608
|
+
.u-multi-select
|
|
609
|
+
&.q-field--auto-height .q-field__control,
|
|
610
|
+
&.q-field--auto-height .q-field__native
|
|
611
|
+
min-height: $md
|
|
612
|
+
align-items: center
|
|
613
|
+
padding: 0px
|
|
614
|
+
|
|
615
|
+
&.q-field--outlined .q-field__control
|
|
616
|
+
border-radius: $xs
|
|
617
|
+
padding: 0 $xs
|
|
618
|
+
|
|
619
|
+
&::before
|
|
620
|
+
background: white
|
|
621
|
+
border: 1.5px solid $neutral-4
|
|
622
|
+
|
|
623
|
+
&.field-sm
|
|
624
|
+
.q-field__marginal
|
|
625
|
+
height: $md
|
|
626
|
+
|
|
627
|
+
&.field-md
|
|
628
|
+
.q-field__marginal
|
|
629
|
+
height: $lg
|
|
630
|
+
|
|
631
|
+
&.field-lg
|
|
632
|
+
.q-field__marginal
|
|
633
|
+
height: $xl
|
|
634
|
+
|
|
635
|
+
&:hover .q-field__control::before
|
|
636
|
+
border: 1.5px solid $primary
|
|
637
|
+
|
|
638
|
+
&.q-field--with-bottom
|
|
639
|
+
padding-bottom: 0
|
|
640
|
+
|
|
641
|
+
.q-field__control:focus-within
|
|
642
|
+
box-shadow : 0 0 0 2px $primary-transparent
|
|
643
|
+
|
|
644
|
+
.q-field__bottom
|
|
645
|
+
padding: $xxs 0 0 0
|
|
646
|
+
|
|
647
|
+
.q-chip__content
|
|
648
|
+
color: $neutral-9
|
|
649
|
+
|
|
650
|
+
.q-field__prepend
|
|
651
|
+
padding-right: $xs
|
|
652
|
+
|
|
653
|
+
.q-chip
|
|
654
|
+
padding-left: $xs !important
|
|
655
|
+
|
|
656
|
+
.u-option-menu
|
|
657
|
+
border-radius: $xs
|
|
658
|
+
box-shadow: $shadow-2
|
|
659
|
+
max-height: 12.25rem !important
|
|
660
|
+
width: 18rem
|
|
661
|
+
overflow-y: auto
|
|
662
|
+
scrollbar-width: none
|
|
663
|
+
|
|
664
|
+
.u-custom-options
|
|
665
|
+
margin: $xxs
|
|
666
|
+
border-radius: $xxs
|
|
667
|
+
padding: $xs
|
|
668
|
+
min-height: $lg
|
|
669
|
+
|
|
670
|
+
.sheet-card-wrapper .q-select__dropdown-icon
|
|
671
|
+
display: none !important
|
|
672
|
+
|
|
673
|
+
.options-dialog
|
|
674
|
+
.heading-row
|
|
675
|
+
margin-bottom: $xs
|
|
676
|
+
.main-content-dialog
|
|
677
|
+
padding-top: $xs
|
|
678
|
+
|
|
679
|
+
.tab-container
|
|
680
|
+
.q-tabs__content--align-center
|
|
681
|
+
justify-content: flex-start
|
|
682
|
+
|
|
683
|
+
.no-result-container
|
|
684
|
+
display: block
|
|
685
|
+
padding: 0px
|
|
686
|
+
|
|
687
|
+
.options-dialog
|
|
688
|
+
.sheet-card-wrapper .q-card__section .q-item
|
|
689
|
+
padding:$ba $ba !important
|
|
690
|
+
margin-bottom: $xs !important
|
|
691
|
+
border-radius: $sm !important
|
|
692
|
+
align-items: flex-start !important
|
|
693
|
+
.label
|
|
694
|
+
line-height: $ms !important
|
|
695
|
+
.q-icon
|
|
696
|
+
font-size: $ms !important
|
|
697
|
+
.q-focus-helper
|
|
698
|
+
display: none
|
|
699
|
+
</style>
|