@usssa/component-library 1.0.0-alpha.15 → 1.0.0-alpha.151

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.
Files changed (57) hide show
  1. package/README.md +6 -3
  2. package/package.json +23 -5
  3. package/src/assets/logo.svg +19 -0
  4. package/src/assets/no-result.svg +25 -0
  5. package/src/assets/quasar-logo-vertical.svg +15 -0
  6. package/src/assets/upload-illustration.svg +48 -0
  7. package/src/components/core/UAvatar.vue +56 -24
  8. package/src/components/core/UAvatarGroup.vue +62 -52
  9. package/src/components/core/UBadgeStd.vue +6 -1
  10. package/src/components/core/UBannerStd.vue +100 -31
  11. package/src/components/core/UBreadCrumbs.vue +171 -0
  12. package/src/components/core/UBtnIcon.vue +58 -53
  13. package/src/components/core/UBtnStd.vue +39 -31
  14. package/src/components/core/UBtnToggle.vue +11 -6
  15. package/src/components/core/UCheckboxStd.vue +26 -20
  16. package/src/components/core/UChip.vue +76 -42
  17. package/src/components/core/UDate.vue +565 -0
  18. package/src/components/core/UDialogStd.vue +460 -53
  19. package/src/components/core/UDrawer.vue +321 -0
  20. package/src/components/core/UInnerLoader.vue +69 -0
  21. package/src/components/core/UInputAddressLookup.vue +471 -0
  22. package/src/components/core/UInputPhoneStd.vue +73 -68
  23. package/src/components/core/UInputTextStd.vue +133 -116
  24. package/src/components/core/UInputTypeahead.vue +44 -0
  25. package/src/components/core/UInputTypeaheadAdvanceSearch.vue +126 -0
  26. package/src/components/core/UMenuButtonStd.vue +280 -0
  27. package/src/components/core/UMenuDropdown.vue +80 -0
  28. package/src/components/core/UMenuDropdownAdvancedSearch.vue +293 -0
  29. package/src/components/core/UMenuItem.vue +161 -0
  30. package/src/components/core/UMenuSearch.vue +69 -0
  31. package/src/components/core/UMultiSelectStd.vue +258 -54
  32. package/src/components/core/UPagination.vue +67 -27
  33. package/src/components/core/URadioBtn.vue +66 -43
  34. package/src/components/core/URadioStd.vue +19 -12
  35. package/src/components/core/USelectStd.vue +360 -80
  36. package/src/components/core/USheet.vue +349 -0
  37. package/src/components/core/UTabBtnStd.vue +87 -59
  38. package/src/components/core/UTable/UTable.vue +811 -42
  39. package/src/components/core/UTableStd.vue +875 -275
  40. package/src/components/core/UTabsStd.vue +57 -16
  41. package/src/components/core/UToggleStd.vue +43 -29
  42. package/src/components/core/UToolbar/UCustomMenuIcon.vue +58 -0
  43. package/src/components/core/UToolbar/UToolbar.vue +210 -0
  44. package/src/components/core/UTooltip.vue +31 -10
  45. package/src/components/core/UTypeahead.vue +830 -0
  46. package/src/components/core/UUploader.vue +535 -0
  47. package/src/components/index.js +61 -21
  48. package/src/composables/useNotify.js +16 -16
  49. package/src/composables/useOverlayLoader.js +23 -0
  50. package/src/composables/useScreenType.js +30 -0
  51. package/src/css/app.sass +168 -0
  52. package/src/css/colors.sass +103 -0
  53. package/src/css/media.sass +1 -0
  54. package/src/css/quasar.variables.sass +121 -0
  55. package/src/css/typography.sass +0 -0
  56. package/src/css/vars/colors.variables.sass +127 -0
  57. package/src/utils/data.ts +146 -0
@@ -0,0 +1,565 @@
1
+ <script setup>
2
+ import { ref, watch } from 'vue'
3
+ import { useScreenType } from '../../composables/useScreenType'
4
+ import UBtnStd from './UBtnStd.vue'
5
+ import UInputTextStd from './UInputTextStd.vue'
6
+ import USheet from './USheet.vue'
7
+
8
+ const date = defineModel('date', { default: null })
9
+
10
+ const props = defineProps({
11
+ anchor: { type: String, default: 'bottom start' },
12
+ borderless: {
13
+ type: Boolean,
14
+ default: false,
15
+ },
16
+ dataTestId: {
17
+ type: String,
18
+ default: 'date',
19
+ },
20
+ datePickerClass: { type: String, default: null },
21
+ datePickerOptions: { type: [Array, Function] },
22
+ disable: { type: Boolean, default: false },
23
+ hintIcon: { type: String, default: null },
24
+ hintText: { type: String, default: null },
25
+ inputClass: { type: String, default: null },
26
+ isRequired: { type: Boolean, default: false },
27
+ label: {
28
+ type: String,
29
+ },
30
+ mask: { default: 'MM/DD/YYYY', type: String },
31
+ navigationMaxYearMonth: {
32
+ type: String,
33
+ default: `${new Date().toISOString().slice(0, 7).replace('-', '/')}`,
34
+ },
35
+ navigationMinYearMonth: {
36
+ type: String,
37
+ default: '',
38
+ },
39
+ offset: { type: Array, default: () => [310, 15] },
40
+ placeholder: {
41
+ type: String,
42
+ default: null,
43
+ },
44
+ range: { type: Boolean, default: false },
45
+ self: { type: String, default: 'top left' },
46
+ size: {
47
+ type: String,
48
+ default: 'md',
49
+ validator: (val) => ['sm', 'md', 'lg'].includes(val),
50
+ },
51
+ toolTipText: {
52
+ type: String,
53
+ },
54
+ validationRules: { type: Array, default: () => [] },
55
+ })
56
+
57
+ const $screen = useScreenType()
58
+
59
+ //refs
60
+ const datePickerRef = ref(null)
61
+ const dialogDate = ref('')
62
+ const dialogs = ref([])
63
+ const dialogSelectedDate = ref('')
64
+ const selectedDate = ref('')
65
+
66
+ //custom functions
67
+ const closeDialog = () => {
68
+ setTimeout(() => {
69
+ if (dialogs.value[0]) {
70
+ dialogs.value[0].open = false
71
+ }
72
+ }, 100)
73
+ setTimeout(() => {
74
+ dialogs.value.splice(0, 1)
75
+ }, 500)
76
+ }
77
+
78
+ const handleApply = () => {
79
+ date.value = dialogDate.value
80
+ selectedDate.value = dialogSelectedDate.value
81
+ closeDialog()
82
+ }
83
+
84
+ const handleClose = () => {
85
+ dialogSelectedDate.value = selectedDate.value
86
+ dialogDate.value = date.value
87
+
88
+ closeDialog()
89
+ }
90
+
91
+ const onUpdateSheet = (value) => {
92
+ if (value.search('-') > -1) {
93
+ dialogDate.value = { from: value.split('-')[0], to: value.split('-')[1] }
94
+ } else {
95
+ dialogDate.value = value
96
+ }
97
+ }
98
+
99
+ const onUpdateValue = (value) => {
100
+ if (value.search('-') > -1) {
101
+ date.value = { from: value.split('-')[0], to: value.split('-')[1] }
102
+ } else {
103
+ date.value = value
104
+ }
105
+ }
106
+
107
+ const openDatePicker = () => {
108
+ if ($screen.value.isMobile) {
109
+ openDialogs()
110
+ } else if (datePickerRef.value && !props.disable) {
111
+ datePickerRef.value.show()
112
+ }
113
+ }
114
+
115
+ const openDialogs = () => {
116
+ dialogSelectedDate.value = selectedDate.value
117
+ dialogDate.value = date.value
118
+
119
+ let copiedDialogsArray = JSON.parse(JSON.stringify(dialogs.value))
120
+ copiedDialogsArray.push({
121
+ open: true,
122
+ height: 390,
123
+ persistent: true,
124
+ transitionDuration: 500, // ms
125
+ position: 'bottom',
126
+ })
127
+ dialogs.value = copiedDialogsArray
128
+ }
129
+
130
+ // watchers
131
+ watch(
132
+ date,
133
+ (newData) => {
134
+ if (!newData) return
135
+ if (typeof newData === 'string') {
136
+ selectedDate.value = newData
137
+ } else {
138
+ if (newData.from && newData.to) {
139
+ selectedDate.value = `${newData.from}-${newData.to}`
140
+ }
141
+ }
142
+ },
143
+ { immediate: true }
144
+ )
145
+ watch(
146
+ dialogDate,
147
+ (newData) => {
148
+ if (!newData) return
149
+ if (typeof newData === 'string') {
150
+ dialogSelectedDate.value = newData
151
+ } else {
152
+ if (newData.from && newData.to) {
153
+ dialogSelectedDate.value = `${newData.from}-${newData.to}`
154
+ }
155
+ }
156
+ },
157
+ { immediate: true }
158
+ )
159
+ </script>
160
+ <template>
161
+ <UInputTextStd
162
+ v-model="selectedDate"
163
+ :class="inputClass ? inputClass : ''"
164
+ :borderless="borderless"
165
+ :dataTestId="dataTestId"
166
+ :disable="disable"
167
+ :hint-icon="hintIcon"
168
+ :hint-text="hintText"
169
+ :is-required="isRequired"
170
+ :label="label"
171
+ :mask="`${range ? '##/##/####-##/##/####' : '##/##/####'}`"
172
+ :placeholder="placeholder"
173
+ :size="size"
174
+ tabindex="-1"
175
+ :toolTipText="toolTipText"
176
+ :validation-rules="validationRules"
177
+ @update:modelValue="onUpdateValue"
178
+ >
179
+ <template #append>
180
+ <UBtnStd
181
+ class="date-picker-btn-icon"
182
+ aria-label="open date picker"
183
+ :flat="true"
184
+ :size="size"
185
+ :tabindex="disable ? -1 : 0"
186
+ @on-click="openDatePicker"
187
+ >
188
+ <q-icon
189
+ class="cursor-pointer date-picker-icon fa-kit-duotone fa-calendar-event"
190
+ alt="open date picker"
191
+ size="1rem"
192
+ tabindex="-1"
193
+ >
194
+ <q-popup-proxy
195
+ v-if="!$screen.isMobile"
196
+ :anchor="anchor"
197
+ aria-label="date-picker"
198
+ fit
199
+ :offset="offset"
200
+ ref="datePickerRef"
201
+ :self="self"
202
+ transition-hide="scale"
203
+ transition-show="scale"
204
+ >
205
+ <q-date
206
+ v-model="date"
207
+ :class="`u-date ${
208
+ datePickerClass ? datePickerClass : ''
209
+ } q-py-xxs q-px-xxs`"
210
+ color="primary"
211
+ :mask="mask"
212
+ minimal
213
+ :navigation-max-year-month="navigationMaxYearMonth"
214
+ :navigation-min-year-month="navigationMinYearMonth"
215
+ :range="range"
216
+ />
217
+ </q-popup-proxy>
218
+ </q-icon>
219
+ </UBtnStd>
220
+ </template>
221
+ </UInputTextStd>
222
+ <USheet
223
+ v-model:dialogs="dialogs"
224
+ dialog-class="date-sheet"
225
+ closeIconLabel="Close Icon"
226
+ heading="Select Date"
227
+ :show-action-buttons="true"
228
+ >
229
+ <template #content>
230
+ <UInputTextStd
231
+ v-model="dialogSelectedDate"
232
+ :dataTestId="dataTestId"
233
+ :hint-icon="hintIcon"
234
+ :mask="`${range ? '##/##/####-##/##/####' : '##/##/####'}`"
235
+ tabindex="-1"
236
+ @update:modelValue="onUpdateSheet"
237
+ >
238
+ <template #append>
239
+ <UBtnStd
240
+ class="date-picker-btn-icon"
241
+ aria-label="open date picker"
242
+ :flat="true"
243
+ :size="size"
244
+ :tabindex="disable ? -1 : 0"
245
+ >
246
+ <q-icon
247
+ class="cursor-pointer date-picker-icon fa-kit-duotone fa-calendar-event"
248
+ alt="open date picker"
249
+ size="1rem"
250
+ tabindex="-1"
251
+ >
252
+ </q-icon>
253
+ </UBtnStd>
254
+ </template>
255
+ </UInputTextStd>
256
+ <div>
257
+ <q-date
258
+ v-model="dialogDate"
259
+ :class="`u-date ${
260
+ datePickerClass ? datePickerClass : 'dialog-date'
261
+ } q-py-xxs q-px-xxs`"
262
+ color="primary"
263
+ flat
264
+ :mask="mask"
265
+ minimal
266
+ :navigation-max-year-month="navigationMaxYearMonth"
267
+ :navigation-min-year-month="navigationMinYearMonth"
268
+ :options="datePickerOptions"
269
+ :range="range"
270
+ />
271
+ </div>
272
+ </template>
273
+ <template #action_primary_one>
274
+ <UBtnStd
275
+ color="primary"
276
+ label="Close"
277
+ outline
278
+ size="md"
279
+ @on-click="handleClose"
280
+ />
281
+ </template>
282
+ <template #action_primary_two>
283
+ <UBtnStd
284
+ color="primary"
285
+ label="Apply"
286
+ size="md"
287
+ @on-click="handleApply"
288
+ />
289
+ </template>
290
+ </USheet>
291
+ </template>
292
+ <style lang="sass">
293
+ .q-menu:has(.u-date)
294
+ width: 21rem
295
+ border-radius: $border-radius-sm !important
296
+ background: $neutral-1 !important
297
+ box-shadow: $shadow-1 !important
298
+
299
+ .u-date
300
+ width: 100%
301
+ height: 100%
302
+
303
+ .q-btn .q-icon
304
+ font-size: $ba !important
305
+ color: $dark !important
306
+
307
+ .q-date__calendar-item
308
+ padding: 0 !important
309
+
310
+ .q-date__navigation
311
+ .q-date__arrow
312
+ &:nth-of-type(3)
313
+ margin-right: $xs
314
+ .q-btn:hover
315
+ background: #dce1e926 !important
316
+ margin-bottom: $xs
317
+ .relative-position div .q-btn
318
+ padding: $xs
319
+ &:hover
320
+ background: #dce1e926 !important
321
+
322
+ .q-btn .block
323
+ font-size: 0.875rem
324
+ font-weight: 500
325
+ line-height: 1.25rem
326
+ letter-spacing: 0.03333rem
327
+
328
+ .q-date__view.q-date__months
329
+ height: 15rem !important
330
+
331
+ .q-date__years
332
+ .col-auto
333
+ &:nth-of-type(1)
334
+ margin-right: $xxs
335
+ &:nth-of-type(3)
336
+ margin-left: $xxs
337
+ .col-auto .q-btn
338
+ width: $ms
339
+ height: $ms
340
+ padding: $xxs
341
+ &:hover
342
+ background: #dce1e926 !important
343
+
344
+ .q-btn
345
+ .q-focus-helper::before, .q-focus-helper::after
346
+ opacity: 0 !important
347
+
348
+ .q-date__months-item
349
+ .q-date__today
350
+ box-shadow: none
351
+
352
+ .q-btn:hover
353
+ background: #dce1e926 !important
354
+
355
+ .q-btn.bg-primary:hover
356
+ background: $primary !important
357
+
358
+ .q-date__today::after
359
+ content: ""
360
+ position: absolute
361
+ bottom: 0.125rem
362
+ left: 50%
363
+ transform: translateX(-50%)
364
+ width: $xxs
365
+ height: $xxs
366
+ background: $primary
367
+ border-radius: 50%
368
+
369
+ .q-date__years-content
370
+ padding: 0 !important
371
+ .q-date__years-item
372
+ padding-right: $xxs
373
+ .q-btn
374
+ border-radius: $xxl !important
375
+ width: $xxl
376
+ height: $lg
377
+ font-size: 0.875rem
378
+ font-weight: 400
379
+ line-height: $ms
380
+ letter-spacing: 0.01786rem
381
+ padding: 0 !important
382
+ &:hover
383
+ background: #dce1e926 !important
384
+ .q-btn.bg-primary:hover
385
+ background: $primary !important
386
+
387
+ .q-date__today
388
+ box-shadow: none
389
+
390
+ .q-date__today::after
391
+ content: ""
392
+ position: absolute
393
+ bottom: 0.125rem
394
+ left: 50%
395
+ transform: translateX(-50%)
396
+ width: $xxs
397
+ height: $xxs
398
+ background: $primary
399
+ border-radius: 50%
400
+
401
+ .q-date__calendar-days
402
+ .q-date__range-from::before, .q-date__range-to::before
403
+ background: $bg-blue-1
404
+ opacity: 1
405
+ border-width: 1px 0px
406
+ border-color: $primary !important
407
+ border-style: solid !important
408
+ top: 0px !important
409
+ bottom: 0px !important
410
+
411
+ .q-date__range::before
412
+ background: $bg-blue-1
413
+ opacity: 1
414
+ border-width: 1px 0px
415
+ border-color: $primary !important
416
+ border-style: solid !important
417
+ top: 0px !important
418
+ bottom: 0px !important
419
+
420
+ .q-date__edit-range-from-to::after
421
+ right: 0.625rem !important
422
+ left: 0.625rem !important
423
+ top: 0px !important
424
+ bottom: 0px !important
425
+
426
+ .q-date__edit-range-to::after
427
+ right: 0.625rem !important
428
+ height: $md
429
+ top: 0px !important
430
+
431
+ .q-date__edit-range-from::after
432
+ left: 0.625rem !important
433
+ height: $md
434
+ top: 0px !important
435
+
436
+ .q-date__edit-range::after
437
+ height: $md
438
+ top: 0px !important
439
+
440
+ .q-date__range
441
+ .q-btn
442
+ color: $primary !important
443
+
444
+ .q-date__calendar-item
445
+ margin-bottom: $xxs
446
+ .q-date__today
447
+ box-shadow: none !important
448
+ position: relative
449
+ display: inline-block
450
+
451
+ .q-date__today::after
452
+ content: ""
453
+ position: absolute
454
+ bottom: 0.125rem
455
+ left: 50%
456
+ transform: translateX(-50%)
457
+ width: $xxs
458
+ height: $xxs
459
+ background: $primary
460
+ border-radius: 50%
461
+
462
+ .q-btn
463
+ border-radius: $xxl !important
464
+ width: $md
465
+ height: $md
466
+ font-size: 0.875rem
467
+ font-weight: 400
468
+ line-height: $ms
469
+ letter-spacing: 0.01786rem
470
+ color: $dark
471
+ padding: 0 !important
472
+
473
+ .q-btn.bg-primary:hover
474
+ background: $primary !important
475
+
476
+ .q-btn:hover
477
+ background: #dce1e926 !important
478
+
479
+ .q-date__months-item
480
+ padding-right: $xxs
481
+ .q-btn
482
+ border-radius: $xxl !important
483
+ width: $xxl
484
+ height: $lg
485
+ font-size: 0.875rem
486
+ font-weight: 400
487
+ line-height: $ms
488
+ letter-spacing: 0.01786rem
489
+ padding: 0 !important
490
+
491
+ .q-date__actions
492
+ display: none
493
+
494
+ .q-date__calendar-weekdays
495
+ .q-date__calendar-item
496
+ text-transform: uppercase
497
+ color: $dark
498
+ font-size: 0.875rem
499
+ font-weight: 400
500
+ line-height: $ms
501
+ letter-spacing: 0.01786rem
502
+ opacity: 1 !important
503
+ height: $ms !important
504
+ div
505
+ line-height: $ms
506
+ display: flex
507
+ align-items: center
508
+
509
+ .q-date__view
510
+ padding: 0 !important
511
+ height: inherit !important
512
+ min-height: 0rem !important
513
+
514
+ .q-date__calendar-days-container
515
+ height: 100% !important
516
+ min-height: 0rem !important
517
+
518
+ .q-date__arrow
519
+ .q-btn
520
+ width: $ms
521
+ height: $ms
522
+ padding: 0.25rem
523
+ flex-wrap: nowrap
524
+ justify-content: center
525
+ &:hover
526
+ background: #dce1e926 !important
527
+
528
+ .relative-position div .q-btn
529
+ padding: $xs
530
+ color: $dark
531
+ font-size: 0.875rem
532
+ font-weight: 500
533
+ line-height: 1.25rem
534
+ letter-spacing: 0.03333rem
535
+
536
+ .date-picker-btn-icon.u-btn
537
+ padding: 0px !important
538
+ min-width: 0px !important
539
+
540
+ &.q-hoverable:hover > .q-focus-helper
541
+ opacity: 0
542
+
543
+ &:focus-visible
544
+ outline: auto !important
545
+
546
+ .q-focus-helper
547
+ display: none
548
+
549
+ .date-picker-icon
550
+ color: $description
551
+
552
+ .selected-month-year
553
+ color: #12316C
554
+ background: #234ba926
555
+ border-radius: $xs
556
+
557
+ .q-dialog__inner .u-date
558
+ padding-bottom: 1rem
559
+
560
+ .date-sheet
561
+ .main-content-dialog
562
+ overflow: hidden
563
+ .date-sheet .q-card
564
+ padding-bottom: 1rem
565
+ </style>