@usssa/component-library 1.0.0-alpha.245 → 1.0.0-alpha.246

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@usssa/component-library",
3
- "version": "1.0.0-alpha.245",
3
+ "version": "1.0.0-alpha.246",
4
4
  "description": "A Quasar component library project",
5
5
  "productName": "Quasar component library App",
6
6
  "author": "Engineering Team <engineering@usssa.com>",
@@ -1,5 +1,6 @@
1
1
  <script setup>
2
2
  import { nextTick, ref, watch } from 'vue'
3
+ import UBtnStd from './UBtnStd.vue'
3
4
  import URadioStd from './URadioStd.vue'
4
5
  import UTooltip from './UTooltip.vue'
5
6
 
@@ -37,6 +38,19 @@ const props = defineProps({
37
38
  type: String,
38
39
  default: 'Expand',
39
40
  },
41
+ expansionButtonProps: {
42
+ type: Object,
43
+ default: () => ({
44
+ flat: true,
45
+ outline: false,
46
+ color: 'primary',
47
+ label: '',
48
+ size: '',
49
+ rightIcon: 'fa-kit fa-caret-down',
50
+ leftIcon: '',
51
+ disable: false,
52
+ }),
53
+ },
40
54
  expansionIcon: {
41
55
  type: String,
42
56
  default: 'fa-kit fa-caret-down',
@@ -61,6 +75,10 @@ const props = defineProps({
61
75
  type: Number,
62
76
  default: 20.563,
63
77
  },
78
+ useExpansionButton: {
79
+ type: Boolean,
80
+ default: false,
81
+ },
64
82
  toggleIconLeft: {
65
83
  type: Boolean,
66
84
  default: false,
@@ -175,25 +193,39 @@ watch(
175
193
  :description="label"
176
194
  :offset="[14, 14]"
177
195
  />
178
- <span class="text-body-xs">{{ caption }}</span>
196
+ <template v-if="$slots.caption">
197
+ <slot name="caption" />
198
+ </template>
199
+ <template v-else>
200
+ <span class="text-body-xs text-description">{{ caption }}</span>
201
+ </template>
179
202
  </div>
180
- <q-icon
181
- v-if="!toggleIconLeft"
182
- :class="[
183
- 'cursor-pointer',
184
- 'icon-secondary-opacity',
185
- 'transition-all',
186
- expansionIcon,
187
- isExpanded ? toggleIconRotationClass : '',
188
- ]"
189
- :aria-label="isExpanded ? collapsedAriaLabel : expandAriaLabel"
190
- :color="expansionIconColor"
191
- :size="expansionIconSize"
192
- :tabindex="disabled ? -1 : 0"
193
- @click.stop="toggleExpansion"
194
- @keydown.stop="onIconKeydown"
195
- >
196
- </q-icon>
203
+ <template v-if="!toggleIconLeft">
204
+ <UBtnStd
205
+ v-if="useExpansionButton"
206
+ v-bind="expansionButtonProps"
207
+ :aria-label="isExpanded ? collapsedAriaLabel : expandAriaLabel"
208
+ :tabindex="disabled ? -1 : 0"
209
+ @click.stop="toggleExpansion"
210
+ @keydown.stop="onIconKeydown"
211
+ />
212
+ <q-icon
213
+ v-else
214
+ :class="[
215
+ 'cursor-pointer',
216
+ 'icon-secondary-opacity',
217
+ 'transition-all',
218
+ expansionIcon,
219
+ isExpanded ? toggleIconRotationClass : '',
220
+ ]"
221
+ :aria-label="isExpanded ? collapsedAriaLabel : expandAriaLabel"
222
+ :color="expansionIconColor"
223
+ :size="expansionIconSize"
224
+ :tabindex="disabled ? -1 : 0"
225
+ @click.stop="toggleExpansion"
226
+ @keydown.stop="onIconKeydown"
227
+ />
228
+ </template>
197
229
  </div>
198
230
  </template>
199
231
  <slot name="body" />
@@ -258,11 +290,25 @@ watch(
258
290
  :description="label"
259
291
  :offset="[14, 14]"
260
292
  />
261
- <span class="text-body-xs text-description">{{ caption }}</span>
293
+ <template v-if="$slots.caption">
294
+ <slot name="caption" />
295
+ </template>
296
+ <template v-else>
297
+ <span class="text-body-xs text-description">{{ caption }}</span>
298
+ </template>
262
299
  </div>
263
- <q-icon
264
- v-if="!toggleIconLeft"
265
- :class="[
300
+ <template v-if="!toggleIconLeft">
301
+ <UBtnStd
302
+ v-if="useExpansionButton"
303
+ v-bind="expansionButtonProps"
304
+ :aria-label="isExpanded ? collapsedAriaLabel : expandAriaLabel"
305
+ :tabindex="disabled ? -1 : 0"
306
+ @click.stop="toggleExpansion"
307
+ @keydown.stop="onIconKeydown"
308
+ />
309
+ <q-icon
310
+ v-else
311
+ :class="[
266
312
  'cursor-pointer',
267
313
  'icon-secondary-opacity',
268
314
  'transition-all',
@@ -271,8 +317,8 @@ watch(
271
317
  ]"
272
318
  :color="expansionIconColor"
273
319
  :size="expansionIconSize"
274
- >
275
- </q-icon>
320
+ />
321
+ </template>
276
322
  </div>
277
323
  </template>
278
324
  <slot name="body" />
@@ -1697,4 +1697,6 @@ watch(
1697
1697
  .table-text-colormap-positive
1698
1698
  color: $green-6 !important
1699
1699
 
1700
+ .table-text-colormap-accent
1701
+ color: $red-5 !important
1700
1702
  </style>