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

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 +2061 -57
  50. package/src/components/core/UTableStd.vue +1311 -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,13 +1,42 @@
1
1
  <script setup>
2
2
  import { computed } from 'vue'
3
3
  import UTooltip from './UTooltip.vue'
4
+
5
+ const emit = defineEmits(['onRightIconClick'])
6
+
7
+ const modelValue = defineModel()
8
+ defineOptions({
9
+ inheritAttrs: false,
10
+ })
4
11
  const props = defineProps({
5
- hintText: {
12
+ borderless: {
13
+ type: Boolean,
14
+ default: false,
15
+ },
16
+ dataTestId: {
17
+ type: String,
18
+ default: 'input-text-std',
19
+ },
20
+ disable: {
21
+ type: Boolean,
22
+ default: false,
23
+ },
24
+ error: {
25
+ type: Boolean,
26
+ },
27
+ errorMessage: {
6
28
  type: String,
7
29
  },
8
30
  hintIcon: {
9
31
  type: String,
10
32
  },
33
+ hintText: {
34
+ type: String,
35
+ },
36
+ inputType: {
37
+ type: String,
38
+ default: 'text',
39
+ },
11
40
  isRequired: {
12
41
  type: Boolean,
13
42
  default: false,
@@ -15,21 +44,32 @@ const props = defineProps({
15
44
  label: {
16
45
  type: String,
17
46
  },
47
+ leftBorderRadius: {
48
+ type: Boolean,
49
+ default: false,
50
+ },
18
51
  leftIcon: {
19
52
  type: String,
20
53
  },
21
- rightIcon: {
22
- type: String,
54
+ loading: {
55
+ type: Boolean,
23
56
  },
57
+ mask: { default: '' },
24
58
  outlined: {
25
59
  type: Boolean,
26
60
  default: true,
27
61
  },
28
- borderless: {
62
+ parentClass: {
63
+ type: String,
64
+ },
65
+ placeholder: {
66
+ type: String,
67
+ },
68
+ readonly: {
29
69
  type: Boolean,
30
70
  default: false,
31
71
  },
32
- placeholder: {
72
+ rightIcon: {
33
73
  type: String,
34
74
  },
35
75
  rightIconAriaLabel: {
@@ -46,24 +86,6 @@ const props = defineProps({
46
86
  validationRules: {
47
87
  type: Array,
48
88
  },
49
- readonly: {
50
- type: Boolean,
51
- default: false,
52
- },
53
- disable: {
54
- type: Boolean,
55
- default: false,
56
- },
57
- error: {
58
- type: Boolean,
59
- },
60
- errorMessage: {
61
- type: String,
62
- },
63
- leftBorderRadius: {
64
- type: Boolean,
65
- default: false,
66
- },
67
89
  })
68
90
 
69
91
  const leftBorderRadius = computed(() => {
@@ -72,9 +94,6 @@ const leftBorderRadius = computed(() => {
72
94
  }
73
95
  return ''
74
96
  })
75
- const modelValue = defineModel()
76
-
77
- const emit = defineEmits(['onRightIconClick'])
78
97
 
79
98
  const handleRightIconClick = () => {
80
99
  emit('onRightIconClick')
@@ -82,104 +101,106 @@ const handleRightIconClick = () => {
82
101
  </script>
83
102
 
84
103
  <template>
85
- <div class="q-gutter-xs q-pb-ms">
86
- <div>
87
- <label
88
- v-if="label"
89
- role="label"
90
- for="input"
91
- class="row items-center q-mb-xxs"
104
+ <div :class="`q-gutter-xs ${parentClass}`" :dataTestId="dataTestId">
105
+ <label
106
+ v-if="label"
107
+ class="row items-center q-mb-xxs"
108
+ for="input"
109
+ role="label"
110
+ >
111
+ <div class="u-input-label text-body-sm">
112
+ <span>{{ label }}</span>
113
+ <span v-if="isRequired" class="text-red-5 text-body-sm q-mx-xs">
114
+ {{ '*' }}
115
+ </span>
116
+ </div>
117
+ <q-icon
118
+ v-if="toolTipText"
119
+ class="fa-kit-duotone fa-circle-info cursor-pointer"
120
+ :aria-label="toolTipText"
121
+ color="neutral-9"
122
+ size="1rem"
92
123
  >
93
- <div class="u-input-label text-body-sm">
94
- {{ label }}
95
- <span class="text-red-5 text-body-sm q-mx-xxs" v-if="isRequired">
96
- *
97
- </span>
98
- </div>
124
+ <UTooltip
125
+ anchor="top middle"
126
+ :description="toolTipText"
127
+ :offset="[0, 0]"
128
+ self="bottom middle"
129
+ />
130
+ </q-icon>
131
+ </label>
132
+ <q-input
133
+ v-bind="$attrs"
134
+ v-model="modelValue"
135
+ :class="`u-input field-${size} ${leftBorderRadius}`"
136
+ :aria-describedby="hintText"
137
+ :borderless="borderless"
138
+ :bottom-slots="!!hintText"
139
+ :disable="disable"
140
+ :error="error"
141
+ hide-bottom-space
142
+ id="input"
143
+ :mask="mask"
144
+ name="input"
145
+ :outlined="outlined"
146
+ :placeholder="placeholder"
147
+ :readonly="readonly"
148
+ :rules="validationRules"
149
+ :standout="!outlined"
150
+ :type="inputType"
151
+ >
152
+ <!--Added below line to resolve "Missing form label" accessibility issue -->
153
+ <template class="hidden">{{ label }}</template>
154
+ <template v-if="leftIcon" #prepend>
155
+ <slot name="prepend"></slot>
99
156
  <q-icon
100
- class="q-ml-xxs fa-kit-duotone fa-circle-info cursor-pointer"
101
- v-if="toolTipText"
102
- size="1rem"
103
- color="neutral-9"
104
- :aria-label="toolTipText"
105
- >
106
- <UTooltip
107
- :description="toolTipText"
108
- anchor="top middle"
109
- self="bottom middle"
110
- :offset="[0, 0]"
157
+ v-if="!$slots.prepend"
158
+ :class="`slot-icon-size-${size} ${leftIcon}`"
159
+ />
160
+ </template>
161
+ <template v-if="hintText" #hint>
162
+ <div class="row items-center text-neutral-9 no-wrap">
163
+ <q-icon
164
+ v-if="hintIcon"
165
+ :class="`${hintIcon} icon-secondary-opacity`"
166
+ :aria-label="hintText"
167
+ size="1rem"
111
168
  />
112
- </q-icon>
113
- </label>
114
- <q-input
115
- id="input"
116
- class="u-input"
117
- :class="`field-${size} ${leftBorderRadius}`"
118
- v-model="modelValue"
119
- name="input"
120
- :outlined="outlined"
121
- :placeholder="placeholder"
122
- :rules="validationRules"
123
- :standout="!outlined"
124
- type="text"
125
- :bottom-slots="!!hintText"
126
- hide-bottom-space
127
- :readonly="readonly"
128
- :disable="disable"
129
- :borderless="borderless"
130
- :error="error"
131
- v-bind="$attrs"
132
- >
133
- <template #prepend v-if="leftIcon">
134
- <slot name="prepend"></slot>
169
+ <div class="q-ml-xxs text-body-xs">{{ hintText }}</div>
170
+ </div>
171
+ </template>
172
+ <template #append>
173
+ <slot name="append">
174
+ <q-spinner v-if="loading" size="1rem" />
135
175
  <q-icon
136
- v-if="!$slots.prepend"
137
- :class="`slot-icon-size-${size} ${leftIcon}`"
176
+ v-if="rightIcon"
177
+ :class="`slot-icon-size-${size} ${rightIcon}`"
178
+ :aria-label="
179
+ rightIcon && rightIconAriaLabel
180
+ ? rightIconAriaLabel
181
+ : 'right input icon '
182
+ "
183
+ :tabindex="0"
184
+ @click="handleRightIconClick"
138
185
  />
139
- </template>
140
- <template #hint v-if="hintText">
141
- <div class="row items-center text-neutral-9 no-wrap">
142
- <q-icon
143
- :class="hintIcon"
144
- v-if="hintIcon"
145
- size="1rem"
146
- :aria-label="hintText"
147
- />
148
- <div class="q-ml-xxs text-body-xs">{{ hintText }}</div>
149
- </div>
150
- </template>
151
- <template #append>
152
- <slot name="append">
153
- <q-icon
154
- v-if="rightIcon"
155
- @click="handleRightIconClick"
156
- :class="`slot-icon-size-${size} ${rightIcon}`"
157
- :tabindex="0"
158
- :aria-label="
159
- rightIcon && rightIconAriaLabel
160
- ? rightIconAriaLabel
161
- : 'right input icon '
162
- "
163
- />
164
- </slot>
165
- </template>
166
- <template v-slot:error>
167
- <div class="row items-center no-wrap" v-if="errorMessage">
168
- <q-icon
169
- class="fa-kit-duotone fa-warning-octagon"
170
- size="1rem"
171
- :aria-label="errorMessage"
172
- />
173
- <div class="q-ml-xxs text-body-xs" role="validation error">
174
- {{ errorMessage }}
175
- </div>
186
+ </slot>
187
+ </template>
188
+ <template v-slot:error>
189
+ <div v-if="errorMessage" class="row items-center no-wrap">
190
+ <q-icon
191
+ class="fa-kit-duotone fa-warning-octagon"
192
+ :aria-label="errorMessage"
193
+ size="1rem"
194
+ />
195
+ <div class="q-ml-xxs text-body-xs" role="validation error">
196
+ {{ errorMessage }}
176
197
  </div>
177
- </template>
178
- </q-input>
179
- </div>
198
+ </div>
199
+ </template>
200
+ <slot name="menu" />
201
+ </q-input>
180
202
  </div>
181
203
  </template>
182
-
183
204
  <style lang="sass">
184
205
  .u-input
185
206
  .q-field--with-bottom
@@ -0,0 +1,44 @@
1
+ <script setup>
2
+ import UInputTextStd from './UInputTextStd.vue'
3
+ import { useScreenType } from '../../composables/useScreenType'
4
+
5
+ const emit = defineEmits(['updateInputVal'])
6
+
7
+ const props = defineProps({
8
+ label: {
9
+ type: String,
10
+ },
11
+ loading: {
12
+ type: Boolean,
13
+ },
14
+ searchText: {
15
+ type: String,
16
+ },
17
+ })
18
+
19
+ const $screen = useScreenType()
20
+
21
+ const updateInputVal = (event) => {
22
+ emit('updateInputVal', event)
23
+ }
24
+ </script>
25
+
26
+ <template>
27
+ <UInputTextStd
28
+ v-bind="$attrs"
29
+ :aria-label="label"
30
+ autocapitalize="off"
31
+ autocomplete="off"
32
+ autocorrect="off"
33
+ :debounce="500"
34
+ :label="label"
35
+ :loading="loading"
36
+ :modelValue="searchText"
37
+ spellcheck="false"
38
+ @update:modelValue="updateInputVal($event)"
39
+ >
40
+ <template v-if="!$screen.isMobile" v-slot:menu>
41
+ <slot name="menu" />
42
+ </template>
43
+ </UInputTextStd>
44
+ </template>
@@ -0,0 +1,134 @@
1
+ <script setup>
2
+ import { ref } from 'vue'
3
+ import UInputTextStd from './UInputTextStd.vue'
4
+ import UInputTypeahead from './UInputTypeahead.vue'
5
+ import USheet from './USheet.vue'
6
+ import { useScreenType } from '../../composables/useScreenType'
7
+
8
+ const emit = defineEmits([
9
+ 'addDialog',
10
+ 'onCloseDialog',
11
+ 'onInputFocus',
12
+ 'updateInputVal',
13
+ ])
14
+
15
+ const dialogs = defineModel('dialogs', { default: () => [], type: Array })
16
+
17
+ const props = defineProps({
18
+ closeIconLabel:{
19
+ type: String,
20
+ },
21
+ label: {
22
+ type: String,
23
+ },
24
+ loading: {
25
+ type: Boolean,
26
+ },
27
+ searchText: {
28
+ type: String,
29
+ },
30
+ selectOptionLabel: {
31
+ type: String,
32
+ },
33
+ size: {
34
+ type: String,
35
+ default: 'md',
36
+ },
37
+ })
38
+
39
+ const $screen = useScreenType()
40
+
41
+ const searchInputRef = ref(null)
42
+
43
+ const onCloseDialog = () => {
44
+ emit('onCloseDialog')
45
+ }
46
+
47
+ const onInputFocus = (event) => {
48
+ setTimeout(() => {
49
+ emit('addDialog')
50
+ if (event.target === document.activeElement) {
51
+ event.target.blur()
52
+ }
53
+ }, 300)
54
+ }
55
+
56
+ const updateInputVal = (event) => {
57
+ emit('updateInputVal', event)
58
+ }
59
+ </script>
60
+
61
+ <template>
62
+ <div class="typeahead-advance-search">
63
+ <div v-if="$screen.isMobile">
64
+ <UInputTextStd
65
+ v-bind="$attrs"
66
+ :aria-label="label"
67
+ autocapitalize="off"
68
+ autocomplete="off"
69
+ autocorrect="off"
70
+ :label="label"
71
+ readonly
72
+ ref="searchInputRef"
73
+ @click="onInputFocus"
74
+ @update:modelValue="updateInputVal($event)"
75
+ />
76
+ <USheet
77
+ v-model:dialogs="dialogs"
78
+ dialogClass="typeahead-sheet"
79
+ :close-icon-label="closeIconLabel"
80
+ :heading="selectOptionLabel"
81
+ @onCloseDialog="onCloseDialog"
82
+ >
83
+ <template #content>
84
+ <div class="q-mx-ba">
85
+ <UInputTypeahead
86
+ v-bind="$attrs"
87
+ :aria-label="label"
88
+ :label="label"
89
+ :loading="loading"
90
+ :modelValue="searchText"
91
+ @update:modelValue="updateInputVal($event)"
92
+ />
93
+ </div>
94
+
95
+ <slot name="menuContent" />
96
+ </template>
97
+ </USheet>
98
+ </div>
99
+ <div v-else>
100
+ <div :class="`input-search size-${size}`">
101
+ <UInputTypeahead
102
+ v-bind="$attrs"
103
+ :aria-label="label"
104
+ :label="label"
105
+ :loading="loading"
106
+ :modelValue="searchText"
107
+ @update:modelValue="updateInputVal($event)"
108
+ />
109
+ <slot name="menu" />
110
+ </div>
111
+ </div>
112
+ </div>
113
+ </template>
114
+
115
+ <style lang="sass">
116
+ .input-search
117
+ display: flex
118
+ flex-direction: column
119
+ &.size-sm
120
+ width: 24.5625rem
121
+ &.size-md
122
+ width: 26.5rem
123
+ .typeahead-sheet
124
+ .sheet-card-wrapper
125
+ .q-card__section--vert
126
+ padding:0px
127
+ .heading-row
128
+ padding: 0.125rem $ba $xs $ba
129
+ .q-card__section .q-item
130
+ padding: $xs $xs $xs $ba !important
131
+ align-items: center !important
132
+ border-radius: $xs !important
133
+ margin-bottom: 0px !important
134
+ </style>