@usssa/component-library 1.0.0-alpha.21 → 1.0.0-alpha.210

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 (97) hide show
  1. package/README.md +8 -5
  2. package/package.json +25 -6
  3. package/src/assets/fonts/CorneroRegular.woff +0 -0
  4. package/src/assets/fonts/CorneroRegular.woff2 +0 -0
  5. package/src/assets/logo.svg +19 -0
  6. package/src/assets/no-result.svg +25 -0
  7. package/src/assets/upload-illustration.svg +48 -0
  8. package/src/components/core/UAccordionSelect.vue +237 -0
  9. package/src/components/core/UAvatar.vue +90 -26
  10. package/src/components/core/UAvatarGroup.vue +62 -52
  11. package/src/components/core/UBadgeStd.vue +6 -1
  12. package/src/components/core/UBannerStd.vue +100 -31
  13. package/src/components/core/UBreadCrumbs.vue +171 -0
  14. package/src/components/core/UBtnIcon.vue +57 -52
  15. package/src/components/core/UBtnStd.vue +38 -31
  16. package/src/components/core/UBtnToggle.vue +11 -6
  17. package/src/components/core/UCheckboxStd.vue +26 -20
  18. package/src/components/core/UChip.vue +91 -43
  19. package/src/components/core/UDate.vue +581 -0
  20. package/src/components/core/UDialogStd.vue +452 -58
  21. package/src/components/core/UDrawer/UDrawer.vue +471 -0
  22. package/src/components/core/UDrawer/UDrawerMenuItem.vue +124 -0
  23. package/src/components/core/UEventCard.vue +419 -0
  24. package/src/components/core/UExpansionStd.vue +274 -0
  25. package/src/components/core/UExpansionTableStd.vue +297 -0
  26. package/src/components/core/UFilter.vue +89 -0
  27. package/src/components/core/UGameObject.vue +441 -0
  28. package/src/components/core/UInnerLoader.vue +69 -0
  29. package/src/components/core/UInputAddressLookup.vue +484 -0
  30. package/src/components/core/UInputPhoneStd.vue +74 -68
  31. package/src/components/core/UInputTextStd.vue +137 -116
  32. package/src/components/core/UInputTypeahead.vue +44 -0
  33. package/src/components/core/UInputTypeaheadAdvanceSearch.vue +134 -0
  34. package/src/components/core/UMenuButtonStd.vue +280 -0
  35. package/src/components/core/UMenuDropdown.vue +82 -0
  36. package/src/components/core/UMenuDropdownAdvancedSearch.vue +306 -0
  37. package/src/components/core/UMenuItem.vue +221 -0
  38. package/src/components/core/UMenuSearch.vue +73 -0
  39. package/src/components/core/UModal.vue +660 -0
  40. package/src/components/core/UMultiSelectStd.vue +501 -61
  41. package/src/components/core/UPagination.vue +84 -25
  42. package/src/components/core/URadioBtn.vue +66 -43
  43. package/src/components/core/URadioStd.vue +23 -14
  44. package/src/components/core/USelectStd.vue +415 -84
  45. package/src/components/core/USheet.vue +349 -0
  46. package/src/components/core/UStepper/UProgress.vue +157 -0
  47. package/src/components/core/UStepper/UStepper.vue +211 -0
  48. package/src/components/core/UTabBtnStd.vue +36 -22
  49. package/src/components/core/UTable/UTable.vue +2055 -57
  50. package/src/components/core/UTableStd.vue +1301 -273
  51. package/src/components/core/UTabsStd.vue +52 -23
  52. package/src/components/core/UToggleStd.vue +18 -13
  53. package/src/components/core/UToolbar/UCustomMenuIcon.vue +58 -0
  54. package/src/components/core/UToolbar/UToolbar.vue +226 -0
  55. package/src/components/core/UTooltip.vue +31 -10
  56. package/src/components/core/UTypeahead.vue +890 -0
  57. package/src/components/core/UUploader.vue +644 -0
  58. package/src/components/index.js +77 -26
  59. package/src/composables/useNotify.js +16 -16
  60. package/src/composables/useOverlayLoader.js +23 -0
  61. package/src/composables/useScreenType.js +30 -0
  62. package/src/css/app.sass +42 -25
  63. package/src/css/colors.sass +2 -0
  64. package/src/css/quasar.variables.sass +99 -68
  65. package/src/css/vars/colors.variables.sass +28 -41
  66. package/src/utils/data.ts +177 -0
  67. package/src/App.vue +0 -9
  68. package/src/boot/.gitkeep +0 -0
  69. package/src/layouts/MainLayout.vue +0 -137
  70. package/src/pages/Avatar.vue +0 -77
  71. package/src/pages/AvatarGroup.vue +0 -139
  72. package/src/pages/BadgeStd.vue +0 -83
  73. package/src/pages/BannerPage.vue +0 -76
  74. package/src/pages/BtnIcon.vue +0 -120
  75. package/src/pages/BtnStd.vue +0 -126
  76. package/src/pages/BtnToggle.vue +0 -131
  77. package/src/pages/CheckBox.vue +0 -62
  78. package/src/pages/Chip.vue +0 -92
  79. package/src/pages/ComponentBase.vue +0 -54
  80. package/src/pages/Dialog.vue +0 -206
  81. package/src/pages/ErrorNotFound.vue +0 -11
  82. package/src/pages/IndexPage.vue +0 -11
  83. package/src/pages/InputPhone.vue +0 -152
  84. package/src/pages/InputText.vue +0 -139
  85. package/src/pages/MultiSelectStd.vue +0 -174
  86. package/src/pages/NotifyPage.vue +0 -109
  87. package/src/pages/Pagination.vue +0 -71
  88. package/src/pages/Radio.vue +0 -80
  89. package/src/pages/RadioBtn.vue +0 -104
  90. package/src/pages/SelectStd.vue +0 -160
  91. package/src/pages/TabButtonPage.vue +0 -126
  92. package/src/pages/TablePage.vue +0 -371
  93. package/src/pages/TabsPage.vue +0 -261
  94. package/src/pages/TogglePage.vue +0 -58
  95. package/src/pages/TooltipPage.vue +0 -125
  96. package/src/router/index.js +0 -34
  97. package/src/router/routes.js +0 -113
@@ -1,16 +1,23 @@
1
1
  <script setup>
2
2
  import { computed } from 'vue'
3
- import UTooltip from './UTooltip.vue'
4
3
  import UAvatar from './UAvatar.vue'
4
+ import UTooltip from './UTooltip.vue'
5
+
6
+ const emit = defineEmits(['onClick'])
5
7
  const props = defineProps({
8
+ avatarLimit: {
9
+ type: Number,
10
+ default: 4,
11
+ },
6
12
  color: {
7
13
  type: String,
8
14
  default: 'primary',
9
15
  },
10
- icon: {
16
+ dataTestId: {
11
17
  type: String,
18
+ default: 'avatar-group',
12
19
  },
13
- size: {
20
+ icon: {
14
21
  type: String,
15
22
  },
16
23
  image: {
@@ -23,73 +30,76 @@ const props = defineProps({
23
30
  type: String,
24
31
  default: 'neutral-4',
25
32
  },
26
- name: {
27
- type: String,
28
- required: true,
29
- },
30
- showIndicator: {
33
+ round: {
31
34
  type: Boolean,
32
35
  default: false,
33
36
  },
34
- round: {
37
+ showEachTooltip: {
35
38
  type: Boolean,
36
39
  default: true,
37
40
  },
38
- avatarLimit: {
39
- type: Number,
40
- default: 4,
41
+ showIndicator: {
42
+ type: Boolean,
43
+ default: false,
44
+ },
45
+ size: {
46
+ type: String,
41
47
  },
42
48
  })
43
49
 
44
- const emit = defineEmits(['onClick'])
45
-
46
- const handleClick = () => {
47
- return emit('onClick')
48
- }
49
-
50
+ // computed properties
50
51
  const displayedAvatars = computed(() => {
51
52
  return props.images.slice(0, props.avatarLimit)
52
53
  })
53
54
  const remainingAvatars = computed(() => {
54
55
  return props.images.slice(props.avatarLimit)
55
56
  })
57
+
58
+ //custom functions
59
+ const handleClick = () => {
60
+ return emit('onClick')
61
+ }
56
62
  </script>
57
63
 
58
64
  <template>
59
- <UAvatar
60
- v-for="(avatar, index) in displayedAvatars"
61
- class="avatarGroup"
62
- :name="avatar.name"
63
- :size="size"
64
- :showIndicator="showIndicator"
65
- :indicatorColor="indicatorColor"
66
- :round="round"
67
- :image="avatar.image"
68
- :key="index"
69
- @click="handleClick"
70
- />
71
-
72
- <q-icon
73
- :class="`avatarGroup additonalUsersAvatar size-${size} fa-duotone fa-solid fa-circle-plus`"
74
- color="primary"
75
- aria-label="See more Avatar"
76
- v-if="remainingAvatars.length"
77
- >
78
- <UTooltip
79
- anchor="bottom middle"
80
- description=""
81
- self="top middle"
82
- :offset="[4, 4]"
65
+ <div :dataTestId="dataTestId">
66
+ <UAvatar
67
+ v-for="(avatar, index) in displayedAvatars"
68
+ class="avatarGroup"
69
+ :aria-label="avatar.name"
70
+ :image="avatar.image"
71
+ :indicatorColor="indicatorColor"
72
+ :key="index"
73
+ :name="avatar.name"
74
+ :round="round"
75
+ :showIndicator="showIndicator"
76
+ :showTooltip="showEachTooltip"
77
+ :size="size"
78
+ tabindex="0"
79
+ @click="handleClick"
80
+ />
81
+ <q-icon
82
+ v-if="remainingAvatars.length"
83
+ :class="`avatarGroup additonalUsersAvatar size-${size} fa-duotone fa-solid fa-circle-plus`"
84
+ aria-label="See more Avatar"
85
+ color="primary"
83
86
  >
84
- <template v-slot:item>
85
- <div class="text-body-xs tooltip-text">
86
- <span v-for="(avatar, index) in remainingAvatars" :key="index">
87
- {{ avatar.name }}<br />
88
- </span>
89
- </div>
90
- </template>
91
- </UTooltip>
92
- </q-icon>
87
+ <UTooltip
88
+ anchor="bottom middle"
89
+ description=""
90
+ :offset="[4, 4]"
91
+ self="top middle"
92
+ >
93
+ <template v-slot:item>
94
+ <div class="text-body-xs tooltip-text">
95
+ <span v-for="(avatar, index) in remainingAvatars" :key="index">
96
+ {{ avatar.name }}<br />
97
+ </span>
98
+ </div>
99
+ </template>
100
+ </UTooltip>
101
+ </q-icon>
102
+ </div>
93
103
  </template>
94
104
  <style lang="sass">
95
105
  .additonalUsersAvatar:after
@@ -97,7 +107,6 @@ const remainingAvatars = computed(() => {
97
107
  border-radius:50%
98
108
 
99
109
  .additonalUsersAvatar
100
- cursor: pointer
101
110
 
102
111
  &.size-sm
103
112
  font-size: $ba !important
@@ -113,6 +122,7 @@ const remainingAvatars = computed(() => {
113
122
 
114
123
  .avatarGroup
115
124
  margin: -0.125rem
125
+
116
126
  .avatarGroup:not(:nth-child(1)) .q-avatar__content
117
127
  border: 1.5px solid $neutral-1
118
128
  background : lightgray 0px -0.033px / 100% 150.273% no-repeat
@@ -6,6 +6,10 @@ const props = defineProps({
6
6
  type: String,
7
7
  default: 'primary',
8
8
  },
9
+ dataTestId: {
10
+ type: String,
11
+ default: 'badge-std'
12
+ },
9
13
  label: {
10
14
  type: String,
11
15
  default: '',
@@ -42,10 +46,11 @@ const currentColor = computed(() => {
42
46
  : `text-overline-sm`
43
47
  : '',
44
48
  ]"
49
+ :aria-label="label"
45
50
  :color="currentColor"
51
+ :dataTestId="dataTestId"
46
52
  rounded
47
53
  tabindex="0"
48
- :aria-label="label"
49
54
  >
50
55
  <div v-if="type === 'basic'">
51
56
  {{ label }}
@@ -1,34 +1,57 @@
1
1
  <script setup>
2
+ import { computed } from 'vue'
2
3
  import UBtnStd from './UBtnStd.vue'
4
+ import { useScreenType } from '../../composables/useScreenType'
5
+
6
+ const emit = defineEmits(['primaryAction', 'secondaryAction'])
3
7
 
4
8
  const props = defineProps({
5
- type: {
9
+ dataTestId: {
6
10
  type: String,
7
- default: 'info',
11
+ default: 'banner-std',
8
12
  },
9
13
  icon: {
10
14
  type: String,
11
15
  default: 'fa-kit-duotone fa-circle-info',
12
16
  },
17
+ label: {
18
+ type: String,
19
+ default: '',
20
+ },
13
21
  message: {
14
22
  type: String,
15
23
  default: '',
16
24
  required: true,
17
25
  },
26
+ primaryActionLabel: {
27
+ type: String,
28
+ },
29
+ secondaryActionLabel: {
30
+ type: String,
31
+ },
18
32
  show: {
19
33
  type: Boolean,
20
34
  default: false,
21
35
  required: true,
22
36
  },
23
- primaryActionLabel: {
24
- type: String,
37
+ showBorder: {
38
+ type: Boolean,
39
+ default: true,
25
40
  },
26
- secondaryActionLabel: {
41
+ type: {
27
42
  type: String,
43
+ default: 'info',
28
44
  },
29
45
  })
30
46
 
31
- const emit = defineEmits(['primaryAction', 'secondaryAction'])
47
+ const $screen = useScreenType()
48
+
49
+ const bordered = computed(() => {
50
+ if (props.showBorder) {
51
+ return 'bordered'
52
+ }
53
+ return ''
54
+ })
32
55
 
33
56
  const handlePrimaryActionClick = () => {
34
57
  emit('primaryAction')
@@ -41,75 +64,121 @@ const handleSecondaryActionClick = () => {
41
64
 
42
65
  <template>
43
66
  <q-banner
44
- v-if="show && message"
67
+ v-if="show && (message.trim() || label.trim())"
68
+ :class="[
69
+ `u-banner u-banner-${type}`,
70
+ !icon ? 'no-padding-label' : '',
71
+ bordered,
72
+ $screen.isMobile ? 'u-banner-sm' : 'u-banner-md',
73
+ ]"
74
+ :dataTestId="dataTestId"
45
75
  inline-actions
46
- :class="`u-banner u-banner-${type} ${!icon ? 'no-padding-label' : ''}`"
47
76
  tabindex="0"
48
77
  >
49
78
  <template v-slot:avatar>
50
79
  <q-icon
51
80
  v-if="icon"
52
- aria-label="Banner Icon"
53
81
  :class="icon"
54
- size="1.5rem"
55
- :color="type"
56
82
  alt="Banner Info Icon"
83
+ aria-label="Banner Icon"
84
+ :color="type"
85
+ size="sm"
57
86
  />
58
87
  </template>
59
- <span class="text-caption-lg">{{ message }}</span>
88
+
89
+ <div>
90
+ <span v-if="!label" class="text-caption-lg">{{ message }}</span>
91
+ <div v-else class="column">
92
+ <span class="text-caption-lg">{{ label }}</span>
93
+ <span class="text-body-sm">{{ message }}</span>
94
+ </div>
95
+ </div>
96
+
60
97
  <template v-slot:action>
61
- <u-btn-std
62
- v-if="primaryActionLabel"
63
- :flat="false"
64
- :label="primaryActionLabel"
65
- @onClick="handlePrimaryActionClick"
66
- :color="type"
67
- size="md"
68
- />
69
- <u-btn-std
70
- class="q-ml-sm"
71
- :outline="true"
72
- v-if="secondaryActionLabel"
73
- :label="secondaryActionLabel"
74
- @onClick="handleSecondaryActionClick"
75
- :color="type"
76
- size="md"
77
- />
98
+ <div :class="['row', $screen.isMobile ? 'full-width q-mt-ba' : '']">
99
+ <u-btn-std
100
+ v-if="secondaryActionLabel"
101
+ :color="type"
102
+ :label="secondaryActionLabel"
103
+ :outline="true"
104
+ size="md"
105
+ @onClick="handleSecondaryActionClick"
106
+ />
107
+ <u-btn-std
108
+ v-if="primaryActionLabel"
109
+ :color="type"
110
+ :label="primaryActionLabel"
111
+ size="md"
112
+ @onClick="handlePrimaryActionClick"
113
+ />
114
+ </div>
78
115
  </template>
79
116
  </q-banner>
80
117
  </template>
81
118
 
82
119
  <style lang="sass">
83
120
  .u-banner
84
- min-width: 24.563rem
85
- padding: $sm
86
121
  .q-banner__avatar
87
122
  align-self: center
88
123
 
89
124
  .q-banner__content
90
125
  padding-left: $xs !important
126
+ word-break: break-word
127
+ overflow-wrap: break-word
128
+
129
+ .u-banner-sm
130
+ flex-wrap: wrap
131
+ padding: $ba
132
+ .q-banner__actions
133
+ width: 100%
134
+ padding-left: 0px !important
135
+ >div
136
+ gap: $sm
137
+ .q-btn
138
+ flex: 1
139
+ min-width: 0
140
+
141
+ .u-banner-md
142
+ padding: $sm
143
+ .q-banner__actions
144
+ padding-left: $xs
145
+ >div
146
+ gap: $xs !important
91
147
 
92
148
  .u-banner-positive
93
149
  background: $green-1 !important
94
150
  color: $green-7 !important
151
+ &.bordered
152
+ border: 0.094rem solid $green-7
95
153
 
96
154
  .u-banner-info
97
155
  background: $purple-1 !important
98
156
  color: $info !important
157
+ &.bordered
158
+ border: 0.094rem solid $purple-7
99
159
 
100
160
  .u-banner-warning
101
161
  background: $orange-1 !important
102
162
  color: $orange-7 !important
163
+ &.bordered
164
+ border: 0.094rem solid $orange-7
103
165
 
104
166
  .u-banner-accent
105
167
  background: $red-1 !important
106
168
  color: $red-7 !important
169
+ &.bordered
170
+ border: 0.094rem solid $red-7
107
171
 
108
172
  .u-banner-primary
109
173
  background: $blue-1 !important
110
174
  color: $primary !important
175
+ &.bordered
176
+ border: 0.094rem solid $primary
111
177
 
112
178
  .no-padding-label
113
179
  .q-banner__content
114
180
  padding-left: 0px !important
181
+
182
+ .bordered
183
+ border-radius: $xs
115
184
  </style>
@@ -0,0 +1,171 @@
1
+ <script setup>
2
+ import { ref, computed } from 'vue'
3
+ import { useRouter } from 'vue-router'
4
+ import { useScreenType } from '../../composables/useScreenType'
5
+ import UTooltip from './UTooltip.vue'
6
+
7
+ const props = defineProps({
8
+ activeColor: {
9
+ type: String,
10
+ default: 'primary',
11
+ },
12
+ align: {
13
+ type: String,
14
+ default: 'left',
15
+ },
16
+ dataTestId: {
17
+ type: String,
18
+ default: 'breadcrumbs-std',
19
+ },
20
+ fontTypo: {
21
+ type: String,
22
+ default: 'text-caption-sm',
23
+ },
24
+ links: {
25
+ type: Array,
26
+ default: () => [],
27
+ },
28
+ showActiveRoute: {
29
+ type: Boolean,
30
+ default: true,
31
+ },
32
+ })
33
+
34
+ const router = useRouter()
35
+ const $screen = useScreenType()
36
+
37
+ const isOverflowing = ref(false)
38
+ const textEl = ref(null)
39
+
40
+ const currentLink = computed(() => {
41
+ return props.links[props.links.length - 1]
42
+ })
43
+
44
+ const lastTwoLinks = computed(() => {
45
+ return props.links.slice(-2)
46
+ })
47
+
48
+ const previousLinks = computed(() => {
49
+ if (props.links.length < 2) return []
50
+ return props.links.slice(0, -1).reverse()
51
+ })
52
+
53
+ const previousLinksForDesktop = computed(() => {
54
+ if (props.links.length <= 2) return []
55
+ return props.links.slice(0, -2).reverse()
56
+ })
57
+
58
+ const showMenuDropdown = computed(() => {
59
+ if ($screen.value.isMobile) {
60
+ if (previousLinks.value.length) {
61
+ return true
62
+ }
63
+ } else {
64
+ if (previousLinksForDesktop.value.length) {
65
+ return true
66
+ }
67
+ }
68
+ return false
69
+ })
70
+
71
+ const checkOverflow = () => {
72
+ if (textEl.value) {
73
+ isOverflowing.value = textEl.value.scrollWidth > textEl.value.clientWidth
74
+ }
75
+ }
76
+
77
+ const onClick = (link) => {
78
+ if (link.to) router.push(link.to)
79
+ }
80
+ </script>
81
+
82
+ <template>
83
+ <q-breadcrumbs
84
+ v-bind="$attrs"
85
+ class="u-breadcrumb"
86
+ :active-color="showActiveRoute ? activeColor : 'text-dark'"
87
+ :align="align"
88
+ :dataTestId="dataTestId"
89
+ gutter="none"
90
+ separator-color="text-dark"
91
+ >
92
+ <template v-slot:separator>
93
+ <span :class="fontTypo">/</span>
94
+ </template>
95
+
96
+ <!-- Dropdown for previous links -->
97
+ <q-breadcrumbs-el v-if="showMenuDropdown">
98
+ <span :class="`${fontTypo} cursor-pointer`">...</span>
99
+ <q-menu class="breadcrumb-menu">
100
+ <q-list class="u-menu-dropdown">
101
+ <q-item
102
+ v-for="(link, i) in $screen.isMobile
103
+ ? previousLinks
104
+ : previousLinksForDesktop"
105
+ class="u-menu-link"
106
+ clickable
107
+ :key="i"
108
+ @click="onClick(link)"
109
+ >
110
+ <q-item-section
111
+ :class="`text-body-sm text-${
112
+ showActiveRoute ? activeColor : 'dark'
113
+ }`"
114
+ >
115
+ {{ link.label }}
116
+ </q-item-section>
117
+ </q-item>
118
+ </q-list>
119
+ </q-menu>
120
+ </q-breadcrumbs-el>
121
+
122
+ <!-- For mobile -->
123
+
124
+ <q-breadcrumbs-el
125
+ v-if="currentLink && $screen.isMobile"
126
+ :class="fontTypo"
127
+ :aria-label="currentLink.label"
128
+ @click="onClick"
129
+ >
130
+ <div class="ellipsis-label" ref="textEl" @mouseenter="checkOverflow">
131
+ {{ currentLink?.label }}
132
+ </div>
133
+ <UTooltip v-if="isOverflowing" :description="currentLink?.label" />
134
+ </q-breadcrumbs-el>
135
+
136
+ <!-- For Desktop and Tablet -->
137
+
138
+ <template v-if="lastTwoLinks && !$screen.isMobile">
139
+ <q-breadcrumbs-el
140
+ v-for="(link, index) in lastTwoLinks"
141
+ :class="`${fontTypo}`"
142
+ :aria-label="link.label"
143
+ :key="index"
144
+ :to="link.to"
145
+ @click="onClick"
146
+ >
147
+ <div class="ellipsis-label" ref="textEl" @mouseenter="checkOverflow">
148
+ {{ link.label }}
149
+ </div>
150
+ <UTooltip v-if="isOverflowing" :description="link.label" />
151
+ </q-breadcrumbs-el>
152
+ </template>
153
+ </q-breadcrumbs>
154
+ </template>
155
+
156
+ <style lang="sass">
157
+ .u-breadcrumb
158
+ .q-breadcrumbs__separator
159
+ margin-left: $xs
160
+ margin-right: $xs
161
+ .ellipsis-label
162
+ max-width: 80vw
163
+ white-space: nowrap
164
+ overflow: hidden
165
+ text-overflow: ellipsis
166
+ .breadcrumb-menu
167
+ .u-menu-dropdown
168
+ .u-menu-link.q-item
169
+ padding: $xxs $xs
170
+ gap: 0px
171
+ </style>