@@ -15,20 +15,41 @@ export const connect = (...args) => connectToStore(...args);
1515
1616export const X_SEARCH_CLIENT = 'ReactiveSearch Vue' ;
1717
18- export const composeThemeObject = ( ownTheme = { } , userTheme = { } ) => ( {
19- typography : {
20- ...ownTheme . typography ,
21- ...userTheme . typography ,
22- } ,
23- colors : {
24- ...ownTheme . colors ,
25- ...userTheme . colors ,
26- } ,
27- component : {
28- ...ownTheme . component ,
29- ...userTheme . component ,
30- } ,
31- } ) ;
18+ export const composeThemeObject = ( ownTheme = { } , userThemeParam = { } ) => {
19+ let userTheme = { } ;
20+ if ( userThemeParam ) {
21+ userTheme = { ...userThemeParam } ;
22+ } else {
23+ userTheme = {
24+ typography : {
25+ fontFamily : 'inherit' ,
26+ fontSize : 'inherit' ,
27+ } ,
28+ colors : {
29+ textColor : 'inherit' ,
30+ primaryTextColor : 'inherit' ,
31+ primaryColor : 'inherit' ,
32+ titleColor : 'inherit' ,
33+ alertColor : 'inherit' ,
34+ borderColor : 'inherit' ,
35+ } ,
36+ } ;
37+ }
38+ return {
39+ typography : {
40+ ...ownTheme . typography ,
41+ ...userTheme . typography ,
42+ } ,
43+ colors : {
44+ ...ownTheme . colors ,
45+ ...userTheme . colors ,
46+ } ,
47+ component : {
48+ ...ownTheme . component ,
49+ ...userTheme . component ,
50+ } ,
51+ } ;
52+ } ;
3253/**
3354 * To determine wether an element is a function
3455 * @param {any } element
@@ -120,15 +141,15 @@ export const hasQuerySuggestionsRenderer = (_ref = {}) => {
120141 * @returns {string }
121142 */
122143export const getCamelCase = ( str = '' ) => {
123- const propsWhichRequirePascalCase = [ 'u-r-l-params' ]
144+ const propsWhichRequirePascalCase = [ 'u-r-l-params' ] ;
124145 const arr = str . split ( '-' ) ;
125146 const capital = arr . map ( ( item , index ) =>
126147 index ? item . charAt ( 0 ) . toUpperCase ( ) + item . slice ( 1 ) . toLowerCase ( ) : item ,
127148 ) ;
128149 // ^-- change here.
129150 let capitalString = capital . join ( '' ) ;
130- if ( propsWhichRequirePascalCase . includes ( str ) )
131- capitalString = capitalString [ 0 ] . toUpperCase ( ) + capitalString . substring ( 1 )
151+ if ( propsWhichRequirePascalCase . includes ( str ) )
152+ capitalString = capitalString [ 0 ] . toUpperCase ( ) + capitalString . substring ( 1 ) ;
132153 return capitalString || '' ;
133154} ;
134155
0 commit comments