@usssa/component-library 1.0.0-alpha.23 → 1.0.0-alpha.25

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.22
1
+ # Component Library v1.0.0-alpha.24
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.23",
3
+ "version": "1.0.0-alpha.25",
4
4
  "description": "A Quasar component library project",
5
5
  "productName": "Quasar component library App",
6
6
  "author": "Troy Moreland <troy.moreland@usssa.com>",
@@ -1,5 +1,6 @@
1
1
  <script setup>
2
2
  import { computed } from 'vue'
3
+ import UTooltip from './UTooltip.vue'
3
4
 
4
5
  const props = defineProps({
5
6
  chipLabel: {
@@ -35,6 +36,18 @@ const props = defineProps({
35
36
  remove: {
36
37
  type: Function,
37
38
  },
39
+ isShowTooltip: {
40
+ type: Boolean,
41
+ default: false,
42
+ },
43
+ offset: {
44
+ default: () => [14, 14],
45
+ type: Array,
46
+ },
47
+ anchor: {
48
+ type: String,
49
+ default: 'bottom middle',
50
+ },
38
51
  })
39
52
 
40
53
  const emit = defineEmits(['update:modelValue', 'onClick'])
@@ -79,6 +92,12 @@ const avatarLabel = computed(() => {
79
92
  <span :class="`chip-label text-overline-${size} text-uppercase`">
80
93
  {{ chipLabel }}
81
94
  </span>
95
+ <UTooltip
96
+ v-if="isShowTooltip"
97
+ :description="chipLabel"
98
+ :offset="offset"
99
+ :anchor="anchor"
100
+ />
82
101
  </q-chip>
83
102
  </template>
84
103
 
@@ -223,4 +242,10 @@ const avatarLabel = computed(() => {
223
242
 
224
243
  .q-chip__icon--remove
225
244
  padding: $xxs
245
+
246
+ .chip-label
247
+ max-width: 12.5rem
248
+ white-space: normal
249
+ overflow-wrap: break-word
250
+ line-height: 1.2 !important // over-ridding this in long chip label case
226
251
  </style>
@@ -1,6 +1,7 @@
1
1
  <script setup>
2
2
  import { computed } from 'vue'
3
3
  import UTooltip from './UTooltip.vue'
4
+
4
5
  const props = defineProps({
5
6
  hintText: {
6
7
  type: String,
@@ -64,6 +65,13 @@ const props = defineProps({
64
65
  type: Boolean,
65
66
  default: false,
66
67
  },
68
+ parentClass: {
69
+ type: String,
70
+ },
71
+ })
72
+
73
+ defineOptions({
74
+ inheritAttrs: false,
67
75
  })
68
76
 
69
77
  const leftBorderRadius = computed(() => {
@@ -82,101 +90,99 @@ const handleRightIconClick = () => {
82
90
  </script>
83
91
 
84
92
  <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"
93
+ <div class="q-gutter-xs" :class="parentClass">
94
+ <label
95
+ v-if="label"
96
+ role="label"
97
+ for="input"
98
+ class="row items-center q-mb-xxs"
99
+ >
100
+ <div class="u-input-label text-body-sm">
101
+ {{ label }}
102
+ <span class="text-red-5 text-body-sm q-mx-xxs" v-if="isRequired">
103
+ *
104
+ </span>
105
+ </div>
106
+ <q-icon
107
+ class="q-ml-xxs fa-kit-duotone fa-circle-info cursor-pointer"
108
+ v-if="toolTipText"
109
+ size="1rem"
110
+ color="neutral-9"
111
+ :aria-label="toolTipText"
92
112
  >
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>
113
+ <UTooltip
114
+ :description="toolTipText"
115
+ anchor="top middle"
116
+ self="bottom middle"
117
+ :offset="[0, 0]"
118
+ />
119
+ </q-icon>
120
+ </label>
121
+ <q-input
122
+ id="input"
123
+ class="u-input"
124
+ :class="`field-${size} ${leftBorderRadius}`"
125
+ v-model="modelValue"
126
+ name="input"
127
+ :outlined="outlined"
128
+ :placeholder="placeholder"
129
+ :rules="validationRules"
130
+ :standout="!outlined"
131
+ type="text"
132
+ :bottom-slots="!!hintText"
133
+ hide-bottom-space
134
+ :readonly="readonly"
135
+ :disable="disable"
136
+ :borderless="borderless"
137
+ :error="error"
138
+ v-bind="$attrs"
139
+ >
140
+ <template #prepend v-if="leftIcon">
141
+ <slot name="prepend"></slot>
99
142
  <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]"
143
+ v-if="!$slots.prepend"
144
+ :class="`slot-icon-size-${size} ${leftIcon}`"
145
+ />
146
+ </template>
147
+ <template #hint v-if="hintText">
148
+ <div class="row items-center text-neutral-9 no-wrap">
149
+ <q-icon
150
+ :class="hintIcon"
151
+ v-if="hintIcon"
152
+ size="1rem"
153
+ :aria-label="hintText"
111
154
  />
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>
155
+ <div class="q-ml-xxs text-body-xs">{{ hintText }}</div>
156
+ </div>
157
+ </template>
158
+ <template #append>
159
+ <slot name="append">
135
160
  <q-icon
136
- v-if="!$slots.prepend"
137
- :class="`slot-icon-size-${size} ${leftIcon}`"
161
+ v-if="rightIcon"
162
+ @click="handleRightIconClick"
163
+ :class="`slot-icon-size-${size} ${rightIcon}`"
164
+ :tabindex="0"
165
+ :aria-label="
166
+ rightIcon && rightIconAriaLabel
167
+ ? rightIconAriaLabel
168
+ : 'right input icon '
169
+ "
138
170
  />
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>
171
+ </slot>
172
+ </template>
173
+ <template v-slot:error>
174
+ <div class="row items-center no-wrap" v-if="errorMessage">
175
+ <q-icon
176
+ class="fa-kit-duotone fa-warning-octagon"
177
+ size="1rem"
178
+ :aria-label="errorMessage"
179
+ />
180
+ <div class="q-ml-xxs text-body-xs" role="validation error">
181
+ {{ errorMessage }}
176
182
  </div>
177
- </template>
178
- </q-input>
179
- </div>
183
+ </div>
184
+ </template>
185
+ </q-input>
180
186
  </div>
181
187
  </template>
182
188
 
@@ -158,11 +158,11 @@ const isRowSelected = (row) => {
158
158
  if (value !== null) {
159
159
  selectedRows.value.splice(0, selectedRows.value.length)
160
160
  } else {
161
- handleSelectAllData().then((res) => {
162
- if (res === 200) {
163
- customLoading.value = false
164
- }
165
- })
161
+ handleSelectAllData().then((res) => {
162
+ if (res === 200) {
163
+ customLoading.value = false
164
+ }
165
+ })
166
166
  }
167
167
  },
168
168
  })
@@ -311,7 +311,12 @@ const onRowPerPageChange = (value) => {
311
311
  :separator="separator"
312
312
  :style="col.headerStyle"
313
313
  >
314
- {{ col.label }}
314
+ <span
315
+ :class="`${col.field === 'action' ? 'hidden-header-label' : ''}`"
316
+ >
317
+ {{ col.field === 'action' ? 'Action' : col.label }}
318
+ </span>
319
+
315
320
  <span v-if="col.sortable && col.field !== 'action'">
316
321
  <q-btn label="Sorting Button" :ripple="false" class="u-sorting-btn">
317
322
  <q-icon
@@ -369,6 +374,9 @@ const onRowPerPageChange = (value) => {
369
374
  :chipLabel="props.row[col.field].toString()"
370
375
  :removable="false"
371
376
  class="u-table-chip"
377
+ :is-show-tooltip="col.showChipTooltip"
378
+ :offset="col.offset"
379
+ :anchor="col.anchor"
372
380
  />
373
381
  </template>
374
382
  <!-- to show the avatar of user image with name and other details -->
@@ -622,4 +630,7 @@ const onRowPerPageChange = (value) => {
622
630
  .td-grid-content
623
631
  text-wrap: balance
624
632
  word-break: break-all
633
+
634
+ .hidden-header-label
635
+ visibility: hidden
625
636
  </style>
@@ -22,19 +22,24 @@ const typeOptions = [
22
22
 
23
23
  const dense = ref(false)
24
24
  const removable = ref(false)
25
+ const isShowTooltip = ref(false)
25
26
  const modelVal = ref(true)
26
27
 
27
- const htmlContent = ` <UChip
28
- ref="chip"
29
- v-model="modelVal"
30
- @update:modelValue="modelVal = $event"
31
- :type="type"
32
- :dense="dense"
33
- :iconClass="iconClass"
34
- :avatarLabel="avatarLabel"
35
- :chipLabel="chipLabel"
36
- :removable="removable"
37
- />`
28
+ const htmlContent = `
29
+ <UChip
30
+ ref="chip"
31
+ v-model="modelVal"
32
+ @update:modelValue="modelVal = $event"
33
+ :type="type"
34
+ :dense="dense"
35
+ :iconClass="iconClass"
36
+ :avatarLabel="avatarLabel"
37
+ :chipLabel="chipLabel"
38
+ :removable="removable"
39
+ :isShowTooltip="isShowTooltip"
40
+ :offset="[14, 14]"
41
+ anchor="bottom middle"
42
+ />`
38
43
 
39
44
  defineOptions({
40
45
  name: 'UChip',
@@ -57,6 +62,9 @@ defineOptions({
57
62
  :avatarLabel="avatarLabel"
58
63
  :chipLabel="chipLabel"
59
64
  :removable="removable"
65
+ :isShowTooltip="isShowTooltip"
66
+ :offset="[14, 14]"
67
+ anchor="bottom middle"
60
68
  />
61
69
  </template>
62
70
 
@@ -67,6 +75,14 @@ defineOptions({
67
75
  <!-- <q-input label="Icon" v-model="icon"></q-input> -->
68
76
  <q-input label="Icon Class" v-model="iconClass"></q-input>
69
77
  <q-select v-model="type" :options="typeOptions" label="Chip Type" />
78
+ <div class="column">
79
+ <span class="text-grey-8 text-caption-sm">Chip Layout Type</span>
80
+ <q-checkbox
81
+ size="xs"
82
+ v-model="isShowTooltip"
83
+ label="Show Tooltip"
84
+ />
85
+ </div>
70
86
 
71
87
  <div class="column">
72
88
  <span class="text-grey-8 text-caption-sm">Chip Layout Type</span>
@@ -80,6 +80,7 @@ defineOptions({
80
80
  :borderless="borderless"
81
81
  :outlined="outline"
82
82
  :leftBorderRadius="leftBorderRadius"
83
+ parentClass="q-mb-ms"
83
84
  />
84
85
  </template>
85
86
 
@@ -45,6 +45,7 @@ const htmlContent = `<UTableStd
45
45
  classes: 'my-classs', // custom class on td
46
46
  headerStyle: 'width:50%', // custom header style
47
47
  headerClasses: 'my-header-class', // custom header classes
48
+ showChipTooltip:true/false // to hide show tooltip on chip
48
49
  }
49
50
  `
50
51
 
@@ -116,6 +117,9 @@ const columns = ref([
116
117
  { value: 'Default', color: 'primary' },
117
118
  ],
118
119
  align: 'center',
120
+ showChipTooltip: true, // to show and hide tooltip on chip only
121
+ offset: [14, 14], // tooltip offset to set position
122
+ anchor: 'bottom middle', // tooltip anchor
119
123
  autoWidth: true,
120
124
  },
121
125
  {