@usssa/component-library 1.0.0-alpha.1 → 1.0.0-alpha.11

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 (103) hide show
  1. package/README.md +15 -37
  2. package/package.json +5 -7
  3. package/src/components/ComponentLink.vue +26 -0
  4. package/src/components/core/UAvatar.vue +146 -0
  5. package/src/components/core/UAvatarGroup.vue +119 -0
  6. package/src/components/core/UBadgeStd.vue +91 -0
  7. package/src/components/core/UBannerStd.vue +117 -0
  8. package/src/components/core/UBtnIcon.vue +148 -0
  9. package/src/components/core/UBtnStd.vue +122 -0
  10. package/src/components/core/UBtnToggle.vue +68 -0
  11. package/src/components/core/UCheckboxStd.vue +88 -0
  12. package/src/components/core/UChip.vue +226 -0
  13. package/src/components/core/UDialogStd.vue +202 -0
  14. package/src/components/core/UInputPhoneStd.vue +297 -0
  15. package/src/components/core/UInputTextStd.vue +269 -0
  16. package/src/components/core/UMultiSelectStd.vue +260 -0
  17. package/src/components/core/UPagination.vue +97 -0
  18. package/src/components/core/URadioStd.vue +58 -0
  19. package/src/components/core/USelectStd.vue +234 -0
  20. package/src/components/core/UTabBtnStd.vue +153 -0
  21. package/src/components/core/UTable/UTable.vue +83 -0
  22. package/src/components/core/UTable/UTd.vue +59 -0
  23. package/src/components/core/UTable/UTh.vue +44 -0
  24. package/src/components/core/UTable/UTr.vue +16 -0
  25. package/src/components/core/UTableStd.vue +547 -0
  26. package/src/components/core/UTabsStd.vue +99 -0
  27. package/src/components/core/UToggleStd.vue +149 -0
  28. package/src/components/core/UTooltip.vue +57 -0
  29. package/src/components/index.js +43 -0
  30. package/src/composables/useNotify.js +79 -0
  31. package/dist/spa/assets/Avatar.45667392.js +0 -9
  32. package/dist/spa/assets/AvatarGroup.99557443.js +0 -9
  33. package/dist/spa/assets/AvatarGroup.bb4cd03a.css +0 -1
  34. package/dist/spa/assets/BadgeStd.ee4129c5.js +0 -6
  35. package/dist/spa/assets/BannerPage.6c6a98c4.js +0 -10
  36. package/dist/spa/assets/BannerPage.d195fcac.css +0 -1
  37. package/dist/spa/assets/BtnIcon.89e50d2e.css +0 -1
  38. package/dist/spa/assets/BtnIcon.934f8c5b.js +0 -10
  39. package/dist/spa/assets/BtnStd.95fc4510.js +0 -11
  40. package/dist/spa/assets/CheckBox.3c204a4b.css +0 -1
  41. package/dist/spa/assets/CheckBox.fbc0bd1a.js +0 -7
  42. package/dist/spa/assets/Chip.49ffc857.js +0 -11
  43. package/dist/spa/assets/Chip.74acaa33.css +0 -1
  44. package/dist/spa/assets/ComponentBase.1ae19b7e.js +0 -1
  45. package/dist/spa/assets/ErrorNotFound.6cccfaee.js +0 -1
  46. package/dist/spa/assets/IndexPage.17d09b76.js +0 -1
  47. package/dist/spa/assets/InputText.19c0d7d1.css +0 -1
  48. package/dist/spa/assets/InputText.3fcd97a4.js +0 -20
  49. package/dist/spa/assets/KFOkCnqEu92Fr1MmgVxIIzQ.34e9582c.woff +0 -0
  50. package/dist/spa/assets/KFOlCnqEu92Fr1MmEU9fBBc-.9ce7f3ac.woff +0 -0
  51. package/dist/spa/assets/KFOlCnqEu92Fr1MmSU5fBBc-.bf14c7d7.woff +0 -0
  52. package/dist/spa/assets/KFOlCnqEu92Fr1MmWUlfBBc-.e0fd57c0.woff +0 -0
  53. package/dist/spa/assets/KFOlCnqEu92Fr1MmYUtfBBc-.f6537e32.woff +0 -0
  54. package/dist/spa/assets/KFOmCnqEu92Fr1Mu4mxM.f2abf7fb.woff +0 -0
  55. package/dist/spa/assets/MainLayout.912bb0f8.js +0 -1
  56. package/dist/spa/assets/MultiSelectStd.644b108c.js +0 -17
  57. package/dist/spa/assets/MultiSelectStd.c7af49eb.css +0 -1
  58. package/dist/spa/assets/QAvatar.5940a79e.js +0 -1
  59. package/dist/spa/assets/QCheckbox.48b43f7d.js +0 -1
  60. package/dist/spa/assets/QPage.ca395ec4.js +0 -1
  61. package/dist/spa/assets/QRadio.0a7f5e2c.js +0 -1
  62. package/dist/spa/assets/QResizeObserver.30c3566c.js +0 -1
  63. package/dist/spa/assets/QSelect.a40eb786.js +0 -1
  64. package/dist/spa/assets/QTabs.72f2507e.js +0 -1
  65. package/dist/spa/assets/QToggle.376c48be.js +0 -1
  66. package/dist/spa/assets/QTooltip.5aa8e325.js +0 -1
  67. package/dist/spa/assets/Radio.0ac35288.js +0 -7
  68. package/dist/spa/assets/Radio.aca54a89.css +0 -1
  69. package/dist/spa/assets/SelectStd.5c6891db.css +0 -1
  70. package/dist/spa/assets/SelectStd.daf1def9.js +0 -16
  71. package/dist/spa/assets/TabButtonPage.20e871dd.js +0 -7
  72. package/dist/spa/assets/TabButtonPage.36ce9f9c.css +0 -1
  73. package/dist/spa/assets/TabsPage.9b94ff39.css +0 -1
  74. package/dist/spa/assets/TabsPage.b92cccee.js +0 -9
  75. package/dist/spa/assets/TogglePage.8129b631.css +0 -1
  76. package/dist/spa/assets/TogglePage.ba6e325c.js +0 -9
  77. package/dist/spa/assets/UAvatar.dda7e478.js +0 -1
  78. package/dist/spa/assets/UAvatar.ea8daa38.css +0 -1
  79. package/dist/spa/assets/UBadgeStd.3965db9a.css +0 -1
  80. package/dist/spa/assets/UBadgeStd.e165ee05.js +0 -1
  81. package/dist/spa/assets/UBtnStd.979ec4e8.js +0 -1
  82. package/dist/spa/assets/UBtnStd.bdd4f5e5.css +0 -1
  83. package/dist/spa/assets/UTooltip.d2e04d0c.js +0 -1
  84. package/dist/spa/assets/UTooltip.efa029a7.css +0 -1
  85. package/dist/spa/assets/dom.e9d4ad51.js +0 -1
  86. package/dist/spa/assets/flUhRq6tzZclQEJ-Vdg-IuiaDsNa.fd84f88b.woff +0 -0
  87. package/dist/spa/assets/flUhRq6tzZclQEJ-Vdg-IuiaDsNcIhQ8tQ.4a4dbc62.woff2 +0 -0
  88. package/dist/spa/assets/format.41663636.js +0 -1
  89. package/dist/spa/assets/index.43c62a18.js +0 -21
  90. package/dist/spa/assets/index.4fbd73cf.css +0 -5
  91. package/dist/spa/assets/option-sizes.10cc02d3.js +0 -1
  92. package/dist/spa/assets/render.e67ff27a.js +0 -1
  93. package/dist/spa/assets/tooltip.7c0d0774.js +0 -8
  94. package/dist/spa/assets/touch.9135741d.js +0 -1
  95. package/dist/spa/assets/use-checkbox.44a623c0.js +0 -1
  96. package/dist/spa/favicon.ico +0 -0
  97. package/dist/spa/icons/caret-down.svg +0 -5
  98. package/dist/spa/icons/circle-xmark.svg +0 -6
  99. package/dist/spa/icons/favicon-128x128.png +0 -0
  100. package/dist/spa/icons/favicon-16x16.png +0 -0
  101. package/dist/spa/icons/favicon-32x32.png +0 -0
  102. package/dist/spa/icons/favicon-96x96.png +0 -0
  103. package/dist/spa/index.html +0 -3
@@ -0,0 +1,269 @@
1
+ <script setup>
2
+ import { computed } from 'vue'
3
+ import UTooltip from './UTooltip.vue'
4
+ const props = defineProps({
5
+ hintText: {
6
+ type: String,
7
+ },
8
+ hintIcon: {
9
+ type: String,
10
+ default: 'fa-kit-duotone fa-circle-info',
11
+ },
12
+ isRequired: {
13
+ type: Boolean,
14
+ default: false,
15
+ },
16
+ label: {
17
+ type: String,
18
+ },
19
+ leftIcon: {
20
+ type: String,
21
+ },
22
+ rightIcon: {
23
+ type: String,
24
+ },
25
+ outlined: {
26
+ type: Boolean,
27
+ default: true,
28
+ },
29
+ borderless: {
30
+ type: Boolean,
31
+ default: false,
32
+ },
33
+ placeholder: {
34
+ type: String,
35
+ default: 'Input Text',
36
+ },
37
+ size: {
38
+ type: String,
39
+ default: 'md',
40
+ validator: (val) => ['sm', 'md', 'lg'].includes(val),
41
+ },
42
+ toolTipText: {
43
+ type: String,
44
+ },
45
+ validationRules: {
46
+ type: Array,
47
+ },
48
+ readonly: {
49
+ type: Boolean,
50
+ default: false,
51
+ },
52
+ disable: {
53
+ type: Boolean,
54
+ default: false,
55
+ },
56
+ error: {
57
+ type: Boolean,
58
+ },
59
+ errorMessage: {
60
+ type: String,
61
+ },
62
+ leftBorderRadius: {
63
+ type: Boolean,
64
+ default: false,
65
+ },
66
+ })
67
+
68
+ const leftBorderRadius = computed(() => {
69
+ if (props.leftBorderRadius === true) {
70
+ return 'leftBorderRadius'
71
+ }
72
+ return ''
73
+ })
74
+ const modelValue = defineModel()
75
+ </script>
76
+
77
+ <template>
78
+ <div class="q-gutter-xs q-pb-ms">
79
+ <div>
80
+ <label
81
+ v-if="label"
82
+ role="label"
83
+ for="input"
84
+ class="row items-center q-mb-xxs"
85
+ >
86
+ <div class="u-input-label text-body-sm">
87
+ {{ label }}
88
+ <span class="text-red-5 text-body-sm q-mx-xxs" v-if="isRequired">
89
+ *
90
+ </span>
91
+ </div>
92
+ <q-icon
93
+ class="q-ml-xxs fa-kit-duotone fa-circle-info cursor-pointer"
94
+ v-if="toolTipText"
95
+ size="1rem"
96
+ color="neutral-9"
97
+ :aria-label="toolTipText"
98
+ >
99
+ <UTooltip
100
+ :description="toolTipText"
101
+ anchor="top middle"
102
+ self="bottom middle"
103
+ :offset="[0, 0]"
104
+ />
105
+ </q-icon>
106
+ </label>
107
+ <q-input
108
+ id="input"
109
+ class="u-input"
110
+ :class="`field-${size} ${leftBorderRadius}`"
111
+ v-model="modelValue"
112
+ name="input"
113
+ :outlined="outlined"
114
+ :placeholder="placeholder"
115
+ :rules="validationRules"
116
+ :standout="!outlined"
117
+ type="text"
118
+ :bottom-slots="!!hintText"
119
+ hide-bottom-space
120
+ :readonly="readonly"
121
+ :disable="disable"
122
+ :borderless="borderless"
123
+ :error="error"
124
+ v-bind="$attrs"
125
+ >
126
+ <template #prepend v-if="leftIcon">
127
+ <slot name="prepend"></slot>
128
+ <q-icon
129
+ v-if="!$slots.prepend"
130
+ :class="`slot-icon-size-${size} ${leftIcon}`"
131
+ />
132
+ </template>
133
+ <template #hint v-if="hintText">
134
+ <div class="row items-center text-neutral-9 no-wrap">
135
+ <q-icon
136
+ :class="hintIcon"
137
+ v-if="hintIcon"
138
+ size="1rem"
139
+ :aria-label="hintText"
140
+ />
141
+ <div class="q-ml-xxs text-body-xs">{{ hintText }}</div>
142
+ </div>
143
+ </template>
144
+ <template #append v-if="rightIcon">
145
+ <q-icon :class="`slot-icon-size-${size} ${rightIcon}`" />
146
+ </template>
147
+
148
+ <template v-slot:error>
149
+ <div class="row items-center no-wrap" v-if="errorMessage">
150
+ <q-icon
151
+ class="fa-kit-duotone fa-warning-octagon"
152
+ size="1rem"
153
+ :aria-label="errorMessage"
154
+ />
155
+ <div class="q-ml-xxs text-body-xs" role="validation error">
156
+ {{ errorMessage }}
157
+ </div>
158
+ </div>
159
+ </template>
160
+ </q-input>
161
+ </div>
162
+ </div>
163
+ </template>
164
+
165
+ <style lang="sass">
166
+ .u-input
167
+ .q-field--with-bottom
168
+ padding-bottom: 0px
169
+ &.q-field--outlined.q-field--disabled .q-field__control
170
+ background: $neutral-3
171
+ &.leftBorderRadius
172
+ &.q-field--outlined .q-field__control
173
+ border-radius: 0px $xs $xs 0px
174
+ &.q-field--borderless
175
+ .q-field__control
176
+ border-radius: 0px $xs $xs 0px
177
+
178
+ .q-field__inner
179
+ border-radius: $xs
180
+
181
+ &.q-field--borderless
182
+ .q-field__control
183
+ padding: 0 $xs
184
+ background: $neutral-1
185
+ border-radius: $xs
186
+ &:hover
187
+ box-shadow : 0px 0px 0px 2px $primary-transparent
188
+
189
+ .q-field--standout .q-field__control
190
+ border-radius: $xs
191
+
192
+ .q-field__append.q-field__marginal.row.no-wrap.items-center.q-anchor--skip
193
+ display: none
194
+
195
+ .q-field__before,
196
+ .q-field__prepend
197
+ padding: 0 $xs
198
+ padding-left: 0
199
+
200
+ .q-field__after,
201
+ .q-field__append
202
+ padding-left: $xs
203
+
204
+ .q-icon
205
+ &.slot-icon-size-sm
206
+ font-size: $sm
207
+ &.slot-icon-size-md
208
+ font-size: $ba
209
+ &.slot-icon-size-lg
210
+ font-size: $ba
211
+
212
+ &.q-field--auto-height .q-field__control,
213
+ &.q-field--auto-height .q-field__native
214
+ min-height: $md
215
+
216
+ &.q-field--outlined .q-field__control
217
+ border-radius: $xs
218
+ padding: 0 $xs
219
+ background: $neutral-1
220
+
221
+ &::before
222
+ border:1.5px solid $neutral-4
223
+
224
+ &:hover::before
225
+ border:1.5px solid $primary
226
+
227
+ .q-field__control.relative-position.row.no-wrap.text-negative:focus-within
228
+ box-shadow: 0px 0px 0px 2px $accent-transparent
229
+
230
+ .q-field__control:focus-within
231
+ box-shadow : 0px 0px 0px 2px $primary-transparent
232
+
233
+ &.field-sm
234
+ .q-field__control,
235
+ .q-field__marginal
236
+ height: $md
237
+ &.q-field--outlined.q-field__control
238
+ padding: 0 $xs
239
+
240
+ &.q-field__prepend .q-field__marginal
241
+ padding: 0 $xs
242
+
243
+ &.field-md
244
+ .q-field__control,
245
+ .q-field__marginal
246
+ height: $lg
247
+ &.q-field--outlined.q-field__control
248
+ padding: 0 $xs
249
+
250
+ &.q-field__prepend.q-field__marginal
251
+ padding: 0 $xs
252
+ padding-left: 0
253
+
254
+ &.field-lg
255
+ .q-field__control,
256
+ .q-field__marginal
257
+ height: $xl
258
+ &.q-field--outlined .q-field__control
259
+ padding: 0 $sm
260
+ .q-field__prepend.q-field__marginal
261
+ padding-left: 0px
262
+
263
+ .q-field__bottom
264
+ padding: 0
265
+ align-items: center
266
+
267
+ .q-field__messages
268
+ margin-top: $xxs
269
+ </style>
@@ -0,0 +1,260 @@
1
+ <script setup>
2
+ import { ref } from 'vue'
3
+ import UTooltip from './UTooltip.vue'
4
+ import UChip from './UChip.vue'
5
+
6
+ const props = defineProps({
7
+ modelValue: {
8
+ type: [Array, String, null],
9
+ required: true,
10
+ },
11
+ color: {
12
+ type: String,
13
+ default: 'neutral-7',
14
+ },
15
+ hintText: {
16
+ type: String,
17
+ },
18
+ hintIcon: {
19
+ type: String,
20
+ default: 'fa-kit-duotone fa-triangle-exclamation',
21
+ },
22
+ isRequired: {
23
+ type: Boolean,
24
+ default: false,
25
+ },
26
+ label: {
27
+ type: String,
28
+ default: 'Label',
29
+ },
30
+ leftIcon: {
31
+ type: String,
32
+ },
33
+ options: {
34
+ type: Array,
35
+ required: true,
36
+ },
37
+ placeholder: {
38
+ type: String,
39
+ default: 'Select',
40
+ },
41
+ size: {
42
+ type: String,
43
+ default: 'md',
44
+ validator: (val) => ['sm', 'md', 'lg'].includes(val),
45
+ },
46
+ toolTipText: {
47
+ type: String,
48
+ },
49
+ updateFn: {
50
+ type: Function,
51
+ required: true,
52
+ },
53
+ filterFn: {
54
+ type: Function,
55
+ required: false,
56
+ },
57
+ useInput: {
58
+ type: Boolean,
59
+ required: false,
60
+ },
61
+ multiSelect: {
62
+ type: Boolean,
63
+ default: true,
64
+ },
65
+ noSearchText: {
66
+ type: String,
67
+ required: false,
68
+ },
69
+ optionValue: {
70
+ type: String,
71
+ default: 'value',
72
+ },
73
+ optionLabel: {
74
+ type: String,
75
+ default: 'label',
76
+ },
77
+ })
78
+
79
+ const chipModelVal = ref(true)
80
+ </script>
81
+
82
+ <template>
83
+ <div class="q-gutter-xs">
84
+ <label for="select" class="row items-center">
85
+ <div class="u-select-label text-body-sm">
86
+ {{ label }}
87
+ <span class="text-red-5 q-ml-xs" v-if="isRequired">*</span>
88
+ </div>
89
+
90
+ <q-icon
91
+ class="q-ml-xs fa-kit-duotone fa-circle-info cursor-pointer"
92
+ v-if="toolTipText"
93
+ size="1rem"
94
+ color="neutral-9"
95
+ aria-hidden="true"
96
+ >
97
+ <UTooltip
98
+ :description="toolTipText"
99
+ anchor="top middle"
100
+ self="bottom middle"
101
+ />
102
+ </q-icon>
103
+ </label>
104
+ <q-select
105
+ class="u-multi-select"
106
+ id="multi-select"
107
+ :class="`field-${size}`"
108
+ :modelValue="modelValue"
109
+ :color="color"
110
+ multiple
111
+ :options="options"
112
+ :use-input="useInput"
113
+ :option-label="optionLabel"
114
+ :option-value="optionValue"
115
+ :placeholder="placeholder"
116
+ dropdown-icon="img:icons/caret-down.svg"
117
+ bottom-slots
118
+ outlined
119
+ hide-bottom-space
120
+ use-chips
121
+ :menu-offset="[0, 5]"
122
+ options-selected-class="primary bg-blue-1"
123
+ popup-content-class="u-option-menu"
124
+ v-bind="$attrs"
125
+ @add="
126
+ (details) =>
127
+ updateFn({
128
+ ...details,
129
+ multiSelect,
130
+ })
131
+ "
132
+ @remove="
133
+ (details) =>
134
+ updateFn({
135
+ remove: true,
136
+ ...details,
137
+ })
138
+ "
139
+ @update:model-value="(val) => updateFn(val)"
140
+ @filter="filterFn"
141
+ >
142
+ <template v-slot:no-option>
143
+ <q-item>
144
+ <q-item-section class="text-grey">
145
+ {{ noSearchText }}
146
+ </q-item-section>
147
+ </q-item>
148
+ </template>
149
+
150
+ <template v-if="leftIcon" v-slot:prepend>
151
+ <q-icon :class="leftIcon" size="1rem" />
152
+ </template>
153
+
154
+ <template v-if="hintText" v-slot:hint>
155
+ <div class="row no-wrap items-center">
156
+ <q-icon :class="hintIcon" size="1rem" v-if="hintIcon" />
157
+
158
+ <div class="q-mx-xxs text-body-xs">
159
+ {{ hintText }}
160
+ </div>
161
+ </div>
162
+ </template>
163
+
164
+ <template v-slot:option="scope">
165
+ <q-item class="items-center u-custom-options" v-bind="scope.itemProps">
166
+ <div class="q-pr-xs" v-if="scope.opt.icon">
167
+ <q-icon :class="scope.opt.icon" color="neutral-13" size="1rem" />
168
+ </div>
169
+
170
+ <q-item-section>
171
+ <q-item-label class="text-body-sm">
172
+ {{ scope.opt.label }}
173
+ </q-item-label>
174
+ <q-item-label caption v-if="scope.opt.description">
175
+ {{ scope.opt.description }}
176
+ </q-item-label>
177
+ </q-item-section>
178
+
179
+ <q-item-section v-if="scope.selected" side>
180
+ <q-icon
181
+ class="fa-kit-duotone fa-circle-check"
182
+ color="primary"
183
+ size="1rem"
184
+ />
185
+ </q-item-section>
186
+ </q-item>
187
+ </template>
188
+ <template v-slot:selected-item="scope">
189
+ <UChip
190
+ v-model="chipModelVal"
191
+ :chipLabel="scope.opt.label"
192
+ :removable="true"
193
+ @remove="scope.removeAtIndex(scope.index)"
194
+ :tabindex="scope.tabindex"
195
+ dense
196
+ />
197
+ </template>
198
+ </q-select>
199
+ </div>
200
+ </template>
201
+
202
+ <style lang="sass">
203
+ .u-multi-select
204
+ &.q-field--auto-height .q-field__control,
205
+ &.q-field--auto-height .q-field__native
206
+ min-height: $md
207
+ align-items: center
208
+
209
+ &.q-field--outlined .q-field__control
210
+ border-radius: $xs
211
+ padding: 0 $xs
212
+
213
+ &::before
214
+ background: white
215
+ border: 1.5px solid $neutral-4
216
+
217
+ &.field-sm
218
+ .q-field__marginal
219
+ height: $md
220
+
221
+ &.field-md
222
+ .q-field__marginal
223
+ height: $lg
224
+
225
+ &.field-lg
226
+ .q-field__marginal
227
+ height: $xl
228
+
229
+ &:hover .q-field__control::before
230
+ border: 1.5px solid $primary
231
+
232
+ &.q-field--with-bottom
233
+ padding-bottom: 0
234
+
235
+ .q-field__control:focus-within
236
+ box-shadow : 0 0 0 2px $primary-transparent
237
+
238
+ .q-field__bottom
239
+ padding: 4px 0 0 0
240
+
241
+ .q-chip__content
242
+ color: $neutral-9
243
+
244
+ .q-field__prepend
245
+ padding-right: $xs
246
+
247
+ .u-option-menu
248
+ border-radius: $xs
249
+ box-shadow: $shadow-2
250
+ max-height: 11.25rem !important
251
+ width: 18rem
252
+ overflow-y: auto
253
+ scrollbar-width: none
254
+
255
+ .u-custom-options
256
+ margin: $xxs
257
+ border-radius: $xxs
258
+ padding: $xs
259
+ min-height: $lg
260
+ </style>
@@ -0,0 +1,97 @@
1
+ <script setup>
2
+ import { ref, watch } from 'vue'
3
+ import USelectStd from './USelectStd.vue'
4
+ const props = defineProps({
5
+ modelValue: {
6
+ type: Number,
7
+ default: 1,
8
+ },
9
+ rowPerPage: {
10
+ type: String,
11
+ default: '5 / per page',
12
+ },
13
+ maxPageLink: {
14
+ //Maximum number of page links to display at a time
15
+ type: Number,
16
+ default: 2,
17
+ },
18
+ maxPages: {
19
+ type: Number,
20
+ default: 10,
21
+ },
22
+ perPageOptions: {
23
+ type: Array,
24
+ default: () => [
25
+ { label: '5 / per page', value: 5 },
26
+ { label: '10 / per page', value: 10 },
27
+ { label: '15 / per page', value: 15 },
28
+ { label: '20 / per page', value: 20 },
29
+ ],
30
+ },
31
+ })
32
+ const emit = defineEmits(['update:modelValue', 'onRowChange', 'onPageChange'])
33
+ const rowPerPage = ref(props.rowPerPage)
34
+ const currentPage = ref(props.modelValue)
35
+
36
+ watch(currentPage, (newValue) => {
37
+ emit('update:modelValue', newValue)
38
+ emit('onPageChange', newValue)
39
+ })
40
+ const onPageChange = (newPage) => {
41
+ currentPage.value = newPage
42
+ }
43
+ const onRowChange = (newRowPerPage) => {
44
+ emit('onRowChange', newRowPerPage)
45
+ }
46
+ </script>
47
+
48
+ <template>
49
+ <div class="row full-width u-pagination-container">
50
+ <q-pagination
51
+ class="u-pagination"
52
+ v-model="currentPage"
53
+ direction-links
54
+ flat
55
+ color="dark"
56
+ active-color="primary"
57
+ :max="maxPages"
58
+ :max-pages="maxPageLink"
59
+ boundary-numbers
60
+ @update:model-value="onPageChange"
61
+ icon-prev="img:icons/chevron-left.svg"
62
+ icon-next="img:icons/chevron-right.svg"
63
+ gutter="sm"
64
+ />
65
+
66
+ <USelectStd
67
+ class="q-gutter-x-sm text-body-sm"
68
+ v-model="rowPerPage"
69
+ color="primary"
70
+ :options="perPageOptions"
71
+ popupClass="pagination-dropdown"
72
+ @update:model-value="onRowChange"
73
+ />
74
+ </div>
75
+ </template>
76
+
77
+ <style lang="sass">
78
+ .pagination-dropdown
79
+ width: auto
80
+ .u-pagination
81
+ .q-icon
82
+ font-size: $ba
83
+ .q-btn
84
+ background: $neutral-1
85
+ border-radius: $xs
86
+ width: $md
87
+ height: $md
88
+ font-size: $sm
89
+ font-style: normal
90
+ font-weight: 500
91
+ line-height: 1.25rem
92
+ letter-spacing: .03333rem
93
+ &:hover
94
+ background: $blue-1
95
+ &::before
96
+ box-shadow: none
97
+ </style>
@@ -0,0 +1,58 @@
1
+ <script setup>
2
+ import { onMounted } from 'vue'
3
+
4
+ const props = defineProps({
5
+ label: {
6
+ type: String,
7
+ default: 'Radio',
8
+ },
9
+ value: {
10
+ type: String,
11
+ },
12
+ disable: {
13
+ type: Boolean,
14
+ default: false,
15
+ },
16
+ id: {
17
+ type: [String, Number],
18
+ default: 'u-radio',
19
+ required: true, // it is required for to match accessibility crieteria
20
+ },
21
+ })
22
+ onMounted(() => {
23
+ const radioElement = document.getElementById(props.id)
24
+ if (radioElement) {
25
+ const inputElement = radioElement.querySelector('input')
26
+ inputElement.id = props.id
27
+ }
28
+ })
29
+
30
+ const radioValue = defineModel()
31
+ </script>
32
+
33
+ <template>
34
+ <label class="hidden" :for="id">Radio</label>
35
+ <q-radio
36
+ v-model="radioValue"
37
+ class="u-radio"
38
+ :val="value"
39
+ color="primary"
40
+ keep-color
41
+ dense
42
+ size="3rem"
43
+ :disable="disable"
44
+ :id="id"
45
+ >
46
+ <div class="text-center text-caption-lg radio-label">
47
+ {{ label }}
48
+ </div>
49
+ </q-radio>
50
+ </template>
51
+
52
+ <style lang="sass">
53
+ .u-radio
54
+ .q-radio__label
55
+ padding-left: $xs !important
56
+ .radio-label
57
+ color: $primary
58
+ </style>