@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
|
@@ -0,0 +1,497 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { ref } from 'vue'
|
|
3
|
+
import UBtnIcon from './UBtnIcon.vue'
|
|
4
|
+
import UBtnStd from './UBtnStd.vue'
|
|
5
|
+
import UInputTextStd from './UInputTextStd.vue'
|
|
6
|
+
import UTooltip from './UTooltip.vue'
|
|
7
|
+
import { fixStringLength, formatDate, getFileCategory } from '../../utils/data'
|
|
8
|
+
|
|
9
|
+
const props = defineProps({
|
|
10
|
+
autoUpload: {
|
|
11
|
+
type: Boolean,
|
|
12
|
+
default: true,
|
|
13
|
+
},
|
|
14
|
+
noThumbnails: {
|
|
15
|
+
type: Boolean,
|
|
16
|
+
default: true,
|
|
17
|
+
},
|
|
18
|
+
multiple: {
|
|
19
|
+
type: Boolean,
|
|
20
|
+
default: false,
|
|
21
|
+
},
|
|
22
|
+
batch: {
|
|
23
|
+
type: Boolean,
|
|
24
|
+
default: false,
|
|
25
|
+
},
|
|
26
|
+
fileUploadUrl: {
|
|
27
|
+
type: String,
|
|
28
|
+
},
|
|
29
|
+
size: {
|
|
30
|
+
type: String,
|
|
31
|
+
default: 'sm',
|
|
32
|
+
},
|
|
33
|
+
removeIconLabel: {
|
|
34
|
+
type: String,
|
|
35
|
+
default: 'Remove File',
|
|
36
|
+
},
|
|
37
|
+
editIconLabel: {
|
|
38
|
+
type: String,
|
|
39
|
+
default: 'Edit File Name',
|
|
40
|
+
},
|
|
41
|
+
viewIconLabel: {
|
|
42
|
+
type: String,
|
|
43
|
+
default: 'view File Name',
|
|
44
|
+
},
|
|
45
|
+
listExternal: {
|
|
46
|
+
type: Boolean,
|
|
47
|
+
default: false,
|
|
48
|
+
},
|
|
49
|
+
selectFileBtnLabel: {
|
|
50
|
+
type: String,
|
|
51
|
+
default: 'Choose File',
|
|
52
|
+
},
|
|
53
|
+
description: {
|
|
54
|
+
type: String,
|
|
55
|
+
default: 'Drag and drop your file or select choose file.',
|
|
56
|
+
},
|
|
57
|
+
showUploadBtn: {
|
|
58
|
+
type: Boolean,
|
|
59
|
+
default: true,
|
|
60
|
+
},
|
|
61
|
+
fileNameLimit: {
|
|
62
|
+
type: Number,
|
|
63
|
+
default: 25,
|
|
64
|
+
},
|
|
65
|
+
fileIconColor: {
|
|
66
|
+
type: String,
|
|
67
|
+
default: 'primary',
|
|
68
|
+
},
|
|
69
|
+
})
|
|
70
|
+
|
|
71
|
+
const emit = defineEmits(['onUploadFactory', 'onViewFile', 'getFilesOnAdded'])
|
|
72
|
+
const fileDisplayName = ref([])
|
|
73
|
+
const isEditing = ref([])
|
|
74
|
+
const uploaderRef = ref(null)
|
|
75
|
+
|
|
76
|
+
const cancelEdit = (payload) => {
|
|
77
|
+
const { index, file } = payload
|
|
78
|
+
fileDisplayName.value[file['__key']] = file.displayName
|
|
79
|
+
isEditing.value[index] = false
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
const handleViewClick = (file) => {
|
|
83
|
+
return emit('onViewFile', file)
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
const editFileName = (index) => {
|
|
87
|
+
isEditing.value[index] = true
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
const updateFileName = (payload) => {
|
|
91
|
+
const { index, scope, file } = payload
|
|
92
|
+
scope.files[index].displayName = fileDisplayName.value[file['__key']]
|
|
93
|
+
isEditing.value[index] = false
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
const OnFileAdded = (files) => {
|
|
97
|
+
files.forEach((file, index) => {
|
|
98
|
+
files[index]['displayName'] = files[index]['name']
|
|
99
|
+
fileDisplayName.value[file['__key']] = files[index]['displayName']
|
|
100
|
+
})
|
|
101
|
+
|
|
102
|
+
return emit('getFilesOnAdded', uploaderRef.value.files)
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
const OnFileUploaded = ({ files, xhr }) => {
|
|
106
|
+
files.forEach((file, index) => {
|
|
107
|
+
files[index]['uploaded_date'] = new Date()
|
|
108
|
+
})
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
const removeFile = (payload) => {
|
|
112
|
+
const { scope, file } = payload
|
|
113
|
+
fileDisplayName.value.splice(file['__key'], 1)
|
|
114
|
+
scope.removeFile(file)
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
const upload = () => {
|
|
118
|
+
uploaderRef.value.upload()
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
defineExpose({ upload })
|
|
122
|
+
</script>
|
|
123
|
+
<template>
|
|
124
|
+
<div class="u-uploader-container">
|
|
125
|
+
<q-uploader
|
|
126
|
+
v-bind="$attrs"
|
|
127
|
+
class="u-uploader"
|
|
128
|
+
label="Drag and drop your file or select choose file."
|
|
129
|
+
ref="uploaderRef"
|
|
130
|
+
:auto-upload="autoUpload"
|
|
131
|
+
:batch="batch"
|
|
132
|
+
:multiple="multiple"
|
|
133
|
+
:no-thumbnails="noThumbnails"
|
|
134
|
+
:url="fileUploadUrl"
|
|
135
|
+
@added="OnFileAdded"
|
|
136
|
+
@uploaded="OnFileUploaded"
|
|
137
|
+
>
|
|
138
|
+
<template v-slot:header="scope">
|
|
139
|
+
<div v-if="scope.canAddFiles" class="q-py-md q-px-xl bg-neutral-2">
|
|
140
|
+
<div class="text-center">
|
|
141
|
+
<img src="../../assets/files.png" alt="Upload Files" />
|
|
142
|
+
<div class="text-body-md">
|
|
143
|
+
{{ description }}
|
|
144
|
+
</div>
|
|
145
|
+
</div>
|
|
146
|
+
<div class="list-items row">
|
|
147
|
+
<UBtnStd
|
|
148
|
+
class="q-mt-md q-mb-md"
|
|
149
|
+
color="primary"
|
|
150
|
+
size="lg"
|
|
151
|
+
:full-width="true"
|
|
152
|
+
:label="selectFileBtnLabel"
|
|
153
|
+
@click="scope.pickFiles"
|
|
154
|
+
>
|
|
155
|
+
{{ selectFileBtnLabel }}
|
|
156
|
+
<q-uploader-add-trigger
|
|
157
|
+
:aria-label="selectFileBtnLabel"
|
|
158
|
+
></q-uploader-add-trigger>
|
|
159
|
+
</UBtnStd>
|
|
160
|
+
<UBtnStd
|
|
161
|
+
v-if="scope.canUpload && showUploadBtn"
|
|
162
|
+
class="q-mt-md q-mb-md"
|
|
163
|
+
size="sm"
|
|
164
|
+
icon="cloud_upload"
|
|
165
|
+
color="primary"
|
|
166
|
+
flat
|
|
167
|
+
@click="scope.upload"
|
|
168
|
+
>
|
|
169
|
+
<UTooltip description="Upload Files" />
|
|
170
|
+
</UBtnStd>
|
|
171
|
+
</div>
|
|
172
|
+
</div>
|
|
173
|
+
</template>
|
|
174
|
+
<template v-slot:list="scope">
|
|
175
|
+
<div
|
|
176
|
+
v-if="!listExternal && scope.files"
|
|
177
|
+
class="list-container q-my-xxs"
|
|
178
|
+
>
|
|
179
|
+
<q-card
|
|
180
|
+
v-for="(file, index) in scope.files"
|
|
181
|
+
:class="`uploader-list list-size-${size} ${
|
|
182
|
+
file.__status == 'uploading' ? 'q-py-xs q-px-sm' : 'uploaded-container'
|
|
183
|
+
}`"
|
|
184
|
+
:key="file.__key"
|
|
185
|
+
>
|
|
186
|
+
<!-- When File added but not uploaded on server -->
|
|
187
|
+
<q-card-section v-if="file.__status == 'idle'" class="card-section">
|
|
188
|
+
<div class="list-items row items-center">
|
|
189
|
+
<q-icon
|
|
190
|
+
v-if="!file.__img && getFileCategory(file.type) != 'Unknown'"
|
|
191
|
+
:class="`fa-duotone fa-solid fa-file-${getFileCategory(
|
|
192
|
+
file.type
|
|
193
|
+
)}`"
|
|
194
|
+
:color="fileIconColor"
|
|
195
|
+
size="md"
|
|
196
|
+
tabindex="0"
|
|
197
|
+
/>
|
|
198
|
+
<q-icon
|
|
199
|
+
v-if="getFileCategory(file.type) == 'Unknown'"
|
|
200
|
+
class="fa-duotone fa-solid fa-file-doc"
|
|
201
|
+
:color="fileIconColor"
|
|
202
|
+
size="md"
|
|
203
|
+
tabindex="0"
|
|
204
|
+
/>
|
|
205
|
+
<q-icon
|
|
206
|
+
v-if="file.__img"
|
|
207
|
+
class="fa-duotone fa-solid fa-file-image"
|
|
208
|
+
:color="fileIconColor"
|
|
209
|
+
size="md"
|
|
210
|
+
tabindex="0"
|
|
211
|
+
/>
|
|
212
|
+
<div class="col">
|
|
213
|
+
<span class="text-caption-md title flex">
|
|
214
|
+
{{ file.name }}
|
|
215
|
+
</span>
|
|
216
|
+
<span class="text-body-xs info">
|
|
217
|
+
{{ file.__sizeLabel }}
|
|
218
|
+
</span>
|
|
219
|
+
</div>
|
|
220
|
+
|
|
221
|
+
<q-icon
|
|
222
|
+
class="icon-close fa-kit-duotone fa-circle-xmark"
|
|
223
|
+
size="sm"
|
|
224
|
+
tabindex="0"
|
|
225
|
+
:aria-label="removeIconLabel"
|
|
226
|
+
@click="removeFile({ scope, file, index })"
|
|
227
|
+
/>
|
|
228
|
+
</div>
|
|
229
|
+
</q-card-section>
|
|
230
|
+
|
|
231
|
+
<!-- When File start uploading on server -->
|
|
232
|
+
<q-card-section
|
|
233
|
+
v-if="file.__status == 'uploading'"
|
|
234
|
+
class="card-section"
|
|
235
|
+
>
|
|
236
|
+
<div class="list-items row items-center">
|
|
237
|
+
<q-icon
|
|
238
|
+
v-if="!file.__img && getFileCategory(file.type) != 'Unknown'"
|
|
239
|
+
:class="`fa-duotone fa-solid fa-file-${getFileCategory(
|
|
240
|
+
file.type
|
|
241
|
+
)}`"
|
|
242
|
+
:color="fileIconColor"
|
|
243
|
+
size="md"
|
|
244
|
+
tabindex="0"
|
|
245
|
+
/>
|
|
246
|
+
<q-icon
|
|
247
|
+
v-if="getFileCategory(file.type) == 'Unknown'"
|
|
248
|
+
class="fa-duotone fa-solid fa-file-doc"
|
|
249
|
+
:color="fileIconColor"
|
|
250
|
+
size="md"
|
|
251
|
+
tabindex="0"
|
|
252
|
+
/>
|
|
253
|
+
<q-icon
|
|
254
|
+
v-if="file.__img"
|
|
255
|
+
class="fa-duotone fa-solid fa-file-image"
|
|
256
|
+
:color="fileIconColor"
|
|
257
|
+
size="md"
|
|
258
|
+
tabindex="0"
|
|
259
|
+
/>
|
|
260
|
+
<div class="col">
|
|
261
|
+
<span class="text-caption-md title flex">
|
|
262
|
+
{{
|
|
263
|
+
fixStringLength(
|
|
264
|
+
file.displayName || file.name,
|
|
265
|
+
fileNameLimit
|
|
266
|
+
)
|
|
267
|
+
}}
|
|
268
|
+
</span>
|
|
269
|
+
<span class="text-body-xs info">
|
|
270
|
+
{{ file.__sizeLabel }}
|
|
271
|
+
</span>
|
|
272
|
+
</div>
|
|
273
|
+
|
|
274
|
+
<q-icon
|
|
275
|
+
class="icon-close fa-kit-duotone fa-circle-xmark"
|
|
276
|
+
size="sm"
|
|
277
|
+
tabindex="0"
|
|
278
|
+
:aria-label="removeIconLabel"
|
|
279
|
+
@click="removeFile({ scope, file, index })"
|
|
280
|
+
/>
|
|
281
|
+
</div>
|
|
282
|
+
<div class="progress-bar-container flex items-center q-mt-xxs">
|
|
283
|
+
<q-linear-progress
|
|
284
|
+
v-if="file.__progressLabel !== undefined"
|
|
285
|
+
class="progress-bar"
|
|
286
|
+
color="primary"
|
|
287
|
+
track-color="neutral-4"
|
|
288
|
+
:value="file.__progress"
|
|
289
|
+
/>
|
|
290
|
+
<span class="text-body-xxs info">
|
|
291
|
+
{{ file.__progressLabel }}
|
|
292
|
+
</span>
|
|
293
|
+
</div>
|
|
294
|
+
</q-card-section>
|
|
295
|
+
<!--End--- When File Uploading on server --End -->
|
|
296
|
+
|
|
297
|
+
<!-- When File Uploaded on server -->
|
|
298
|
+
<q-card-section
|
|
299
|
+
v-if="file.__status == 'uploaded'"
|
|
300
|
+
class="card-section"
|
|
301
|
+
>
|
|
302
|
+
<div class="list-items row items-center">
|
|
303
|
+
<q-icon
|
|
304
|
+
v-if="!file.__img && getFileCategory(file.type) != 'Unknown'"
|
|
305
|
+
:class="`fa-duotone fa-solid fa-file-${getFileCategory(
|
|
306
|
+
file.type
|
|
307
|
+
)}`"
|
|
308
|
+
:color="fileIconColor"
|
|
309
|
+
size="md"
|
|
310
|
+
tabindex="0"
|
|
311
|
+
/>
|
|
312
|
+
<q-icon
|
|
313
|
+
v-if="getFileCategory(file.type) == 'Unknown'"
|
|
314
|
+
class="fa-duotone fa-solid fa-file-doc"
|
|
315
|
+
:color="fileIconColor"
|
|
316
|
+
size="md"
|
|
317
|
+
tabindex="0"
|
|
318
|
+
/>
|
|
319
|
+
<q-icon
|
|
320
|
+
v-if="file.__img"
|
|
321
|
+
class="fa-duotone fa-solid fa-file-image"
|
|
322
|
+
:color="fileIconColor"
|
|
323
|
+
size="md"
|
|
324
|
+
tabindex="0"
|
|
325
|
+
/>
|
|
326
|
+
|
|
327
|
+
<div class="col">
|
|
328
|
+
<span class="text-caption-md title flex">
|
|
329
|
+
<UTooltip
|
|
330
|
+
anchor="center end"
|
|
331
|
+
self="center end"
|
|
332
|
+
:description="file.displayName || file.name"
|
|
333
|
+
:offset="[4, 4]"
|
|
334
|
+
/>
|
|
335
|
+
|
|
336
|
+
{{
|
|
337
|
+
fixStringLength(
|
|
338
|
+
file.displayName || file.name,
|
|
339
|
+
fileNameLimit
|
|
340
|
+
)
|
|
341
|
+
}}
|
|
342
|
+
</span>
|
|
343
|
+
<span class="text-body-xs info">
|
|
344
|
+
Uploaded: {{ formatDate(file.uploaded_date) }}
|
|
345
|
+
</span>
|
|
346
|
+
</div>
|
|
347
|
+
|
|
348
|
+
<UBtnIcon
|
|
349
|
+
iconClass="fa-kit-duotone fa-pen-to-square"
|
|
350
|
+
color="primary"
|
|
351
|
+
size="md"
|
|
352
|
+
tabindex="0"
|
|
353
|
+
:aria-label="editIconLabel"
|
|
354
|
+
@click="editFileName(index)"
|
|
355
|
+
v-if="!isEditing[index] && size == 'md'"
|
|
356
|
+
/>
|
|
357
|
+
|
|
358
|
+
<UBtnIcon
|
|
359
|
+
iconClass="fa-kit-duotone fa-trash-can"
|
|
360
|
+
color="accent"
|
|
361
|
+
size="md"
|
|
362
|
+
tabindex="0"
|
|
363
|
+
:aria-label="removeIconLabel"
|
|
364
|
+
@click="removeFile({ scope, file, index })"
|
|
365
|
+
/>
|
|
366
|
+
|
|
367
|
+
<UBtnStd
|
|
368
|
+
color="primary"
|
|
369
|
+
label="View"
|
|
370
|
+
size="sm"
|
|
371
|
+
outline
|
|
372
|
+
:aria-label="viewIconLabel"
|
|
373
|
+
@onClick="handleViewClick(file)"
|
|
374
|
+
v-if="size == 'md'"
|
|
375
|
+
/>
|
|
376
|
+
</div>
|
|
377
|
+
<div class="q-my-ba" v-if="isEditing[index]">
|
|
378
|
+
<UInputTextStd
|
|
379
|
+
label="Edit file name"
|
|
380
|
+
size="md"
|
|
381
|
+
v-model="fileDisplayName[file.__key]"
|
|
382
|
+
/>
|
|
383
|
+
</div>
|
|
384
|
+
<div
|
|
385
|
+
v-if="!isEditing[index] && size == 'sm'"
|
|
386
|
+
class="list-items edit-button row q-mt-ba"
|
|
387
|
+
>
|
|
388
|
+
<UBtnStd
|
|
389
|
+
color="primary"
|
|
390
|
+
label="Edit"
|
|
391
|
+
size="md"
|
|
392
|
+
flat
|
|
393
|
+
:aria-label="editIconLabel"
|
|
394
|
+
:full-width="true"
|
|
395
|
+
@click="editFileName(index)"
|
|
396
|
+
/>
|
|
397
|
+
<UBtnStd
|
|
398
|
+
color="primary"
|
|
399
|
+
label="View File"
|
|
400
|
+
size="md"
|
|
401
|
+
:full-width="true"
|
|
402
|
+
:outline="true"
|
|
403
|
+
:aria-label="viewIconLabel"
|
|
404
|
+
@onClick="handleViewClick(file)"
|
|
405
|
+
/>
|
|
406
|
+
</div>
|
|
407
|
+
<div v-if="isEditing[index]" class="list-items update-button row">
|
|
408
|
+
<UBtnStd
|
|
409
|
+
color="primary"
|
|
410
|
+
label="Cancel"
|
|
411
|
+
size="md"
|
|
412
|
+
flat
|
|
413
|
+
:full-width="true"
|
|
414
|
+
@click="cancelEdit({ index, file })"
|
|
415
|
+
/>
|
|
416
|
+
|
|
417
|
+
<UBtnStd
|
|
418
|
+
color="primary"
|
|
419
|
+
label="Update file name"
|
|
420
|
+
size="md"
|
|
421
|
+
:full-width="true"
|
|
422
|
+
@click="updateFileName({ scope, file, index })"
|
|
423
|
+
/>
|
|
424
|
+
</div>
|
|
425
|
+
</q-card-section>
|
|
426
|
+
<q-card-section
|
|
427
|
+
v-if="file.__img && noThumbnails"
|
|
428
|
+
class="flex items-center"
|
|
429
|
+
thumbnail
|
|
430
|
+
>
|
|
431
|
+
<img :src="file.__img.src" />
|
|
432
|
+
</q-card-section>
|
|
433
|
+
<!--End--- When File Uploaded on server --End -->
|
|
434
|
+
</q-card>
|
|
435
|
+
</div>
|
|
436
|
+
</template>
|
|
437
|
+
</q-uploader>
|
|
438
|
+
</div>
|
|
439
|
+
</template>
|
|
440
|
+
|
|
441
|
+
<style lang="sass">
|
|
442
|
+
.u-uploader-container
|
|
443
|
+
.list-container
|
|
444
|
+
display: grid
|
|
445
|
+
place-items: center
|
|
446
|
+
gap: $xxs
|
|
447
|
+
.q-uploader
|
|
448
|
+
width: auto !important
|
|
449
|
+
max-height: unset !important
|
|
450
|
+
.uploader-list
|
|
451
|
+
background: $neutral-2
|
|
452
|
+
border-radius: $xs
|
|
453
|
+
box-shadow: 0px 0px 2px 0px rgba(16, 17, 20, 0.04)
|
|
454
|
+
.uploaded-container
|
|
455
|
+
padding: $sm
|
|
456
|
+
.list-items
|
|
457
|
+
justify-content: space-between
|
|
458
|
+
flex-wrap: nowrap
|
|
459
|
+
gap:$xs
|
|
460
|
+
.edit-button
|
|
461
|
+
gap:$ba
|
|
462
|
+
.update-button
|
|
463
|
+
gap:$sm
|
|
464
|
+
.list-size-sm
|
|
465
|
+
width: 21.75rem
|
|
466
|
+
.list-size-md
|
|
467
|
+
width: 100%
|
|
468
|
+
.title
|
|
469
|
+
color: $dark
|
|
470
|
+
.info
|
|
471
|
+
color: $neutral-9
|
|
472
|
+
.file-icon
|
|
473
|
+
font-size:$md
|
|
474
|
+
.q-uploader__header
|
|
475
|
+
padding: 0 !important
|
|
476
|
+
background-color: $neutral-2
|
|
477
|
+
.text-body-md
|
|
478
|
+
color: $dark !important
|
|
479
|
+
.q-uploader__list
|
|
480
|
+
min-height: auto !important
|
|
481
|
+
padding:0
|
|
482
|
+
.q-uploader__overlay
|
|
483
|
+
display: none !important
|
|
484
|
+
.progress-bar
|
|
485
|
+
width: 84% !important
|
|
486
|
+
.progress-bar-container
|
|
487
|
+
gap: $xs
|
|
488
|
+
.card-section
|
|
489
|
+
padding:0px
|
|
490
|
+
.q-uploader__dnd
|
|
491
|
+
background: $blue-1 !important
|
|
492
|
+
opacity: .8
|
|
493
|
+
border: 2px solid $blue-6
|
|
494
|
+
border-radius:$sm
|
|
495
|
+
.u-uploader
|
|
496
|
+
display: flex
|
|
497
|
+
</style>
|
package/src/components/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// import BtnStd from "./BtnStd.vue";
|
|
2
2
|
import UCheckboxStd from './core/UCheckboxStd.vue'
|
|
3
3
|
import UBtnStd from './core/UBtnStd.vue'
|
|
4
|
+
import UBtnToggle from './core/UBtnToggle.vue'
|
|
4
5
|
import URadioStd from './core/URadioStd.vue'
|
|
5
6
|
import UTabsStd from './core/UTabsStd.vue'
|
|
6
7
|
import UTabBtnStd from './core/UTabBtnStd.vue'
|
|
@@ -9,16 +10,66 @@ import UTooltip from './core/UTooltip.vue'
|
|
|
9
10
|
import UBannerStd from './core/UBannerStd.vue'
|
|
10
11
|
import UToggleStd from './core/UToggleStd.vue'
|
|
11
12
|
import USelectStd from './core/USelectStd.vue'
|
|
13
|
+
import UTableStd from './core/UTableStd.vue'
|
|
14
|
+
import UAvatar from './core/UAvatar.vue'
|
|
15
|
+
import UAvatarGroup from './core/UAvatarGroup.vue'
|
|
16
|
+
import UBadgeStd from './core/UBadgeStd.vue'
|
|
17
|
+
import UBtnIcon from './core/UBtnIcon.vue'
|
|
18
|
+
import UChip from './core/UChip.vue'
|
|
19
|
+
import UInputAddressLookup from './core/UInputAddressLookup.vue'
|
|
20
|
+
import UInputPhoneStd from './core/UInputPhoneStd.vue'
|
|
21
|
+
import UInputTextStd from './core/UInputTextStd.vue'
|
|
22
|
+
import UInputTypeaheadAdvanceSearch from './core/UInputTypeaheadAdvanceSearch.vue'
|
|
23
|
+
import UDialogStd from './core/UDialogStd.vue'
|
|
24
|
+
import URadioBtn from './core/URadioBtn.vue'
|
|
25
|
+
import UInnerLoader from './core/UInnerLoader.vue'
|
|
26
|
+
import UMenuItem from './core/UMenuItem.vue'
|
|
27
|
+
import UDrawer from './core/UDrawer.vue'
|
|
28
|
+
import UMenuDropdown from './core/UMenuDropdown.vue'
|
|
29
|
+
import UMenuButtonStd from './core/UMenuButtonStd.vue'
|
|
30
|
+
import UBreadCrumbs from './core/UBreadCrumbs.vue'
|
|
31
|
+
import UMenuDropdownAdvancedSearch from './core/UMenuDropdownAdvancedSearch.vue'
|
|
32
|
+
import UMenuSearch from './core/UMenuSearch.vue'
|
|
33
|
+
import UToolbar from './core/UToolbar.vue'
|
|
34
|
+
|
|
35
|
+
import { useNotify } from '../composables/useNotify.js'
|
|
36
|
+
import { useOverlayLoader } from '../composables/useOverlayLoader.js'
|
|
37
|
+
import UUploader from './core/UUploader.vue'
|
|
12
38
|
|
|
13
39
|
export {
|
|
40
|
+
useOverlayLoader,
|
|
41
|
+
useNotify,
|
|
42
|
+
UAvatar,
|
|
43
|
+
UAvatarGroup,
|
|
44
|
+
UBadgeStd,
|
|
45
|
+
UBannerStd,
|
|
46
|
+
UBreadCrumbs,
|
|
47
|
+
UBtnIcon,
|
|
14
48
|
UBtnStd,
|
|
49
|
+
UBtnToggle,
|
|
15
50
|
UCheckboxStd,
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
51
|
+
UChip,
|
|
52
|
+
UDialogStd,
|
|
53
|
+
UDrawer,
|
|
54
|
+
UInnerLoader,
|
|
55
|
+
UInputAddressLookup,
|
|
56
|
+
UInputPhoneStd,
|
|
57
|
+
UInputTextStd,
|
|
58
|
+
UInputTypeaheadAdvanceSearch,
|
|
59
|
+
UMenuButtonStd,
|
|
60
|
+
UMenuDropdown,
|
|
61
|
+
UMenuItem,
|
|
19
62
|
UMultiSelectStd,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
UBannerStd,
|
|
63
|
+
URadioBtn,
|
|
64
|
+
URadioStd,
|
|
23
65
|
USelectStd,
|
|
66
|
+
UTabBtnStd,
|
|
67
|
+
UTableStd,
|
|
68
|
+
UTabsStd,
|
|
69
|
+
UToggleStd,
|
|
70
|
+
UTooltip,
|
|
71
|
+
UUploader,
|
|
72
|
+
UMenuDropdownAdvancedSearch,
|
|
73
|
+
UMenuSearch,
|
|
74
|
+
UToolbar,
|
|
24
75
|
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { useQuasar } from 'quasar'
|
|
2
|
+
|
|
3
|
+
export const useNotify = () => {
|
|
4
|
+
const $q = useQuasar()
|
|
5
|
+
|
|
6
|
+
const handleGetActions = (data) => {
|
|
7
|
+
if (data.actionLabel) {
|
|
8
|
+
return [
|
|
9
|
+
{
|
|
10
|
+
label: data.actionLabel,
|
|
11
|
+
color: 'white',
|
|
12
|
+
noCaps: true,
|
|
13
|
+
unelevated: true,
|
|
14
|
+
class: 'u-notify-action-button',
|
|
15
|
+
handler: data.handler,
|
|
16
|
+
},
|
|
17
|
+
]
|
|
18
|
+
} else {
|
|
19
|
+
return [
|
|
20
|
+
{
|
|
21
|
+
round: true,
|
|
22
|
+
color: 'white',
|
|
23
|
+
flat: true,
|
|
24
|
+
class: `u-notify-action-icon u-action-icon-${data.type}`,
|
|
25
|
+
icon: 'close',
|
|
26
|
+
handler: data.handler,
|
|
27
|
+
},
|
|
28
|
+
]
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* it is chaing the custom icon with font awesome custom class
|
|
33
|
+
* @param {*} icon
|
|
34
|
+
*/
|
|
35
|
+
|
|
36
|
+
// Adding class to Notification element to make it customizable
|
|
37
|
+
const handleGetCustomIcon = (icon, randomId) => {
|
|
38
|
+
setTimeout(() => {
|
|
39
|
+
let getNotificationElement = document.querySelector(
|
|
40
|
+
`.q-notification-elem-${randomId}`
|
|
41
|
+
)
|
|
42
|
+
if (getNotificationElement) {
|
|
43
|
+
let childElement = getNotificationElement.querySelector(
|
|
44
|
+
`.q-notification__wrapper .q-notification__content`
|
|
45
|
+
)
|
|
46
|
+
if (childElement.childNodes.length == 1) {
|
|
47
|
+
const iconEleHTML = `<i class='${icon}' aria-label='Custom Icon' style='height:24px; width:24px; font-size: 24px; margin-right: 8px' alt='Custom Icon Alt'></i>`
|
|
48
|
+
childElement.insertAdjacentHTML('afterbegin', iconEleHTML)
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}, 100)
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const notify = (props) => {
|
|
55
|
+
if (props.label && props.type) {
|
|
56
|
+
let randomId = Math.floor(100000 + Math.random() * 900000)
|
|
57
|
+
let notifyProps = {
|
|
58
|
+
type: props.type === 'accent' ? 'negative' : props.type,
|
|
59
|
+
message: props.label,
|
|
60
|
+
caption: props.message,
|
|
61
|
+
color: props.type,
|
|
62
|
+
timeout: props.timeout,
|
|
63
|
+
classes: `u-notify u-type-${props.type} q-notification-elem-${randomId}`,
|
|
64
|
+
position: props.position,
|
|
65
|
+
progress: props.progress,
|
|
66
|
+
icon: props.icon ? handleGetCustomIcon(props.icon, randomId) : null,
|
|
67
|
+
actions: handleGetActions(props),
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
$q.notify(notifyProps)
|
|
71
|
+
} else {
|
|
72
|
+
console.error(
|
|
73
|
+
'Error: Failed prop types: The props `label` and `type` are marked as required in Notify, but its values are `undefined'
|
|
74
|
+
)
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
return { notify }
|
|
79
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Loading, QSpinnerGears } from 'quasar'
|
|
2
|
+
|
|
3
|
+
export const useOverlayLoader = () => {
|
|
4
|
+
|
|
5
|
+
const showLoader = (props) => {
|
|
6
|
+
|
|
7
|
+
Loading.show({
|
|
8
|
+
backgroundColor: props?.backgroundColor,
|
|
9
|
+
customClass: props.customClass ? props.customClass : '',
|
|
10
|
+
message: props?.message,
|
|
11
|
+
messageColor: props.messageColor ? props.messageColor: 'dark',
|
|
12
|
+
spinner: props.spinner ? props.spinner : QSpinnerGears,
|
|
13
|
+
spinnerSize: props.spinnerSize ? props.spinnerSize : '6rem',
|
|
14
|
+
spinnerColor: props?.spinnerColor
|
|
15
|
+
})
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const hideLoader = () =>{
|
|
19
|
+
Loading.hide()
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
return { showLoader, hideLoader }
|
|
23
|
+
}
|