99 >
1010 <ScrollAreaRoot
1111 type =" auto"
12- :class =" mapClasses(classObj, `${BASE_CLASS}__root`)"
12+ :class =" [
13+ mapClasses(classObj, `${BASE_CLASS}__root`),
14+ classAttr ? `${classAttr}__root` : null,
15+ ]"
1316 >
1417 <ScrollAreaViewport
1518 ref =" framesRef"
16- :class =" mapClasses(classObj, `${BASE_CLASS}__viewport`)"
19+ :class =" [
20+ mapClasses(classObj, `${BASE_CLASS}__viewport`),
21+ classAttr ? `${classAttr}__viewport` : null,
22+ ]"
1723 :aria-label =" description || `${frames.length} items`"
1824 :tabindex =" viewportTabindex"
1925 >
2026 <ul
2127 :id =" `${id}-frames`"
22- :class =" mapClasses(classObj, `${BASE_CLASS}__frames`)"
28+ :class =" [
29+ mapClasses(classObj, `${BASE_CLASS}__frames`),
30+ classAttr && `${classAttr}__frames`,
31+ ]"
2332 :data-ui =" `${BASE_CLASS}__frames`"
2433 >
2534 <li
2635 v-for =" (frame, index) in frames"
2736 :key =" frame.key"
2837 ref =" framesItemsRef"
29- :class =" mapClasses(classObj, `${BASE_CLASS}__frame`)"
38+ :class =" [
39+ mapClasses(classObj, `${BASE_CLASS}__frame`),
40+ classAttr ? `${classAttr}__frame` : null,
41+ ]"
3042 >
3143 <slot
3244 name =" frame"
3850 </ul >
3951 </ScrollAreaViewport >
4052 <ScrollAreaScrollbar
41- :class =" mapClasses(classObj, `${BASE_CLASS}__bar`, `${BASE_CLASS}__bar--horizontal`)"
53+ :class =" [
54+ mapClasses(classObj, `${BASE_CLASS}__bar`, `${BASE_CLASS}__bar--horizontal`),
55+ classAttr ? `${classAttr}__bar` : null,
56+ classAttr ? `${classAttr}__bar--horizontal` : null,
57+ ]"
4258 orientation =" horizontal"
4359 >
44- <ScrollAreaThumb :class =" mapClasses(classObj, `${BASE_CLASS}__thumb`)" />
60+ <ScrollAreaThumb
61+ :class =" [
62+ mapClasses(classObj, `${BASE_CLASS}__thumb`),
63+ classAttr ? `${classAttr}__thumb` : null,
64+ ]"
65+ />
4566 </ScrollAreaScrollbar >
4667 </ScrollAreaRoot >
4768 <template v-for =" { direction , attributes , icon } in arrows " >
@@ -84,7 +105,7 @@ import type {
84105 CdrFilmstripEngine ,
85106 CdrFilmstripArrow ,
86107} from ' ./interfaces' ;
87- import { computed , onMounted , onUnmounted , ref , useCssModule } from ' vue' ;
108+ import { computed , onMounted , onUnmounted , ref , useAttrs , useCssModule } from ' vue' ;
88109
89110const classObj = useCssModule ();
90111const BASE_CLASS = ' cdr-filmstrip' ;
@@ -109,6 +130,16 @@ const props = withDefaults(defineProps<CdrFilmstripEngine>(), {
109130 viewportTabindex: ' -1' ,
110131});
111132
133+ /**
134+ * Retrieves the component's attributes.
135+ */
136+ const attrs = useAttrs ();
137+
138+ /**
139+ * Extracts the class attribute from the component's attributes.
140+ */
141+ const classAttr = attrs .class || ' ' ;
142+
112143const emit = defineEmits <{
113144 (e : ' arrowClick' , payload : CdrFilmstripArrowClickPayload ): void ;
114145 (e : ' ariaMessage' , message : string ): void ;
@@ -184,12 +215,19 @@ const arrows = computed(() => {
184215 icon: direction === ' left' ? IconCaretLeft : IconCaretRight ,
185216 attributes: {
186217 ' data-ui' : ` ${BASE_CLASS }__arrow--${direction } ` ,
187- class: mapClasses (
188- classObj ,
189- ` ${BASE_CLASS }__arrow ` ,
190- ` ${BASE_CLASS }__arrow--${direction } ` ,
191- isEnabled ? ' ' : ` ${BASE_CLASS }__arrow--disabled ` ,
192- ),
218+ class: [
219+ mapClasses (
220+ classObj ,
221+ ` ${BASE_CLASS }__arrow ` ,
222+ ` ${BASE_CLASS }__arrow--${direction } ` ,
223+ isEnabled ? ' ' : ` ${BASE_CLASS }__arrow--disabled ` ,
224+ ),
225+ classAttr ? ` ${classAttr }__arrow ` : null ,
226+ classAttr ? ` ${classAttr }__arrow--${direction } ` : null ,
227+ isEnabled ? ' ' : classAttr && ` ${BASE_CLASS }__arrow--disabled ` ,
228+ ]
229+ .filter (Boolean )
230+ .join (' ' ),
193231 ' aria-label' : ` ${direction === ' right' ? ' Next' : ' Previous' } Frame ` ,
194232 ' aria-controls' : ` ${props .id }-frames ` ,
195233 tabindex: 0 ,
0 commit comments