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

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/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Component Library v1.0.0-alpha.13
1
+ # Component Library v1.0.0-alpha.15
2
2
 
3
3
  This library provides custom UI components for USSSA applications.
4
4
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@usssa/component-library",
3
- "version": "1.0.0-alpha.13",
3
+ "version": "1.0.0-alpha.15",
4
4
  "description": "A Quasar component library project",
5
5
  "productName": "Quasar component library App",
6
6
  "author": "Troy Moreland <troy.moreland@usssa.com>",
@@ -22,11 +22,9 @@ const props = defineProps({
22
22
  },
23
23
  primaryActionLabel: {
24
24
  type: String,
25
- default: 'Action 1',
26
25
  },
27
26
  secondaryActionLabel: {
28
27
  type: String,
29
- default: 'Action 2',
30
28
  },
31
29
  })
32
30
 
@@ -40,6 +40,10 @@ const props = defineProps({
40
40
  type: String,
41
41
  default: 'center end',
42
42
  },
43
+ offset: {
44
+ type: Array,
45
+ default: () => [4, 4],
46
+ },
43
47
  })
44
48
 
45
49
  const emit = defineEmits(['onClick'])
@@ -97,7 +101,7 @@ const btnClass = computed(() => {
97
101
  :description="tooltip"
98
102
  :anchor="anchor"
99
103
  :self="self"
100
- :offset="[4, 4]"
104
+ :offset="offset"
101
105
  />
102
106
  </q-btn>
103
107
  </template>
@@ -140,6 +144,9 @@ const btnClass = computed(() => {
140
144
  &.neutral-9
141
145
  color: $neutral-9
142
146
 
147
+ &.accent
148
+ background: $accent-bg-hover
149
+
143
150
  .icon-tooltip
144
151
  background: $dark
145
152
  border-radius: $xxs
@@ -72,26 +72,30 @@ const isFullWidth = computed(() => {
72
72
  :flat="flat"
73
73
  @click="handleClick"
74
74
  >
75
- <div class="row items-center no-wrap">
76
- <q-icon
77
- v-if="leftIcon"
78
- left
79
- :class="leftIcon"
80
- class="q-mr-xs"
81
- size="1.25rem"
82
- />
75
+ <template #default>
76
+ <slot name="default">
77
+ <div class="row items-center no-wrap">
78
+ <q-icon
79
+ v-if="leftIcon"
80
+ left
81
+ :class="leftIcon"
82
+ class="q-mr-xs"
83
+ size="1.25rem"
84
+ />
83
85
 
84
- <div class="text-center text-caption-md button-label">
85
- {{ label }}
86
- </div>
87
- <q-icon
88
- v-if="rightIcon"
89
- right
90
- :class="rightIcon"
91
- class="q-ml-xs"
92
- size="1.25rem"
93
- />
94
- </div>
86
+ <div class="text-center text-caption-md button-label">
87
+ {{ label }}
88
+ </div>
89
+ <q-icon
90
+ v-if="rightIcon"
91
+ right
92
+ :class="rightIcon"
93
+ class="q-ml-xs"
94
+ size="1.25rem"
95
+ />
96
+ </div>
97
+ </slot>
98
+ </template>
95
99
  </q-btn>
96
100
  </template>
97
101
 
@@ -7,7 +7,6 @@ const props = defineProps({
7
7
  },
8
8
  hintIcon: {
9
9
  type: String,
10
- default: 'fa-kit-duotone fa-circle-info',
11
10
  },
12
11
  isRequired: {
13
12
  type: Boolean,
@@ -32,7 +31,9 @@ const props = defineProps({
32
31
  },
33
32
  placeholder: {
34
33
  type: String,
35
- default: 'Input Text',
34
+ },
35
+ rightIconAriaLabel: {
36
+ type: String,
36
37
  },
37
38
  size: {
38
39
  type: String,
@@ -147,14 +148,21 @@ const handleRightIconClick = () => {
147
148
  <div class="q-ml-xxs text-body-xs">{{ hintText }}</div>
148
149
  </div>
149
150
  </template>
150
- <template #append v-if="rightIcon">
151
- <q-icon
152
- @click="handleRightIconClick"
153
- :class="`slot-icon-size-${size} ${rightIcon}`"
154
- :tabindex="0"
155
- />
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>
156
165
  </template>
157
-
158
166
  <template v-slot:error>
159
167
  <div class="row items-center no-wrap" v-if="errorMessage">
160
168
  <q-icon
@@ -113,7 +113,6 @@ const chipModelVal = ref(true)
113
113
  :option-label="optionLabel"
114
114
  :option-value="optionValue"
115
115
  :placeholder="placeholder"
116
- dropdown-icon="img:icons/caret-down.svg"
117
116
  bottom-slots
118
117
  outlined
119
118
  hide-bottom-space
@@ -108,7 +108,6 @@ const model = computed({
108
108
  :class="`field-${size}`"
109
109
  id="select"
110
110
  :color="color"
111
- dropdown-icon="img:/icons/caret-down.svg"
112
111
  emit-value
113
112
  map-options
114
113
  :menu-offset="[0, 5]"
@@ -383,24 +383,32 @@ const onRowPerPageChange = (value) => {
383
383
  <template v-else-if="col.avatarKey">
384
384
  <div class="flex justify-start items-center">
385
385
  <div
386
- :class="`${
387
- !multiSelection
388
- ? 'table-data-avatar-right'
389
- : 'table-data-avatar-left'
390
- }`"
386
+ v-if="
387
+ props.row[col.avatarKey] &&
388
+ typeof props.row[col.avatarKey] === 'object'
389
+ "
390
+ class="table-data-avatar"
391
391
  >
392
392
  <UAvatar
393
+ v-if="props.row[col.avatarKey]?.type === 'initials'"
394
+ size="md"
395
+ :name="`${props.row[col.avatarKey]?.value}`"
396
+ />
397
+ <UAvatar
398
+ v-else-if="props.row[col.avatarKey]?.type === 'image'"
399
+ size="md"
393
400
  :name="
394
- props.row[col.avatarKey]
395
- ? props.row[col.avatarKey]
396
- : 'Need to get initials of Name, replace with initial common function'
401
+ props.row[col.avatarKey]?.name ??
402
+ props.row[col.avatarKey]?.value
397
403
  "
404
+ :image="`${props.row[col.avatarKey]?.value}`"
405
+ />
406
+ </div>
407
+ <div v-else class="table-data-avatar">
408
+ <UAvatar
398
409
  size="md"
399
- :image="`${
400
- props.row[col.avatarKey]
401
- ? props.row[col.avatarKey]
402
- : 'https://cdn.quasar.dev/img/avatar1.jpg'
403
- }`"
410
+ :name="`${props.row[col.avatarKey]}`"
411
+ :image="`${props.row[col.avatarKey]}`"
404
412
  />
405
413
  </div>
406
414
  <div class="td-grid-content">
@@ -521,13 +529,10 @@ const onRowPerPageChange = (value) => {
521
529
  width: $md
522
530
  color: $neutral-9
523
531
 
524
- .table-data-avatar-left
532
+ .table-data-avatar
525
533
  padding: $xs
526
534
  padding-left: 0px
527
535
 
528
- .table-data-avatar-right
529
- padding: $xs
530
-
531
536
  .td-caption
532
537
  color: $description
533
538