1818 class =" pa-0 ma-0"
1919 :order =" getOrder('linear')"
2020 >
21- <v-progress-linear
22- :color =" linearColor"
23- :height =" loaderHeight"
24- indeterminate
25- ></v-progress-linear >
21+ <v-progress-linear v-bind =" boundLinearProps" ></v-progress-linear >
2622 </v-col >
2723
2824 <v-col
2925 v-if =" checkLoaderType('circular')"
3026 class =" pa-0 my-2"
3127 :order =" getOrder('circular')"
3228 >
33- <v-progress-circular
34- :bg-color =" circularBackgroundColor"
35- :color =" circularColor"
36- indeterminate
37- :size =" size"
38- ></v-progress-circular >
29+ <v-progress-circular v-bind =" boundCircularProps" ></v-progress-circular >
3930 </v-col >
4031
4132 <v-col
4435 :order =" getOrder('skelton')"
4536 >
4637 <v-skeleton-loader
38+ v-bind =" boundSkeltonProps"
4739 :loading =" skeltonLoading"
48- :type =" currentSkeltonType"
4940 >
5041 </v-skeleton-loader >
5142 </v-col >
@@ -73,7 +64,7 @@ import {
7364 useLoaderTrStyles ,
7465 useLoaderVRowClasses ,
7566} from ' @/plugin/composables/loader' ;
76- import { useGetLevelColors } from ' @/plugin/composables/levelColors' ;
67+ import { getSingleColor } from ' @/plugin/composables/levelColors' ;
7768
7869
7970const theme = useTheme ();
@@ -86,19 +77,8 @@ const props = withDefaults(defineProps<TableLoader>(), {
8677 textLoader: true ,
8778});
8879
89- const baseColors = computed (() => {
90- if (typeof props .colors === ' object' && props .colors !== null ) {
91- return useGetLevelColors ({
92- colors: props .colors ,
93- level: props .level ,
94- prop: ' loader' ,
95- themeColors: theme ,
96- });
97- }
98-
99- return ;
100- });
10180
81+ // -------------------------------------------------- Classes & Styles //
10282const loaderTrStyles = computed <StyleValue >(() => useLoaderTrStyles ({
10383 isLinearOnly ,
10484 loaderHeight ,
@@ -113,13 +93,13 @@ const loaderContainerClasses = computed(() => useLoaderContainerClasses({ isLine
11393const loaderVRowClasses = computed (() => useLoaderVRowClasses ());
11494
11595
116- // v-progress-linear //
117- const linearColor = computed <string | undefined >(() => {
118- return baseColors .value ?.linear || ' ' ;
119- });
96+ // -------------------------------------------------- v-progress-linear //
97+ const boundLinearProps = computed (() => props .loaderProps .linear );
12098
12199const loaderHeight = computed (() => {
122- return useLoaderHeight (props .height as string | number );
100+ const height = props .loaderProps .linear ?.height || ' 2px' ;
101+
102+ return useLoaderHeight (height as string | number );
123103});
124104
125105const isLinearOnly = computed <boolean >(() => {
@@ -133,30 +113,25 @@ const isLinearOnly = computed<boolean>(() => {
133113});
134114
135115
136- // v-progress-circular //
137- const circularBackgroundColor = computed <string | undefined >(() => {
138- return baseColors .value ?.bg ;
139- });
140-
141- const circularColor = computed <string | undefined >(() => {
142- return baseColors .value ?.circular ;
143- });
116+ // -------------------------------------------------- v-progress-circular //
117+ const boundCircularProps = computed (() => props .loaderProps .circular );
144118
145119
146- // v-skeleton-loader //
147- const currentSkeltonType = computed <string >(() => {
148- return props .skeltonType || ' heading@1' ;
149- });
120+ // -------------------------------------------------- v-skeleton-loader //
121+ const boundSkeltonProps = computed (() => props .loaderProps .skelton );
150122
151123const skeltonLoading = computed (() => {
152124 return props .loading as boolean ;
153125});
154126
155127
156- // loadingText //
128+ // -------------------------------------------------- loadingText //
157129const textStyles = computed <StyleValue >(() => {
130+ let textColor = props .loaderProps .text ?.color || ' surface-variant' ;
131+ textColor = getSingleColor (textColor , theme );
132+
158133 const styles = {
159- color: baseColors . value ?. text ,
134+ color: textColor ,
160135 };
161136
162137 return styles ;
@@ -167,6 +142,8 @@ const computedLoadingText = computed<string>(() => {
167142});
168143
169144
145+ // -------------------------------------------------- Methods //
146+
170147// Get the order of the loader type //
171148const getOrder = (type : string ): number => {
172149 const loaderType = props .loaderType ;
0 commit comments