@usssa/component-library 1.0.0-alpha.10 → 1.0.0-alpha.100
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 +5 -2
- package/package.json +19 -4
- 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 +39 -6
- package/src/components/core/UAvatarGroup.vue +15 -14
- package/src/components/core/UBannerStd.vue +51 -22
- package/src/components/core/UBreadCrumbs.vue +67 -0
- package/src/components/core/UBtnIcon.vue +24 -14
- package/src/components/core/UBtnStd.vue +35 -31
- package/src/components/core/UBtnToggle.vue +68 -0
- package/src/components/core/UCheckboxStd.vue +25 -8
- package/src/components/core/UChip.vue +30 -4
- package/src/components/core/UDialogStd.vue +244 -0
- package/src/components/core/UDrawer.vue +235 -0
- package/src/components/core/UInnerLoader.vue +58 -0
- package/src/components/core/UInputAddressLookup.vue +470 -0
- package/src/components/core/UInputPhoneStd.vue +299 -0
- package/src/components/core/UInputTextStd.vue +114 -85
- package/src/components/core/UInputTypeaheadAdvanceSearch.vue +59 -0
- package/src/components/core/UMenuButtonStd.vue +274 -0
- package/src/components/core/UMenuDropdown.vue +72 -0
- package/src/components/core/UMenuDropdownAdvancedSearch.vue +301 -0
- package/src/components/core/UMenuItem.vue +134 -0
- package/src/components/core/UMenuSearch.vue +752 -0
- package/src/components/core/UMultiSelectStd.vue +63 -57
- package/src/components/core/UPagination.vue +104 -0
- package/src/components/core/URadioBtn.vue +116 -0
- package/src/components/core/URadioStd.vue +7 -3
- package/src/components/core/USelectStd.vue +74 -59
- package/src/components/core/UTabBtnStd.vue +82 -59
- 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 +1003 -0
- package/src/components/core/UTabsStd.vue +17 -5
- package/src/components/core/UToggleStd.vue +30 -20
- package/src/components/core/UToolbar.vue +94 -0
- package/src/components/core/UTooltip.vue +25 -4
- package/src/components/core/UUploader.vue +497 -0
- package/src/components/index.js +57 -6
- 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 +121 -0
- package/src/css/typography.sass +0 -0
- package/src/css/vars/colors.variables.sass +126 -0
- package/src/utils/data.ts +146 -0
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
+
import { ref, watch } from 'vue'
|
|
3
|
+
import UChip from './UChip.vue'
|
|
4
|
+
import UTooltip from './UTooltip.vue'
|
|
5
|
+
|
|
2
6
|
const props = defineProps({
|
|
3
7
|
modelValue: {
|
|
4
8
|
type: [Array, String, null],
|
|
@@ -32,7 +36,7 @@ const props = defineProps({
|
|
|
32
36
|
},
|
|
33
37
|
placeholder: {
|
|
34
38
|
type: String,
|
|
35
|
-
default: '
|
|
39
|
+
default: '',
|
|
36
40
|
},
|
|
37
41
|
size: {
|
|
38
42
|
type: String,
|
|
@@ -71,49 +75,66 @@ const props = defineProps({
|
|
|
71
75
|
default: 'label',
|
|
72
76
|
},
|
|
73
77
|
})
|
|
78
|
+
|
|
79
|
+
const chipModelVal = ref(true)
|
|
80
|
+
|
|
81
|
+
const placeholderText = ref(props.placeholder)
|
|
82
|
+
|
|
83
|
+
const updateVal = (val) => {
|
|
84
|
+
props.updateFn(val)
|
|
85
|
+
placeholderText.value = val.length ? '' : props.placeholder
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
watch(
|
|
89
|
+
() => props.placeholder,
|
|
90
|
+
(value) => {
|
|
91
|
+
placeholderText.value = value
|
|
92
|
+
}
|
|
93
|
+
)
|
|
74
94
|
</script>
|
|
75
95
|
|
|
76
96
|
<template>
|
|
77
97
|
<div class="q-gutter-xs">
|
|
78
98
|
<label for="select" class="row items-center">
|
|
79
99
|
<div class="u-select-label text-body-sm">
|
|
80
|
-
{{ label }}
|
|
81
|
-
<span class="text-red-5 q-ml-xs"
|
|
100
|
+
<span>{{ label }}</span>
|
|
101
|
+
<span v-if="isRequired" class="text-red-5 q-ml-xs">*</span>
|
|
82
102
|
</div>
|
|
83
103
|
|
|
84
104
|
<q-icon
|
|
85
|
-
class="q-ml-xs fa-kit-duotone fa-circle-info cursor-pointer"
|
|
86
105
|
v-if="toolTipText"
|
|
87
|
-
|
|
88
|
-
color="neutral-9"
|
|
106
|
+
class="q-ml-xs fa-kit-duotone fa-circle-info cursor-pointer"
|
|
89
107
|
aria-hidden="true"
|
|
108
|
+
color="neutral-9"
|
|
109
|
+
size="1rem"
|
|
90
110
|
>
|
|
91
|
-
<
|
|
92
|
-
|
|
93
|
-
|
|
111
|
+
<UTooltip
|
|
112
|
+
anchor="top middle"
|
|
113
|
+
:description="toolTipText"
|
|
114
|
+
self="bottom middle"
|
|
115
|
+
/>
|
|
94
116
|
</q-icon>
|
|
95
117
|
</label>
|
|
96
118
|
<q-select
|
|
97
|
-
|
|
98
|
-
|
|
119
|
+
v-bind="$attrs"
|
|
120
|
+
class="u-multi-select"
|
|
99
121
|
:class="`field-${size}`"
|
|
100
|
-
|
|
122
|
+
options-selected-class="primary bg-blue-1"
|
|
123
|
+
bottom-slots
|
|
101
124
|
:color="color"
|
|
125
|
+
hide-bottom-space
|
|
126
|
+
id="multi-select"
|
|
127
|
+
:menu-offset="[0, 5]"
|
|
128
|
+
:modelValue="modelValue"
|
|
102
129
|
multiple
|
|
103
|
-
:options="options"
|
|
104
|
-
:use-input="useInput"
|
|
105
130
|
:option-label="optionLabel"
|
|
106
131
|
:option-value="optionValue"
|
|
107
|
-
:
|
|
108
|
-
dropdown-icon="img:icons/caret-down.svg"
|
|
109
|
-
bottom-slots
|
|
132
|
+
:options="options"
|
|
110
133
|
outlined
|
|
111
|
-
|
|
134
|
+
:placeholder="placeholderText"
|
|
135
|
+
popup-content-class="u-option-menu"
|
|
112
136
|
use-chips
|
|
113
|
-
:
|
|
114
|
-
options-selected-class="primary bg-blue-1"
|
|
115
|
-
popup-content-class="u-options-menu"
|
|
116
|
-
v-bind="$attrs"
|
|
137
|
+
:use-input="useInput"
|
|
117
138
|
@add="
|
|
118
139
|
(details) =>
|
|
119
140
|
updateFn({
|
|
@@ -121,6 +142,7 @@ const props = defineProps({
|
|
|
121
142
|
multiSelect,
|
|
122
143
|
})
|
|
123
144
|
"
|
|
145
|
+
@filter="filterFn"
|
|
124
146
|
@remove="
|
|
125
147
|
(details) =>
|
|
126
148
|
updateFn({
|
|
@@ -128,8 +150,7 @@ const props = defineProps({
|
|
|
128
150
|
...details,
|
|
129
151
|
})
|
|
130
152
|
"
|
|
131
|
-
@update:model-value="(val) =>
|
|
132
|
-
@filter="filterFn"
|
|
153
|
+
@update:model-value="(val) => updateVal(val)"
|
|
133
154
|
>
|
|
134
155
|
<template v-slot:no-option>
|
|
135
156
|
<q-item>
|
|
@@ -140,12 +161,12 @@ const props = defineProps({
|
|
|
140
161
|
</template>
|
|
141
162
|
|
|
142
163
|
<template v-if="leftIcon" v-slot:prepend>
|
|
143
|
-
<q-icon :class="leftIcon" size="
|
|
164
|
+
<q-icon :class="leftIcon" size="1rem" />
|
|
144
165
|
</template>
|
|
145
166
|
|
|
146
167
|
<template v-if="hintText" v-slot:hint>
|
|
147
168
|
<div class="row no-wrap items-center">
|
|
148
|
-
<q-icon :class="hintIcon" size="1rem"
|
|
169
|
+
<q-icon v-if="hintIcon" :class="hintIcon" size="1rem"/>
|
|
149
170
|
|
|
150
171
|
<div class="q-mx-xxs text-body-xs">
|
|
151
172
|
{{ hintText }}
|
|
@@ -154,8 +175,8 @@ const props = defineProps({
|
|
|
154
175
|
</template>
|
|
155
176
|
|
|
156
177
|
<template v-slot:option="scope">
|
|
157
|
-
<q-item class="items-center u-custom-
|
|
158
|
-
<div
|
|
178
|
+
<q-item v-bind="scope.itemProps" class="items-center u-custom-options">
|
|
179
|
+
<div v-if="scope.opt.icon" class="q-pr-xs">
|
|
159
180
|
<q-icon :class="scope.opt.icon" color="neutral-13" size="1rem" />
|
|
160
181
|
</div>
|
|
161
182
|
|
|
@@ -172,33 +193,32 @@ const props = defineProps({
|
|
|
172
193
|
<q-icon
|
|
173
194
|
class="fa-kit-duotone fa-circle-check"
|
|
174
195
|
color="primary"
|
|
175
|
-
size="
|
|
196
|
+
size="1rem"
|
|
176
197
|
/>
|
|
177
198
|
</q-item-section>
|
|
178
199
|
</q-item>
|
|
179
200
|
</template>
|
|
180
201
|
<template v-slot:selected-item="scope">
|
|
181
|
-
<
|
|
182
|
-
|
|
183
|
-
|
|
202
|
+
<UChip
|
|
203
|
+
v-model="chipModelVal"
|
|
204
|
+
dense
|
|
205
|
+
:chipLabel="scope.opt.label"
|
|
206
|
+
:removable="true"
|
|
184
207
|
:tabindex="scope.tabindex"
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
icon-remove="img:icons/circle-xmark.svg"
|
|
188
|
-
>
|
|
189
|
-
{{ scope.opt.label }}
|
|
190
|
-
</q-chip>
|
|
208
|
+
@remove="scope.removeAtIndex(scope.index)"
|
|
209
|
+
/>
|
|
191
210
|
</template>
|
|
192
211
|
</q-select>
|
|
193
212
|
</div>
|
|
194
213
|
</template>
|
|
195
214
|
|
|
196
215
|
<style lang="sass">
|
|
197
|
-
.u-select
|
|
216
|
+
.u-multi-select
|
|
198
217
|
&.q-field--auto-height .q-field__control,
|
|
199
218
|
&.q-field--auto-height .q-field__native
|
|
200
219
|
min-height: $md
|
|
201
220
|
align-items: center
|
|
221
|
+
padding: 0px
|
|
202
222
|
|
|
203
223
|
&.q-field--outlined .q-field__control
|
|
204
224
|
border-radius: $xs
|
|
@@ -227,7 +247,7 @@ const props = defineProps({
|
|
|
227
247
|
padding-bottom: 0
|
|
228
248
|
|
|
229
249
|
.q-field__control:focus-within
|
|
230
|
-
box-shadow : 0 0 0 2px
|
|
250
|
+
box-shadow : 0 0 0 2px $primary-transparent
|
|
231
251
|
|
|
232
252
|
.q-field__bottom
|
|
233
253
|
padding: 4px 0 0 0
|
|
@@ -238,31 +258,17 @@ const props = defineProps({
|
|
|
238
258
|
.q-field__prepend
|
|
239
259
|
padding-right: $xs
|
|
240
260
|
|
|
241
|
-
.u-
|
|
261
|
+
.u-option-menu
|
|
242
262
|
border-radius: $xs
|
|
243
|
-
box-shadow:
|
|
263
|
+
box-shadow: $shadow-2
|
|
244
264
|
max-height: 11.25rem !important
|
|
245
265
|
width: 18rem
|
|
246
266
|
overflow-y: auto
|
|
247
267
|
scrollbar-width: none
|
|
248
268
|
|
|
249
|
-
.
|
|
250
|
-
border-radius: $xs
|
|
251
|
-
box-shadow: 0px 0px 4px 0px rgba(16, 17, 20, 0.08)
|
|
252
|
-
height: 3.125rem
|
|
253
|
-
|
|
254
|
-
.u-custom-option
|
|
269
|
+
.u-custom-options
|
|
255
270
|
margin: $xxs
|
|
256
271
|
border-radius: $xxs
|
|
257
272
|
padding: $xs
|
|
258
273
|
min-height: $lg
|
|
259
|
-
|
|
260
|
-
.u-chip
|
|
261
|
-
min-height: $ms
|
|
262
|
-
|
|
263
|
-
.q-icon
|
|
264
|
-
font-size: 0.75rem
|
|
265
|
-
|
|
266
|
-
.q-chip__icon--remove
|
|
267
|
-
margin-left: $xs
|
|
268
274
|
</style>
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { ref, watch } from 'vue'
|
|
3
|
+
import USelectStd from './USelectStd.vue'
|
|
4
|
+
const props = defineProps({
|
|
5
|
+
modelValue: {
|
|
6
|
+
type: Number,
|
|
7
|
+
default: 1,
|
|
8
|
+
},
|
|
9
|
+
rowPerPage: {
|
|
10
|
+
type: Number,
|
|
11
|
+
default: 5,
|
|
12
|
+
},
|
|
13
|
+
maxPageLink: {
|
|
14
|
+
//Maximum number of page links to display at a time
|
|
15
|
+
type: Number,
|
|
16
|
+
default: 2,
|
|
17
|
+
},
|
|
18
|
+
maxPages: {
|
|
19
|
+
type: Number,
|
|
20
|
+
default: 10,
|
|
21
|
+
},
|
|
22
|
+
perPageOptions: {
|
|
23
|
+
type: Array,
|
|
24
|
+
default: () => [
|
|
25
|
+
{ label: '5 / per page', value: 5 },
|
|
26
|
+
{ label: '10 / per page', value: 10 },
|
|
27
|
+
{ label: '15 / per page', value: 15 },
|
|
28
|
+
{ label: '20 / per page', value: 20 },
|
|
29
|
+
],
|
|
30
|
+
},
|
|
31
|
+
})
|
|
32
|
+
const emit = defineEmits(['update:modelValue', 'onRowChange', 'onPageChange'])
|
|
33
|
+
const rowPerPage = ref(props.rowPerPage)
|
|
34
|
+
const currentPage = ref(props.modelValue)
|
|
35
|
+
|
|
36
|
+
watch(currentPage, (newValue) => {
|
|
37
|
+
emit('update:modelValue', newValue)
|
|
38
|
+
emit('onPageChange', newValue)
|
|
39
|
+
})
|
|
40
|
+
const onPageChange = (newPage) => {
|
|
41
|
+
currentPage.value = newPage
|
|
42
|
+
}
|
|
43
|
+
const onRowChange = (newRowPerPage) => {
|
|
44
|
+
emit('onRowChange', newRowPerPage)
|
|
45
|
+
}
|
|
46
|
+
</script>
|
|
47
|
+
|
|
48
|
+
<template>
|
|
49
|
+
<div class="row u-pagination-container">
|
|
50
|
+
<q-pagination
|
|
51
|
+
class="u-pagination"
|
|
52
|
+
v-model="currentPage"
|
|
53
|
+
direction-links
|
|
54
|
+
flat
|
|
55
|
+
color="dark"
|
|
56
|
+
active-color="primary"
|
|
57
|
+
:max="maxPages"
|
|
58
|
+
:max-pages="maxPageLink"
|
|
59
|
+
boundary-numbers
|
|
60
|
+
@update:model-value="onPageChange"
|
|
61
|
+
gutter="sm"
|
|
62
|
+
/>
|
|
63
|
+
|
|
64
|
+
<USelectStd
|
|
65
|
+
class="q-gutter-x-sm text-body-sm perpage-dropdown"
|
|
66
|
+
v-model="rowPerPage"
|
|
67
|
+
color="primary"
|
|
68
|
+
:options="perPageOptions"
|
|
69
|
+
popupClass="pagination-dropdown"
|
|
70
|
+
@update:model-value="onRowChange"
|
|
71
|
+
/>
|
|
72
|
+
</div>
|
|
73
|
+
</template>
|
|
74
|
+
|
|
75
|
+
<style lang="sass">
|
|
76
|
+
.pagination-dropdown
|
|
77
|
+
width: auto !important
|
|
78
|
+
|
|
79
|
+
.perpage-dropdown
|
|
80
|
+
width: 9.375rem
|
|
81
|
+
.q-field__marginal
|
|
82
|
+
padding-left: $xs
|
|
83
|
+
.q-field--outlined .q-field__control
|
|
84
|
+
display: inline-flex
|
|
85
|
+
width: 8.75rem
|
|
86
|
+
|
|
87
|
+
.u-pagination
|
|
88
|
+
.q-icon
|
|
89
|
+
font-size: $ba
|
|
90
|
+
.q-btn
|
|
91
|
+
background: $neutral-1
|
|
92
|
+
border-radius: $xs
|
|
93
|
+
width: $md
|
|
94
|
+
height: $md
|
|
95
|
+
font-size: $sm
|
|
96
|
+
font-style: normal
|
|
97
|
+
font-weight: 500
|
|
98
|
+
line-height: 1.25rem
|
|
99
|
+
letter-spacing: .03333rem
|
|
100
|
+
&:hover
|
|
101
|
+
background: $blue-1
|
|
102
|
+
&::before
|
|
103
|
+
box-shadow: none
|
|
104
|
+
</style>
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed } from 'vue'
|
|
3
|
+
import URadioStd from './URadioStd.vue'
|
|
4
|
+
const props = defineProps({
|
|
5
|
+
iconClass: {
|
|
6
|
+
type: String,
|
|
7
|
+
default: '',
|
|
8
|
+
},
|
|
9
|
+
label: {
|
|
10
|
+
type: String,
|
|
11
|
+
default: '',
|
|
12
|
+
},
|
|
13
|
+
description: {
|
|
14
|
+
type: String,
|
|
15
|
+
default: '',
|
|
16
|
+
},
|
|
17
|
+
value: {
|
|
18
|
+
type: String,
|
|
19
|
+
default: '',
|
|
20
|
+
},
|
|
21
|
+
image: {
|
|
22
|
+
type: String,
|
|
23
|
+
default: '',
|
|
24
|
+
},
|
|
25
|
+
imgAriaLabel: {
|
|
26
|
+
type: String,
|
|
27
|
+
default: '',
|
|
28
|
+
},
|
|
29
|
+
altText: {
|
|
30
|
+
type: String,
|
|
31
|
+
default: '',
|
|
32
|
+
},
|
|
33
|
+
iconColor: {
|
|
34
|
+
type: String,
|
|
35
|
+
default: 'primary',
|
|
36
|
+
},
|
|
37
|
+
|
|
38
|
+
id: { String },
|
|
39
|
+
})
|
|
40
|
+
|
|
41
|
+
const emit = defineEmits(['onClick', 'onButtonClick'])
|
|
42
|
+
const model = defineModel()
|
|
43
|
+
|
|
44
|
+
const handleChange = () => {
|
|
45
|
+
model.value = props.value
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const activeClass = computed(() => {
|
|
49
|
+
if (model.value === props.value) {
|
|
50
|
+
return 'active'
|
|
51
|
+
}
|
|
52
|
+
return ''
|
|
53
|
+
})
|
|
54
|
+
</script>
|
|
55
|
+
|
|
56
|
+
<template>
|
|
57
|
+
<q-btn flat class="u-radio-btn" @click="handleChange" :class="activeClass">
|
|
58
|
+
<div class="radio-btn-content flex items-center">
|
|
59
|
+
<URadioStd v-model="model" :value="value" :id="id" :aria-label="label" />
|
|
60
|
+
<div class="button-text">
|
|
61
|
+
<div class="text-caption-lg">{{ label }}</div>
|
|
62
|
+
<div class="description-text text-body-sm">{{ description }}</div>
|
|
63
|
+
</div>
|
|
64
|
+
|
|
65
|
+
<img
|
|
66
|
+
class="radio-btn-img"
|
|
67
|
+
v-if="image"
|
|
68
|
+
size="1.5rem"
|
|
69
|
+
:src="image"
|
|
70
|
+
:alt="altText"
|
|
71
|
+
:aria-label="imgAriaLabel"
|
|
72
|
+
/>
|
|
73
|
+
<q-icon
|
|
74
|
+
v-if="iconClass"
|
|
75
|
+
:aria-label="imgAriaLabel"
|
|
76
|
+
:color="iconColor"
|
|
77
|
+
size="1.5rem"
|
|
78
|
+
:class="iconClass"
|
|
79
|
+
/>
|
|
80
|
+
</div>
|
|
81
|
+
</q-btn>
|
|
82
|
+
</template>
|
|
83
|
+
|
|
84
|
+
<style lang="sass">
|
|
85
|
+
.u-radio-btn
|
|
86
|
+
padding: $xs $sm
|
|
87
|
+
border: 2px solid $neutral-4
|
|
88
|
+
border-radius: $xs
|
|
89
|
+
min-height: $lg
|
|
90
|
+
.q-radio__label
|
|
91
|
+
padding-left: 0 !important
|
|
92
|
+
|
|
93
|
+
.radio-btn-content
|
|
94
|
+
gap: $xs
|
|
95
|
+
|
|
96
|
+
.button-text
|
|
97
|
+
text-align: left !important
|
|
98
|
+
min-width: 6.063rem
|
|
99
|
+
|
|
100
|
+
.description-text
|
|
101
|
+
color: $description
|
|
102
|
+
|
|
103
|
+
.radio-btn-img
|
|
104
|
+
width: $ms
|
|
105
|
+
height: $ms
|
|
106
|
+
|
|
107
|
+
.active
|
|
108
|
+
border: 2px solid $primary
|
|
109
|
+
|
|
110
|
+
.u-radio-btn:hover
|
|
111
|
+
border: 2px solid $primary
|
|
112
|
+
background-color: $primary-transparent
|
|
113
|
+
|
|
114
|
+
.q-radio .q-radio__inner
|
|
115
|
+
color: $primary !important
|
|
116
|
+
</style>
|
|
@@ -4,7 +4,9 @@ import { onMounted } from 'vue'
|
|
|
4
4
|
const props = defineProps({
|
|
5
5
|
label: {
|
|
6
6
|
type: String,
|
|
7
|
-
|
|
7
|
+
},
|
|
8
|
+
ariaLabel: {
|
|
9
|
+
type: String,
|
|
8
10
|
},
|
|
9
11
|
value: {
|
|
10
12
|
type: String,
|
|
@@ -31,7 +33,9 @@ const radioValue = defineModel()
|
|
|
31
33
|
</script>
|
|
32
34
|
|
|
33
35
|
<template>
|
|
34
|
-
<label class="hidden" :for="id"
|
|
36
|
+
<label class="hidden" :for="id" v-if="label || ariaLabel">{{
|
|
37
|
+
label || ariaLabel
|
|
38
|
+
}}</label>
|
|
35
39
|
<q-radio
|
|
36
40
|
v-model="radioValue"
|
|
37
41
|
class="u-radio"
|
|
@@ -43,7 +47,7 @@ const radioValue = defineModel()
|
|
|
43
47
|
:disable="disable"
|
|
44
48
|
:id="id"
|
|
45
49
|
>
|
|
46
|
-
<div class="text-center text-caption-lg radio-label">
|
|
50
|
+
<div class="text-center text-caption-lg radio-label" v-if="label">
|
|
47
51
|
{{ label }}
|
|
48
52
|
</div>
|
|
49
53
|
</q-radio>
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { computed } from 'vue'
|
|
3
|
+
import UAvatar from './UAvatar.vue'
|
|
4
|
+
import UMenuItem from './UMenuItem.vue'
|
|
3
5
|
import UTooltip from './UTooltip.vue'
|
|
4
6
|
|
|
7
|
+
const emit = defineEmits(['update:modelValue'])
|
|
8
|
+
|
|
5
9
|
const props = defineProps({
|
|
6
10
|
label: {
|
|
7
11
|
type: String,
|
|
8
|
-
required: true,
|
|
9
12
|
},
|
|
10
13
|
modelValue: {
|
|
11
|
-
type: String,
|
|
14
|
+
type: [String, Number],
|
|
12
15
|
requried: true,
|
|
13
16
|
},
|
|
14
17
|
options: {
|
|
@@ -46,6 +49,10 @@ const props = defineProps({
|
|
|
46
49
|
type: Boolean,
|
|
47
50
|
required: false,
|
|
48
51
|
},
|
|
52
|
+
disableAvatar: {
|
|
53
|
+
type: Boolean,
|
|
54
|
+
default: true,
|
|
55
|
+
},
|
|
49
56
|
size: {
|
|
50
57
|
type: String,
|
|
51
58
|
default: 'md',
|
|
@@ -63,10 +70,16 @@ const props = defineProps({
|
|
|
63
70
|
type: String,
|
|
64
71
|
default: 'neutral-7',
|
|
65
72
|
},
|
|
73
|
+
popupClass: {
|
|
74
|
+
type: String,
|
|
75
|
+
default: '',
|
|
76
|
+
},
|
|
77
|
+
showErrorIcon: {
|
|
78
|
+
type: Boolean,
|
|
79
|
+
default: false,
|
|
80
|
+
},
|
|
66
81
|
})
|
|
67
82
|
|
|
68
|
-
const emit = defineEmits(['update:modelValue'])
|
|
69
|
-
|
|
70
83
|
const model = computed({
|
|
71
84
|
get() {
|
|
72
85
|
return props.modelValue
|
|
@@ -79,48 +92,48 @@ const model = computed({
|
|
|
79
92
|
|
|
80
93
|
<template>
|
|
81
94
|
<section class="column q-gutter-y-xs">
|
|
82
|
-
<label
|
|
95
|
+
<label class="row items-center" for="select">
|
|
83
96
|
<div class="u-select-label text-body-sm">
|
|
84
|
-
{{ label }}
|
|
85
|
-
<span class="text-red-5 q-ml-xs"
|
|
97
|
+
<span>{{ label }}</span>
|
|
98
|
+
<span v-if="isRequired" class="text-red-5 q-ml-xs">*</span>
|
|
86
99
|
</div>
|
|
87
100
|
|
|
88
101
|
<q-icon
|
|
89
|
-
class="q-ml-xs fa-kit-duotone fa-circle-info cursor-pointer"
|
|
90
102
|
v-if="toolTipText"
|
|
91
|
-
|
|
92
|
-
color="neutral-9"
|
|
103
|
+
class="q-ml-xs fa-kit-duotone fa-circle-info cursor-pointer"
|
|
93
104
|
aria-hidden="true"
|
|
105
|
+
color="neutral-9"
|
|
106
|
+
size="1rem"
|
|
94
107
|
>
|
|
95
108
|
<UTooltip
|
|
96
|
-
:description="toolTipText"
|
|
97
109
|
anchor="top middle"
|
|
110
|
+
:description="toolTipText"
|
|
98
111
|
self="bottom middle"
|
|
99
112
|
/>
|
|
100
113
|
</q-icon>
|
|
101
114
|
</label>
|
|
102
115
|
|
|
103
116
|
<q-select
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
117
|
+
v-bind="$attrs"
|
|
118
|
+
v-model="model"
|
|
119
|
+
:class="`u-select field-${size}`"
|
|
120
|
+
:popup-content-class="`u-options-menu ${popupClass}`"
|
|
121
|
+
bottom-slots
|
|
107
122
|
:color="color"
|
|
108
|
-
dropdown-icon="img:icons/caret-down.svg"
|
|
109
123
|
emit-value
|
|
124
|
+
hide-bottom-space
|
|
125
|
+
id="select"
|
|
126
|
+
map-options
|
|
110
127
|
:menu-offset="[0, 5]"
|
|
111
|
-
:
|
|
128
|
+
:no-error-icon="!showErrorIcon"
|
|
112
129
|
:option-label="optionLabel"
|
|
130
|
+
:option-value="optionValue"
|
|
113
131
|
:options="options"
|
|
114
|
-
outlined
|
|
115
132
|
options-selected-class="primary bg-blue-1"
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
hide-bottom-space
|
|
119
|
-
bottom-slots
|
|
120
|
-
v-bind="$attrs"
|
|
133
|
+
outlined
|
|
134
|
+
:placeholder="placeholder"
|
|
121
135
|
:use-input="useInput"
|
|
122
136
|
@filter="filterFn"
|
|
123
|
-
:placeholder="placeholder"
|
|
124
137
|
>
|
|
125
138
|
<template v-slot:no-option>
|
|
126
139
|
<q-item>
|
|
@@ -135,9 +148,8 @@ const model = computed({
|
|
|
135
148
|
</template>
|
|
136
149
|
|
|
137
150
|
<template v-if="hintText" v-slot:hint>
|
|
138
|
-
<div class="row no-wrap items-center">
|
|
139
|
-
<q-icon :class="hintIcon" size="1rem"
|
|
140
|
-
|
|
151
|
+
<div class="row no-wrap items-center text-neutral-9">
|
|
152
|
+
<q-icon v-if="hintIcon" :class="hintIcon" size="1rem" />
|
|
141
153
|
<div class="q-mx-xxs text-body-xs">
|
|
142
154
|
{{ hintText }}
|
|
143
155
|
</div>
|
|
@@ -145,28 +157,38 @@ const model = computed({
|
|
|
145
157
|
</template>
|
|
146
158
|
|
|
147
159
|
<template v-slot:option="scope">
|
|
148
|
-
<
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
size="
|
|
167
|
-
|
|
168
|
-
</
|
|
169
|
-
|
|
160
|
+
<UMenuItem
|
|
161
|
+
v-bind="scope.itemProps"
|
|
162
|
+
class="q-ma-xxs"
|
|
163
|
+
iconClass="icon-secondary-opacity"
|
|
164
|
+
:label="scope.opt.label"
|
|
165
|
+
:leftIcon="scope.opt.leftIcon"
|
|
166
|
+
:rightIcon="scope.opt.rightIcon"
|
|
167
|
+
:selected="scope.selected"
|
|
168
|
+
>
|
|
169
|
+
<template #leading_slot>
|
|
170
|
+
<slot name="leading_slot" />
|
|
171
|
+
<div v-if="!disableAvatar">
|
|
172
|
+
<UAvatar
|
|
173
|
+
v-if="scope.opt.avatarUrl"
|
|
174
|
+
:image="scope.opt.avatarUrl"
|
|
175
|
+
:name="scope.opt.label"
|
|
176
|
+
size="md"
|
|
177
|
+
/>
|
|
178
|
+
<UAvatar v-else :name="scope.opt.label" size="md" />
|
|
179
|
+
</div>
|
|
180
|
+
</template>
|
|
181
|
+
<template #trailing_slot>
|
|
182
|
+
<slot name="trailing_slot">
|
|
183
|
+
<q-icon
|
|
184
|
+
v-if="scope.selected"
|
|
185
|
+
class="fa-kit-duotone fa-circle-check"
|
|
186
|
+
color="primary"
|
|
187
|
+
size="1rem"
|
|
188
|
+
/>
|
|
189
|
+
</slot>
|
|
190
|
+
</template>
|
|
191
|
+
</UMenuItem>
|
|
170
192
|
</template>
|
|
171
193
|
</q-select>
|
|
172
194
|
</section>
|
|
@@ -216,20 +238,13 @@ const model = computed({
|
|
|
216
238
|
|
|
217
239
|
.u-options-menu
|
|
218
240
|
border-radius: $xs
|
|
219
|
-
box-shadow:
|
|
241
|
+
box-shadow: $shadow-2
|
|
220
242
|
max-height: 11.25rem !important
|
|
221
243
|
width: 18rem
|
|
222
244
|
overflow-y: auto
|
|
223
245
|
scrollbar-width: none
|
|
224
246
|
|
|
225
|
-
.
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
height: 3.125rem
|
|
229
|
-
|
|
230
|
-
.u-custom-option
|
|
231
|
-
margin: $xxs
|
|
232
|
-
border-radius: $xxs
|
|
233
|
-
padding: $xs
|
|
234
|
-
min-height: $lg
|
|
247
|
+
.u-options-menu
|
|
248
|
+
.q-item:last-child
|
|
249
|
+
margin-bottom: $xxs
|
|
235
250
|
</style>
|