@usssa/component-library 1.0.0-alpha.31 → 1.0.0-alpha.33
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/package.json +1 -1
- package/src/assets/logo.svg +19 -0
- package/src/components/core/UBtnIcon.vue +18 -14
- package/src/components/core/UBtnStd.vue +1 -0
- package/src/components/core/UInnerLoader.vue +58 -0
- package/src/components/core/UMenuButtonStd.vue +274 -0
- package/src/components/index.js +5 -1
- package/src/layouts/MainLayout.vue +8 -0
- package/src/pages/InnerLoader.vue +81 -0
- package/src/pages/MenuButton.vue +194 -0
- package/src/router/routes.js +8 -0
package/package.json
CHANGED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<svg width="95" height="24" viewBox="0 0 95 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<g id="Logo">
|
|
3
|
+
<g id="Lettering">
|
|
4
|
+
<path d="M3.80408 2.66675H8.95923L4.80595 13.2946L11.6168 13.2333L15.8059 2.66675H20.8L16.7704 12.978C15.8482 15.3379 13.5896 16.889 11.0754 16.889H3.24023L3.23972 16.8853C0.95221 16.7796 -0.597379 14.4417 0.221722 12.2504L3.80408 2.66675Z" fill="#234BA9"/>
|
|
5
|
+
<path d="M25.3431 2.66675C24.1871 2.66675 23.1592 3.40891 22.7861 4.5129L22.2017 6.24262L21.3962 8.1931L20.9479 9.20419C20.5153 10.1799 21.2229 11.2814 22.2822 11.2814H30.0955L29.3215 13.3117H19.4306L17.9807 16.8876H30.4658C31.6432 16.8876 32.7118 16.1933 33.199 15.1119L34.01 13.3117H33.9934L34.7674 11.2814H34.7746L35.0296 10.6669C35.5176 9.49105 34.6615 8.1931 33.398 8.1931H26.3902L27.1957 6.24262H36.3783L37.8282 2.66675H25.3431Z" fill="#234BA9"/>
|
|
6
|
+
<path d="M65.9075 2.66675C64.7515 2.66675 63.7235 3.40891 63.3505 4.5129L62.7661 6.24262L61.9606 8.1931L61.5123 9.20419C61.0797 10.1799 61.7873 11.2814 62.8466 11.2814H70.6599L69.8859 13.3117H59.995L58.5451 16.8876H71.0302C72.2076 16.8876 73.2762 16.1933 73.7634 15.1119L74.5744 13.3117H74.5578L75.3318 11.2814H75.339L75.594 10.6669C76.0819 9.49105 75.2259 8.1931 73.9624 8.1931H66.9546L67.7601 6.24262H76.9427L78.3926 2.66675H65.9075Z" fill="#234BA9"/>
|
|
7
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M92.0723 2.66675H80.9702L79.6009 6.24262H89.5386L88.7205 8.27437H81.103C79.3981 8.27437 77.8944 9.40113 77.4017 11.0479L76.8451 12.908C76.2519 14.8906 77.7229 16.8889 79.7755 16.8888L90.3945 16.8883L93.6818 8.51818H93.697L94.5025 6.24262C95.162 4.52034 93.9023 2.66675 92.0723 2.66675ZM81.373 13.3131L82.259 11.2001H87.6558L86.7698 13.3131H81.373Z" fill="#234BA9"/>
|
|
8
|
+
</g>
|
|
9
|
+
<path id="top" d="M47.7783 0.00113767H62.8782C61.1471 3.8405 58.0313 4.88033 55.3948 4.88033H49.6691V1.41424L47.2456 4.88033H43.464L45.8076 6.95998L43.464 10.3994L47.3255 8.34642L49.6957 10.4794L49.6691 6.95998H54.5426C58.271 6.93332 58.8036 10.4794 58.1378 11.8125H42.7184C41.3069 11.8125 37.1258 10.7724 39.0166 5.76018C40.7743 1.78735 44.982 -0.0524702 47.7783 0.00113767Z" fill="#234BA9"/>
|
|
10
|
+
<g id="bottom">
|
|
11
|
+
<path d="M32.3588 20.1976C32.705 18.5712 34.7556 15.5317 38.484 15.2917H46.1804C46.3668 15.2917 46.8835 15.2704 47.2456 14.5452L47.7516 13.1987H57.6318C57.2324 14.2741 55.7943 16.5448 52.6518 16.7315H46.5532C46.5 16.7315 45.6899 16.8463 45.3282 17.6913C44.9287 18.6245 44.2097 18.7845 43.8368 18.8111H35.9007C35.2616 18.8378 33.7702 19.0511 32.3588 20.1976Z" fill="#CB2A3D"/>
|
|
12
|
+
<path d="M56.1937 16.7181C55.7943 18.3445 53.8875 21.4054 50.0952 21.5973H44.1032C43.5439 21.6507 42.9484 21.7679 42.6118 22.6105C42.2603 23.4904 41.4933 23.7037 40.9873 23.7037H30.8674C31.258 22.6372 32.7902 20.4455 35.7942 20.2109H43.5173C43.7658 20.202 44.2363 20.1842 44.6092 19.3044C44.982 18.4245 45.2217 18.1312 46.0639 18.1046H52.6252C53.1844 18.1135 54.8089 17.838 56.1937 16.7181Z" fill="#CB2A3D"/>
|
|
13
|
+
</g>
|
|
14
|
+
<g id="shadow">
|
|
15
|
+
<path d="M49.7491 13.1987L48.3643 16.7315H46.7132C46.367 16.7493 45.6394 16.9261 45.2985 17.758L46.2871 15.2864C46.4735 15.2784 46.8996 15.1611 47.2192 14.5852L47.7518 13.1987H49.7491Z" fill="#951F23"/>
|
|
16
|
+
<path d="M42.6119 22.6114L42.6274 22.5736C42.959 21.7945 43.8175 21.5982 44.2631 21.5982H45.6745L47.0594 18.1055H46.0474C45.1419 18.0788 44.8377 18.6727 44.5747 19.3844C44.4761 19.651 44.1299 20.1538 43.5973 20.2072L42.6274 22.5736C42.6221 22.586 42.617 22.5986 42.6119 22.6114Z" fill="#951F23"/>
|
|
17
|
+
</g>
|
|
18
|
+
</g>
|
|
19
|
+
</svg>
|
|
@@ -89,20 +89,24 @@ const btnClass = computed(() => {
|
|
|
89
89
|
class="u-btn-icon"
|
|
90
90
|
:class="`size-${size} ${btnClass}`"
|
|
91
91
|
>
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
92
|
+
|
|
93
|
+
<template #default>
|
|
94
|
+
<q-icon
|
|
95
|
+
:color="iconColor"
|
|
96
|
+
:aria-hidden="true"
|
|
97
|
+
:class="`${iconClass} size-${size}`"
|
|
98
|
+
:size="iconSize"
|
|
99
|
+
/>
|
|
100
|
+
|
|
101
|
+
<UTooltip
|
|
102
|
+
v-if="tooltip"
|
|
103
|
+
:description="tooltip"
|
|
104
|
+
:anchor="anchor"
|
|
105
|
+
:self="self"
|
|
106
|
+
:offset="offset"
|
|
107
|
+
/>
|
|
108
|
+
<slot name="menu" />
|
|
109
|
+
</template>
|
|
106
110
|
</q-btn>
|
|
107
111
|
</template>
|
|
108
112
|
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
defineProps({
|
|
3
|
+
loading: {
|
|
4
|
+
type: Boolean,
|
|
5
|
+
required: true,
|
|
6
|
+
},
|
|
7
|
+
loadingMessage: {
|
|
8
|
+
type: String,
|
|
9
|
+
required: true,
|
|
10
|
+
},
|
|
11
|
+
image: {
|
|
12
|
+
type: String,
|
|
13
|
+
required: true,
|
|
14
|
+
},
|
|
15
|
+
spinnerColor: {
|
|
16
|
+
type: String,
|
|
17
|
+
required: false,
|
|
18
|
+
},
|
|
19
|
+
spinnerSize: {
|
|
20
|
+
type: String,
|
|
21
|
+
requried: false,
|
|
22
|
+
default: '2rem',
|
|
23
|
+
},
|
|
24
|
+
imageHeight: {
|
|
25
|
+
type: String,
|
|
26
|
+
},
|
|
27
|
+
imageWidth: {
|
|
28
|
+
type: String,
|
|
29
|
+
},
|
|
30
|
+
})
|
|
31
|
+
</script>
|
|
32
|
+
<template>
|
|
33
|
+
<q-inner-loading :showing="loading" color="primary" v-bind="$attrs">
|
|
34
|
+
<div class="column items-center q-gutter-y-sm">
|
|
35
|
+
<img
|
|
36
|
+
class="q-my-none"
|
|
37
|
+
alt="Loader Image"
|
|
38
|
+
:src="image"
|
|
39
|
+
:width="imageWidth"
|
|
40
|
+
:height="imageHeight"
|
|
41
|
+
/>
|
|
42
|
+
<div class="row items-center">
|
|
43
|
+
<div v-if="loadingMessage">
|
|
44
|
+
<span class="message q-mr-sm">{{ loadingMessage }}</span>
|
|
45
|
+
</div>
|
|
46
|
+
<q-spinner-facebook :color="spinnerColor" :size="spinnerSize" />
|
|
47
|
+
</div>
|
|
48
|
+
</div>
|
|
49
|
+
</q-inner-loading>
|
|
50
|
+
</template>
|
|
51
|
+
<style scoped lang="sass">
|
|
52
|
+
.u-loader
|
|
53
|
+
position: relative
|
|
54
|
+
height: 100%
|
|
55
|
+
.message
|
|
56
|
+
color: $dark
|
|
57
|
+
font-weight: 500
|
|
58
|
+
</style>
|
|
@@ -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>
|
package/src/components/index.js
CHANGED
|
@@ -20,9 +20,11 @@ import UInputPhoneStd from './core/UInputPhoneStd.vue'
|
|
|
20
20
|
import UInputTextStd from './core/UInputTextStd.vue'
|
|
21
21
|
import UDialogStd from './core/UDialogStd.vue'
|
|
22
22
|
import URadioBtn from './core/URadioBtn.vue'
|
|
23
|
+
import UInnerLoader from './core/UInnerLoader.vue'
|
|
23
24
|
import UMenuItem from './core/UMenuItem.vue'
|
|
24
25
|
import UDrawer from './core/UDrawer.vue'
|
|
25
26
|
import UMenuDropdown from './core/UMenuDropdown.vue'
|
|
27
|
+
import UMenuButtonStd from './core/UMenuButtonStd.vue'
|
|
26
28
|
import UBreadCrumbs from './core/UBreadCrumbs.vue'
|
|
27
29
|
|
|
28
30
|
import { useNotify } from '../composables/useNotify.js'
|
|
@@ -51,7 +53,9 @@ export {
|
|
|
51
53
|
UDialogStd,
|
|
52
54
|
UInputPhoneStd,
|
|
53
55
|
UMenuItem,
|
|
56
|
+
UInnerLoader,
|
|
54
57
|
UDrawer,
|
|
55
58
|
UMenuDropdown,
|
|
56
|
-
|
|
59
|
+
UMenuButtonStd,
|
|
60
|
+
UBreadCrumbs
|
|
57
61
|
}
|
|
@@ -70,6 +70,10 @@ const components = [
|
|
|
70
70
|
title: 'Menu Item',
|
|
71
71
|
path: 'menu-item',
|
|
72
72
|
},
|
|
73
|
+
{
|
|
74
|
+
title: 'Menu Button',
|
|
75
|
+
path: 'menu-button',
|
|
76
|
+
},
|
|
73
77
|
{
|
|
74
78
|
title: 'MultiSelect',
|
|
75
79
|
path: 'multiselect-standard',
|
|
@@ -114,6 +118,10 @@ const components = [
|
|
|
114
118
|
title: 'Table',
|
|
115
119
|
path: '/table',
|
|
116
120
|
},
|
|
121
|
+
{
|
|
122
|
+
title: 'Inner Loader',
|
|
123
|
+
path: '/inner-loader',
|
|
124
|
+
},
|
|
117
125
|
]
|
|
118
126
|
|
|
119
127
|
const leftDrawerOpen = ref(true)
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { ref } from 'vue'
|
|
3
|
+
import UBtnStd from 'src/components/core/UBtnStd.vue'
|
|
4
|
+
import ComponentBase from './ComponentBase.vue'
|
|
5
|
+
import UInnerLoader from 'src/components/core/UInnerLoader.vue'
|
|
6
|
+
|
|
7
|
+
const colorOptions = ['primary', 'positive', 'accent', 'warning']
|
|
8
|
+
const color = ref('primary')
|
|
9
|
+
const message = ref('Loaing Data')
|
|
10
|
+
const image = ref('/src/assets/logo.svg')
|
|
11
|
+
const spinnerSize = ref(2)
|
|
12
|
+
const loading = ref(false)
|
|
13
|
+
|
|
14
|
+
const htmlContent = `<UInnerLoader
|
|
15
|
+
:loading="loading"
|
|
16
|
+
:image="image"
|
|
17
|
+
:loading-message="message"
|
|
18
|
+
:spinner-color="color"
|
|
19
|
+
:spinner-size="spinnerSize"
|
|
20
|
+
:image-width="imageWidth"
|
|
21
|
+
:image-height="imageHeight"
|
|
22
|
+
/>`
|
|
23
|
+
|
|
24
|
+
const showLoader = () => {
|
|
25
|
+
loading.value = true
|
|
26
|
+
|
|
27
|
+
setTimeout(() => {
|
|
28
|
+
loading.value = false
|
|
29
|
+
}, 2000)
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
defineOptions({
|
|
33
|
+
name: 'InnerLoader',
|
|
34
|
+
})
|
|
35
|
+
</script>
|
|
36
|
+
|
|
37
|
+
<template>
|
|
38
|
+
<q-page class="flex flex-center">
|
|
39
|
+
<ComponentBase figmaUrl="#">
|
|
40
|
+
<template v-slot:component>
|
|
41
|
+
<UBtnStd label="Show" color="primary" @on-click="showLoader" />
|
|
42
|
+
<div>
|
|
43
|
+
<div
|
|
44
|
+
style="height: 200px; width: 400px; position: relative"
|
|
45
|
+
class="q-mt-sm"
|
|
46
|
+
>
|
|
47
|
+
<span v-if="!loading">
|
|
48
|
+
This is a test message. When you click on the show button the
|
|
49
|
+
loader will be shown and the message will disappear, behaving like
|
|
50
|
+
if the data is being fetched.
|
|
51
|
+
</span>
|
|
52
|
+
<UInnerLoader
|
|
53
|
+
:image="image"
|
|
54
|
+
:loading="loading"
|
|
55
|
+
:loading-message="message"
|
|
56
|
+
:spinner-color="color"
|
|
57
|
+
:spinner-size="`${spinnerSize}rem`"
|
|
58
|
+
/>
|
|
59
|
+
</div>
|
|
60
|
+
</div>
|
|
61
|
+
</template>
|
|
62
|
+
|
|
63
|
+
<template v-slot:properties>
|
|
64
|
+
<div class="column q-gutter-y-lg">
|
|
65
|
+
<q-input label="Message" v-model="message" />
|
|
66
|
+
<q-input label="Spinner size (In rem)" v-model="spinnerSize" />
|
|
67
|
+
|
|
68
|
+
<q-select
|
|
69
|
+
v-model="color"
|
|
70
|
+
:options="colorOptions"
|
|
71
|
+
label="Spinner Color"
|
|
72
|
+
/>
|
|
73
|
+
</div>
|
|
74
|
+
</template>
|
|
75
|
+
|
|
76
|
+
<template v-slot:code>
|
|
77
|
+
<pre><code>{{ htmlContent }}</code></pre>
|
|
78
|
+
</template>
|
|
79
|
+
</ComponentBase>
|
|
80
|
+
</q-page>
|
|
81
|
+
</template>
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import ComponentBase from './ComponentBase.vue'
|
|
3
|
+
import UMenuButtonStd from '../components/core/UMenuButtonStd.vue'
|
|
4
|
+
import UMenuDropdown from '../components/core/UMenuDropdown.vue'
|
|
5
|
+
import { computed, ref } from 'vue'
|
|
6
|
+
|
|
7
|
+
// state of menu button
|
|
8
|
+
const anchor = ref('center left')
|
|
9
|
+
const ariaLabel = ref('Btn Icon')
|
|
10
|
+
const avatarUrl = ref('https://cdn.quasar.dev/img/avatar1.jpg')
|
|
11
|
+
const color = ref('primary')
|
|
12
|
+
const displayName = ref('Label')
|
|
13
|
+
const iconClass = ref('fa-kit-duotone fa-filter-list')
|
|
14
|
+
const label = ref('Label')
|
|
15
|
+
const menuOffset = ref([4, 4])
|
|
16
|
+
const states = ref('Basic')
|
|
17
|
+
const statesOptions = ['Basic', 'Icon', 'Button', 'Avatar', 'Prefix']
|
|
18
|
+
const size = ref('md')
|
|
19
|
+
const sizeOptions = ['sm', 'md', 'lg']
|
|
20
|
+
const self = ref('center end')
|
|
21
|
+
const selectedCountry = ref({
|
|
22
|
+
name: 'United States',
|
|
23
|
+
code: '+1',
|
|
24
|
+
flag: 'us',
|
|
25
|
+
})
|
|
26
|
+
const tooltip = ref('Tooltip')
|
|
27
|
+
const type = ref('standard')
|
|
28
|
+
|
|
29
|
+
const anchorOptions = [
|
|
30
|
+
'top left',
|
|
31
|
+
'top middle',
|
|
32
|
+
'top right',
|
|
33
|
+
'top start',
|
|
34
|
+
'top end',
|
|
35
|
+
'center left',
|
|
36
|
+
'center middle',
|
|
37
|
+
'center right',
|
|
38
|
+
'center start',
|
|
39
|
+
'center end',
|
|
40
|
+
'bottom left',
|
|
41
|
+
'bottom middle',
|
|
42
|
+
'bottom right',
|
|
43
|
+
'bottom start',
|
|
44
|
+
'bottom end',
|
|
45
|
+
]
|
|
46
|
+
|
|
47
|
+
const selfOptions = [
|
|
48
|
+
'top left',
|
|
49
|
+
'top middle',
|
|
50
|
+
'top right',
|
|
51
|
+
'top start',
|
|
52
|
+
'top end',
|
|
53
|
+
'center left',
|
|
54
|
+
'center middle',
|
|
55
|
+
'center right',
|
|
56
|
+
'center start',
|
|
57
|
+
'center end',
|
|
58
|
+
'bottom left',
|
|
59
|
+
'bottom middle',
|
|
60
|
+
'bottom right',
|
|
61
|
+
'bottom start',
|
|
62
|
+
'bottom end',
|
|
63
|
+
]
|
|
64
|
+
|
|
65
|
+
const htmlContent = `<UMenuButtonStd
|
|
66
|
+
ref="btn"
|
|
67
|
+
:size="size"
|
|
68
|
+
:label="label"
|
|
69
|
+
:states="states"
|
|
70
|
+
:color="colorClass"
|
|
71
|
+
:icon-class="iconClass"
|
|
72
|
+
:ariaLabel="ariaLabel"
|
|
73
|
+
:tooltip="tooltip"
|
|
74
|
+
:selected-country="selectedCountry"
|
|
75
|
+
@update-country="selectCountry"
|
|
76
|
+
:displayName="displayName"
|
|
77
|
+
:avatarUrl="avatarUrl"
|
|
78
|
+
:anchor="anchor"
|
|
79
|
+
:self="self"
|
|
80
|
+
:menu-offset="menuOffset"
|
|
81
|
+
>
|
|
82
|
+
<template #menu>
|
|
83
|
+
<q-menu>
|
|
84
|
+
<q-list>
|
|
85
|
+
<q-item clickable v-ripple>
|
|
86
|
+
<q-item-section>Option 1</q-item-section>
|
|
87
|
+
</q-item>
|
|
88
|
+
<q-item clickable v-ripple>
|
|
89
|
+
<q-item-section>Option 2</q-item-section>
|
|
90
|
+
</q-item>
|
|
91
|
+
</q-list>
|
|
92
|
+
</q-menu>
|
|
93
|
+
</template>
|
|
94
|
+
</UMenuButtonStd>`
|
|
95
|
+
|
|
96
|
+
defineOptions({
|
|
97
|
+
name: 'BtnStd',
|
|
98
|
+
})
|
|
99
|
+
|
|
100
|
+
const selectCountry = (value) => {
|
|
101
|
+
selectedCountry.value = value
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
const countryOptions = [
|
|
105
|
+
{ label: 'United States', code: '+1', leftIcon: 'fi fi-us' },
|
|
106
|
+
{ label: 'Canada', code: '+1', leftIcon: 'fi fi-ca' },
|
|
107
|
+
{ label: 'Mexico', code: '+52', leftIcon: 'fi fi-mx' },
|
|
108
|
+
]
|
|
109
|
+
|
|
110
|
+
const colorClass = computed(() => states.value === 'Avatar' ? 'neutral-2' : 'primary' )
|
|
111
|
+
</script>
|
|
112
|
+
|
|
113
|
+
<template>
|
|
114
|
+
<q-page class="flex flex-center">
|
|
115
|
+
<ComponentBase
|
|
116
|
+
figmaUrl="https://www.figma.com/design/2FoTrjVL4ZrTdsvB4DcSao/Components?node-id=3449-13467&node-type=instance&m=dev"
|
|
117
|
+
>
|
|
118
|
+
<template v-slot:component>
|
|
119
|
+
<UMenuButtonStd
|
|
120
|
+
ref="btn"
|
|
121
|
+
:size="size"
|
|
122
|
+
:label="label"
|
|
123
|
+
:states="states"
|
|
124
|
+
:color="colorClass"
|
|
125
|
+
:icon-class="iconClass"
|
|
126
|
+
:ariaLabel="ariaLabel"
|
|
127
|
+
:tooltip="tooltip"
|
|
128
|
+
:selected-country="selectedCountry"
|
|
129
|
+
@update-country="selectCountry"
|
|
130
|
+
:displayName="displayName"
|
|
131
|
+
:avatarUrl="avatarUrl"
|
|
132
|
+
:anchor="anchor"
|
|
133
|
+
:self="self"
|
|
134
|
+
:menu-offset="menuOffset"
|
|
135
|
+
>
|
|
136
|
+
<template #menu>
|
|
137
|
+
<!-- <q-menu>
|
|
138
|
+
<q-list>
|
|
139
|
+
<q-item clickable v-ripple>
|
|
140
|
+
<q-item-section>Option 1</q-item-section>
|
|
141
|
+
</q-item>
|
|
142
|
+
<q-item clickable v-ripple>
|
|
143
|
+
<q-item-section>Option 2</q-item-section>
|
|
144
|
+
</q-item>
|
|
145
|
+
</q-list>
|
|
146
|
+
</q-menu> -->
|
|
147
|
+
</template>
|
|
148
|
+
</UMenuButtonStd>
|
|
149
|
+
</template>
|
|
150
|
+
|
|
151
|
+
<template v-slot:properties>
|
|
152
|
+
<div class="column q-gutter-y-lg">
|
|
153
|
+
<q-select v-model="states" :options="statesOptions" label="Menu state" />
|
|
154
|
+
<q-select
|
|
155
|
+
v-model="iconClass"
|
|
156
|
+
:options="['fa-kit-duotone fa-filter-list','fa-kit fa-caret-down']"
|
|
157
|
+
label="Icon"
|
|
158
|
+
v-if="['Basic','Button','Icon'].includes(states)"
|
|
159
|
+
/>
|
|
160
|
+
<q-input
|
|
161
|
+
label="Label"
|
|
162
|
+
v-model="label"
|
|
163
|
+
v-if="['Basic','Button'].includes(states)"
|
|
164
|
+
/>
|
|
165
|
+
<q-input label="Tooltip" v-model="tooltip" v-if="states === 'Icon'" />
|
|
166
|
+
<q-input label="Aria Label" v-model="ariaLabel" v-if="states === 'Icon'" />
|
|
167
|
+
<q-input label="AVatar url" v-model="avatarUrl" v-if="states === 'Avatar'"/>
|
|
168
|
+
<q-input label="Avatar name" v-model="displayName" v-if="states === 'Avatar'"/>
|
|
169
|
+
<!-- <q-input label="Icon" v-model="iconClass" /> -->
|
|
170
|
+
<q-select v-model="size" :options="sizeOptions" label="Size" />
|
|
171
|
+
<div class="column" v-if="states === 'Icon'">
|
|
172
|
+
<span class="text-grey-8 text-caption-sm">Tooltip Position</span>
|
|
173
|
+
<div>
|
|
174
|
+
<q-select
|
|
175
|
+
v-model="anchor"
|
|
176
|
+
:options="anchorOptions"
|
|
177
|
+
label="Anchor Origin"
|
|
178
|
+
/>
|
|
179
|
+
<q-select
|
|
180
|
+
v-model="self"
|
|
181
|
+
:options="selfOptions"
|
|
182
|
+
label="Self Origin"
|
|
183
|
+
/>
|
|
184
|
+
</div>
|
|
185
|
+
</div>
|
|
186
|
+
</div>
|
|
187
|
+
</template>
|
|
188
|
+
|
|
189
|
+
<template v-slot:code>
|
|
190
|
+
<pre><code>{{ htmlContent }}</code></pre>
|
|
191
|
+
</template>
|
|
192
|
+
</ComponentBase>
|
|
193
|
+
</q-page>
|
|
194
|
+
</template>
|
package/src/router/routes.js
CHANGED
|
@@ -107,10 +107,18 @@ const routes = [
|
|
|
107
107
|
path: 'menu-item',
|
|
108
108
|
component: () => import('src/pages/MenuItem.vue'),
|
|
109
109
|
},
|
|
110
|
+
{
|
|
111
|
+
path: 'inner-loader',
|
|
112
|
+
component: () => import('src/pages/InnerLoader.vue'),
|
|
113
|
+
},
|
|
110
114
|
{
|
|
111
115
|
path: 'menu-dropdown',
|
|
112
116
|
component: () => import('src/pages/MenuDropdown.vue'),
|
|
113
117
|
},
|
|
118
|
+
{
|
|
119
|
+
path: 'menu-button',
|
|
120
|
+
component: () => import('src/pages/MenuButton.vue'),
|
|
121
|
+
},
|
|
114
122
|
{
|
|
115
123
|
path: 'bread-crumbs',
|
|
116
124
|
component: () => import('src/pages/BreadCrumbs.vue'),
|