@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,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
|
-
<
|
|
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
|
-
<
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
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
|
-
<
|
|
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
|
-
<
|
|
264
|
-
|
|
265
|
-
|
|
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
|
-
</
|
|
320
|
+
/>
|
|
321
|
+
</template>
|
|
276
322
|
</div>
|
|
277
323
|
</template>
|
|
278
324
|
<slot name="body" />
|